Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. http://www.mediafire.com/file/lqofqvseogns2hy/Warthogrun.rar Lighting is a bit fobarbed so I may redo it later using actual light maps but, made this while testing the tools, though turns out a made a typo in one of the max lines so fixed ones are here http://www.mediafire.com/file/h4c05a716da59ea/JSTools.ms
  2. Quit spamming here and post in https://forum.multitheftauto.com/forum/149-looking-for-staff/
  3. I'll be making a tutorial later on how to make a full map and port it into MTA. Sorry if you had already downloaded please redownload. I made a mistake in the config file ordering. http://www.mediafire.com/file/nddddtn9kbg96b2/JConvertor.rar If you get any other errors rename Data to data, some operating systems are case sensitive.
  4. Redirected links to mediafire, I'll be getting website back online in a few months.
  5. JConvertor Ever wanted to put an SA map into MTA but had issues with Scene2Res and found it impossible to do manually?; well here I present Convertor (For use with J Streamer) What does this do? - Converts the map (IPL and IDE files) - Only copies needed files (If it's part of the standard SA it'll only print the position and name into the JS Placement file - Converts water (If there are too many planes then you need to manually make the water - Converts train track placement //WIP will come soon - Can seamlessly load a map MTA so long as it's converted and made correctly - Manages vegetation swaying - Automatically fades objects that shouldn't be visible during night or day - Properly assigns LODs - Gives objects proper tags such as ALPHA, CULLING, etc Usage Drag the maps Data folder into the root of the convertor resource(This handles IPLs, IDEs, Water, Etc) Drag all DFF and TXD files into the resources folder Place Collisions into their own folder Open Colleditor2 http://www.steve-m.com/downloads/tools/colleditor2/ Drag and drop all of the collisions into COL editor Select all of the collisions (In COL editor) Right click - > Export - > Single Col files -> then export into the resources folder Change name or position in config file Run the Convertor as a resource and watch the magic happen Fix any errors in Debug.txt (If any) Run again (If needed) Run the map with OBJs running https://github.com/CodyJL/J-Map-Convertor J 3Ds Max Tool Kit What does this do? - Export JSP strings - Export JSD strings - Export Meta strings - Export COLs - Export DFFs (If you wanna use it figure it out yourself) https://github.com/CodyJL/JStreamer/tree/master/Tools JStreamer (OBJs) What does this do? - Load maps - Automatically assigns IDs to objects - Tries to allow you a full range of possibilities (Using SA content along side custom content seamlessly) - Allows you to create maps in a very tidy way. https://github.com/CodyJL/JStreamer JResources Discord
  6. Copy the polys and invert them. I personally just use my own loader for this stuff that can globally define variables such as that.
  7. New update for forums corrupted something so at the moment forums are messed up and I'm going to likely take them offline tomorrow. Links for the moment will not work; if you want a specific map PM me.
  8. setElementDoubleSided Adding a second layer is a waste of polys unless you intend on adding another texture or different lighting.
  9. Enable the alpha flag when loading the DFF.
  10. With the amount of core changes done that would likely not be plausible.
  11. The current lua system is heavily modified; adding in an updated system would require a rewrite of hundreds of thousands lines of code that have accumulated over years. MTA simply doesn't have a big enough development team left to accomplish stuff such as that.
  12. Alright, cool; wasn't paying attention to which element you were using on the first part.
  13. Are you syncing the light rotation W/ the vehicle rotation? Oh wait, try this I misread before and wasn't paying attention to what I was grabbing position of. local lightShadowVisibleDistance = 50 local lightShadowTypes = { ["pointlight"] = dxCreateTexture("files/images/pointlight.png"), ["taillight"] = dxCreateTexture("files/images/taillight.png"), } local groundLightShadows = {} local attachedGroundLightShadows = {} function createLightShadow(x, y, z, shadowType, size, r,g,b,a) local vehicleLightShadow = createElement("vehicleLightShadow") local groundPosition = getGroundPosition(x, y, z) setElementPosition(vehicleLightShadow, x, y, groundPosition+0.03) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if not a then a = 255 end if not size then size = 2 end if not shadowType then shadowType = "normal" end local array = {} array.color = {r,g,b,a} array.size = size array.lightShadow = vehicleLightShadow array.lightShadowType = shadowType groundLightShadows[vehicleLightShadow] = array return vehicleLightShadow end function attachGroundLightShadow(lightShadow, element, pos) attachedGroundLightShadows[lightShadow] = { lightShadow = lightShadow, element = element, pos = pos } addEventHandler("onClientElementDestroy", lightShadow, function() attachedGroundLightShadows[lightShadow] = nil end) addEventHandler("onClientElementDestroy", element, function() attachedGroundLightShadows[lightShadow] = nil end) return true end local function getPositionInFront(element,meters,component) local x,y,z = getVehicleComponentPosition(element, component, "world") local a,b,r = getVehicleComponentRotation(element, component, "world") x = x - math.sin(math.rad(r)) * meters y = y + math.cos(math.rad(r)) * meters return x,y end addEventHandler("onClientPreRender", root, function() local cameraX, cameraY, cameraZ = getCameraMatrix() for groundLightShadow, info in pairs(attachedGroundLightShadows) do local x, y, z = getPositionFromElementOffset(info.element, info.pos.x, info.pos.y, info.pos.z) setElementPosition(groundLightShadow, x, y, z) end for k, data in pairs(groundLightShadows) do if data.lightShadow and isElement(data.lightShadow) then local worldX, worldY, worldZ = getElementPosition(data.lightShadow) local groundPosition = getGroundPosition(worldX, worldY, worldZ) local fixedGroundPosition = groundPosition+0.03 local onScreenX, onScreenY = getScreenFromWorldPosition(worldX, worldY, fixedGroundPosition, 20) if onScreenX and onScreenY then local lightColor = data.color local distance = getDistanceBetweenPoints3D(worldX, worldY, fixedGroundPosition, cameraX, cameraY, cameraZ) if distance <= lightShadowVisibleDistance then if isLineOfSightClear(cameraX, cameraY, cameraZ, worldX, worldY, fixedGroundPosition, true, false, false, false, false, true) then local matching = attachedGroundLightShadows[data.lightShadow] if matching then local elementX, elementY, elementZ = getElementPosition(matching.element) local rx, ry, rz = getElementRotation(matching.element) local facez = getGroundPosition(elementX, elementY, elementZ + 5000000) local x, y, z = getPositionFromElementOffset(matching.element, matching.pos.x, matching.pos.y, facez) local xa, ya, za = getPositionFromElementOffset(data.lightShadow,0, -data.size, 0) local xb, yb, zb = getPositionFromElementOffset(data.lightShadow,0, data.size, 0) if elementZ <= fixedGroundPosition+2 then dxSetBlendMode("add") dxDrawMaterialLine3D(xa, ya, fixedGroundPosition, xb, yb, fixedGroundPosition, lightShadowTypes[data.lightShadowType], data.size*2, tocolor(lightColor[1],lightColor[2],lightColor[3],lightColor[4]), x, y, z) dxSetBlendMode("blend") end else dxSetBlendMode("add") dxDrawMaterialLine3D(xa, ya, fixedGroundPosition, xb, yb, fixedGroundPosition, lightShadowTypes[data.lightShadowType], data.size*2, tocolor(lightColor[1],lightColor[2],lightColor[3],lightColor[4]), x, y, z) dxSetBlendMode("blend") end end end end end end end, true, "low-1" ) function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or t end function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end collectgarbage("collect")
  14. faceTowardX/Y/Z: The position the front of the line should face towards. If this is not set, the camera position is used, so the front of the line faces toward the camera. Try putting the vehicle position here. Also worldX, worldY-data.size This is wrong, give me a moment and I'll write the correction local matching = attachedGroundLightShadows[data.lightShadow] if matching then local elementX, elementY, elementZ = getElementPosition(matching.element) local rx, ry, rz = getElementRotation(matching.element) local facez = getGroundPosition(elementX, elementY, elementZ) local xa, ya = getPositionFromElementOffset(matching.element, matching.pos.x, matching.pos.y-data.size, facez) local xb, yb = getPositionFromElementOffset(matching.element, matching.pos.x, matching.pos.y+data.size, facez) if elementZ <= fixedGroundPosition+2 then dxSetBlendMode("add") dxDrawMaterialLine3D(xa, ya, fixedGroundPosition, xb, yb, fixedGroundPosition, lightShadowTypes[data.lightShadowType], data.size*2, tocolor(lightColor[1],lightColor[2],lightColor[3],lightColor[4]), elementX, elementY, elementZ) dxSetBlendMode("blend") end else dxSetBlendMode("add") dxDrawMaterialLine3D(xa, ya, fixedGroundPosition, xb, yb, fixedGroundPosition, lightShadowTypes[data.lightShadowType], data.size*2, tocolor(lightColor[1],lightColor[2],lightColor[3],lightColor[4]), elementX, elementY, elementZ) dxSetBlendMode("blend") end Give this a try (I'm not 100% certain it's what you want due to some unclearly defined variables though)
  15. Everything that can be done through ASI can be done through lua.
  16. Just combine the TXDs. Due to MTAs TXD loading system it'll work just fine.
  17. Yes, however you'd need to explain a little bit better (What exactly you are attempting to achieve) to get the best help possible.
  18. Moved to correct forum also, please update topic using the formatting provided here.
  19. The codes are encrypted for a reason; even if possible to decrypt that information will not be shared.
  20. server.15 in the table servers exists then continue on.
  21. @MrTasty Kams script supports standard materials.
  22. For :Os sake do I have to explain it even clearer SA takes up 70% of the limit, however past 6000x6000 (SAs bounds) there is crashing, water functions don't work and calculations get a bit wanky. This streamer cannot add but rather replace objects (Meaning it'd replace parts of SA while LC or VC were streamed in The model restore functions in MTA are quite :Oed, meaning if I replaced parts of SA then restore them it causes flickering, crashing, missing objects, invisible objects Underground uses a modified streamer I cannot touch any of SAs default streamer functions sure I can hack my way around alot of them but some of them are impossible. This is the only successful conversion I've ever done that worked outside of SAs bounds. This is an older streamer but #1 LODs are absolutely :Oed, #2 When returning to SA everything in SA is completely :Oed.
  23. As ThatsMe put SA takes up the entire 6000x6000 area, leaving no extra space. As well as the fact that it'd put such a strain on SAs streamer (There's nothing I can do to change that) that it'd cause a magnificently low FPS.
×
×
  • Create New...