-
Posts
112 -
Joined
-
Last visited
-
Days Won
1
Everything posted by quindo
-
Here's my example of 2nd UV channel usage for that, it's much better than just using single channel because you can still use seamless textures. It may not fit exactly the style you're going for, but it's pretty fun to experiment with example
-
Nice work man, have you thought about adding 2nd UV channel to the models and using some prebaked lighting in it?
-
I know it isn't working, it's just a template showing how the script may look like.
-
I managed to do it in some improvised way, so if anyone is looking for this, here's some probably bad but working code: CLIENT: function addCheckpoint(posX,posY,posZ,size) exports.editor_main:suspend() triggerServerEvent("onCheckpointRequest",resourceRoot, track) end function setTemp(tempServer) if tempServer then exports.editor_main:doCloneElement(tempServer,2) setTimer(function() clone = exports.editor_main:getSelectedElement() triggerServerEvent("afterClone", resourceRoot, clone, posX, posY, posZ, size, track, tempServer) end,500,1) else outputChatBox("Couldn't detect last checkpoint") setTimer(function()exports.editor_main:resume()end,200,1) end end addEvent("receiveCheckpoint", true) addEventHandler("receiveCheckpoint", getRootElement(), setTemp) function resetProgress() exports.editor_main:resume() end addEvent("progressOver", true) addEventHandler("progressOver", getRootElement(), resetProgress) SERVER: function getCheckpoint(track) checkpoints = getElementsByType("checkpoint") for i,checkpoint in ipairs(checkpoints) do if <condition> then triggerClientEvent("receiveCheckpoint", getRootElement(),checkpoint,1) return end end triggerClientEvent("progressOver",getRootElement()) end addEvent("onCheckpointRequest", true) addEventHandler("onCheckpointRequest", resourceRoot, getCheckpoint) function manageClone(elem, posX, posY, posZ, size, track, orginal) exports.edf:edfSetElementProperty(elem,"something", 'something') exports.edf:edfSetElementProperty(elem,"somethingelse", 'somethingelse') exports.edf:edfSetElementPosition(elem,posX,posY,posZ) exports.edf:edfSetElementProperty(elem, "size", size*1.25) --SOME OTHER VARIABLES THAT YOU WANT, ETC, ETC triggerClientEvent("progressOver",getRootElement()) end addEvent("afterClone", true) addEventHandler("afterClone", resourceRoot, manageClone)
-
Where are you defining "i" variable? I don't see it anywhere in the code.
-
canwarp = 1 colshapes = { colshape1, colshape2, ... } function warp(thePlayer, ...) for i,colshape in ipairs(colshapes) do check = isElementWithinColShape(thePlayer, colshape) if check then canwarp = 0 break end end if canwarp == 1 then warpwarpwarpwarpfunction... else outputChatBox("can't warp here") end canwarp = 1 end Maybe something like that would work?
-
Hello everyone, I'm coming here with what is probably super easy question, but I can't figure it out for the whole day. I want to basically clone an element(checkpoint) that is already used in map editor, exactly the same way i would do it using "c" hotkey. The problem is that i don't want to use the hotkey, I have the element i want to clone, but can't clone it properly(assign next ID). i tried using newElement = exports.edf:edfCloneElement(element,true) but that gives me exactly the same object, with the same id and everything. I need it to have next free id. i also tried using newElement = exports.editor_main:import(createElement("checkpoint")) but that didn't work properly either, i couldn't modify element properties after creating the object.
-
Thank You! It's exactly what i needed, sorry for explaining it so bad in the first place.
-
Okay, sorry, i guess it was written in a bit of a rush. The thing is that i created the shader that applies bump map to custom object (the rocks in my first 2 screenshots), the original texture is mixed with the normal map (screenshot in my last reply). The shader takes the normal as a Value like this: normal = dxCreateTexture("normal/kamienie_nororg.jpg") dxSetShaderValue(shader,"Tex0",normal) engineApplyShaderToWorldTexture(shader,"kamienie") I want to use the same shader for more than 1 object, which means that i need to give every object it's custom texture. I'm looking for the best way to do it.
-
Ren_712: Yeah, i use it already, the problem is that i use this kind of maps: https://imgur.com/4YNmVv0 so every object needs different texture, and the shader is able to use only one unique texture.
-
Hello everyone, I've implemented a improvised bump map shader, that uses a normal map texture of an object. The thing is that every object needs to have custom texture, so 1 texture for 1 object, as for now i know only how to use it for single object. I can't just use engineApplyShaderToWorldTexture(shader,"*"), because it applies the same texture to every object. How can i make it use different textures for different objects? Here's current example showing the difference that the shader makes(open in 2 tabs and compare them): http://i.imgur.com/BWYPR5Y.jpg http://i.imgur.com/t7Yvsmr.jpg
-
Hello everyone, I'm looking for a way to use custom normal maps on my objects. I'm not talking about the GTA auto generated normal textures, but ones that are made specifically for certain object. I tried modifying some road shine shaders because they are using the auto generated ones, but my lack of knowledge about linear algebra and matrix properties is a bit of a problem. Thanks in advance for any help!
-
Thanks for all help, i managed to find out what was wrong with my script. When I didn't use a timer for 2nd part it was just faster than first timer. When i put 2nd part into timer i set it to wrong time, so a was randomly generated too fast. I just put it with a bit smaller time and it works fine. here's the fixed code, i didn't explain properly at first what i meant, so sorry for that. setTimer( function() a = math.floor(math.random(#arena)) setTimer( function() trans = trans-25 setElementAlpha(arena[a],trans) outputChatBox(a .. " done") end, (GTIME-100)/8,6) setTimer( function() destroyElement(arena[a]) table.remove(arena, a) outputChatBox(a .. " deleted", getRootElement(), 255, 0, 0) trans = 255 end, GTIME-50,1) end, GTIME, #arena-1)
-
Hey, I'm working on some small project of mine, I want to create a function where there is a timer, and some other things. The other things need to start after the timer has finished, how can I do it? Here is sample of my code, a tried to put destroyElement and table.remove in another timer, but that doesn't work for me either. setTimer( function() a = math.floor(math.random(#arena)) setTimer( function() trans = trans-25 setElementAlpha(arena[a],trans) outputChatBox(a .. " done") end, (GTIME-100)/8,6) destroyElement(arena[a]) table.remove(arena, a) outputChatBox(a .. " deleted", getRootElement(), 255, 0, 0) trans = 255 end, GTIME, #arena-1) Thanks in advance for any help.
-
Well, after my testing, when i replaced collision, it falls under the map after touching...
-
Hey, i created a barrel model, and wanted to make it pushable, like to original in game ones, i tried to just replace the current ones with my model and collision, but when testing it only falls down under the map. Is there a way to apply physics to object?
-
Thank you very much =)
-
Hey, I'm making some custom objects, and while testing it in game, it is too dark, the textures in .txd files are much lighter, what can I do? Here's screenshot: http://i.imgur.com/3LoY27R.jpg
-
Holy shit, i almost understood something.
-
Well, is there a way to change models on the fly? or make animated model with changing collision? thanks for help =)
-
Thank you, it's working, i'm wondering if there is a possibility to have scaled collisions too, or is that impossible?
-
It doesn't work, that's my current testing script: function mapLoad ( ) objekt = { createObject ( 3458, 2500, -1645, 50, 0, 0, 0 ), createObject ( 3458, 2500, -1675, 50, 0, 0, 0 ), createObject ( 3458, 2480, -1660, 50, 0, 0, 90 ), createObject ( 3458, 2520, -1660, 50, 0, 0, 90 ) } for i=1, #objekt do SetObjectScale(objekt[i],1.5) end end addEventHandler ( "onResourceStart", getRootElement(), mapLoad ) it spawn normal sized objects, what am i doing wrong?
