DazzaJay Posted February 7, 2008 Share Posted February 7, 2008 Really Dumb question. colshape = createColTube(pos[1]-1, pos[2]-1, pos[3]-8, 2, 16) That peice of code is from the race gametype. its part of the Pickups. am i right in guessing that this.... colshape = createColTube(pos[1]-1, pos[2]-1, pos[3]-8, 6, 16) will Tripple the pickup's radius? (i ask instead of testing because 1, there are people in my server. 2, the wiki was showing the code to be different to what is in the race gametype) ---------------------------------------- Also, this section of code: g_Vehicle = vehicle local x, y, z = getElementPosition(g_Vehicle) toggleCameraFixedMode(true) setCameraPosition(x-3, y-3, z+3) toggleCameraFixedMode(false) if getGroundPosition(x, y, z) ~= 0 then setTimer(alignToGround, 200, 1) end if i change that to this: g_Vehicle = vehicle local x, y, z = getElementPosition(g_Vehicle) toggleCameraFixedMode(true) setCameraPosition(x-3, y-3, z+3) toggleCameraFixedMode(false) end Will that stop the game mode from screwing up all the Starting spawn points at the start of a race? (such as Go Fast FTW, where the spawns are well above ground, on a road panel, but the spawns keep warping down to the ground level at the start.) -------------------------------------- and one more thing, i cant find where the option id need to change (or what im even looking for) to make it so Cars dont have collision with other cars. (to make the race server more high-ping friendly) Link to comment
Mr.Hankey Posted February 7, 2008 Share Posted February 7, 2008 just add a function that is called when someone spawnes or so get the vehicle element and do: setElementCollisionsEnabled ( theCar, false ) but remember this is a client-only function here's the link to the wiki http://development.mtasa.com/index.php?title=SetElementCollisionsEnabled Link to comment
DazzaJay Posted February 7, 2008 Author Share Posted February 7, 2008 when someone spawnes or so get the vehicle element and do: Is that even English? also, what am i looking for? do i just add it to a timer that checks every second on repeat or what? :::EDIT:::: i tried this: timerID = setTimer( g_root, 1000, 0, function() setElementCollisionsEnabled ( theCar, false ) end ) and nothing happend. Link to comment
eAi Posted February 7, 2008 Share Posted February 7, 2008 Any errors in the script debug console? Does it know what theCar is? Shouldn't you be doing it on every other vehicle (except the local one)? Be aware this will likely produce worse sync. Link to comment
DazzaJay Posted February 8, 2008 Author Share Posted February 8, 2008 No errors. i dont even know what theCar is. i thaught i was. i know but with No-Collision it will be a "fair" race instead of a Smash fest. Link to comment
eAi Posted February 8, 2008 Share Posted February 8, 2008 You have got 'debugscript 3' enabled right? Link to comment
DazzaJay Posted February 8, 2008 Author Share Posted February 8, 2008 You have got 'debugscript 3' enabled right? does that come with the server? cos ive never enen heard of it. Link to comment
mabako Posted February 8, 2008 Share Posted February 8, 2008 Theres an option for that in the mtaserver.conf and you can type /debugscript 3 on client-side as well (if you're admin) Link to comment
Woovie Posted February 8, 2008 Share Posted February 8, 2008 timerID = setTimer( g_root, 1000, 0, funcCar ) function funcCar( player ) local theCar = getPlayerOccupiedVehicle ( player ) setElementCollisionsEnabled ( theCar, false ) end local g_Vehicle = getPlayerOccupiedVehicle ( player ) local x, y, z = getElementPosition (g_Vehicle) toggleCameraFixedMode (true) setCameraPosition ( x-3, y-3, z+3 ) toggleCameraFixedMode ( false ) end As for your coltube, createColTube ( float fX, float fY, float fZ, float fRadius, float fHeight) fX: The position of the base of the tube's center on the X axis fY: The position of the base of the tube's center on the Y axis fZ: The position of the base of the tube's center on the Z axis fRadius: The collision tube's radius fHeight: The collision tube's height Link to comment
DazzaJay Posted February 8, 2008 Author Share Posted February 8, 2008 from what i have seen in these files, i need an ..... event handler or some shit. ive tried adding one to these bits of code, but all ive managed to do is stop the race recource from loading all together...... well... less loading, more server crash's on load..... so ive reinstalled a fresh copy of my test server and i am also giving up hope of ever understanding this horrid code. Link to comment
Woovie Posted February 8, 2008 Share Posted February 8, 2008 Wow. What are you trying to do ? I will try to code it for you. I just looked at your code and saw what was wrong. Link to comment
DazzaJay Posted February 8, 2008 Author Share Posted February 8, 2008 my bad man, i wasnt going off at you or anything. mainly just the LUA language. heres the thing, i can picture in my head at this verry second, Exactly how what i am trying to do would look in mIRC script code. but this LUA shit is fucking ridiculous. With mirc, i asked a few small questions, and picked up the rest pretty quickly. Hell, i have even written an entire emotes script, (which only got from A to D in the emotes i was going to put in) which was allready over 150 emotes. but this lua shit, is ridiculous, i cant learn it by looking at it, as each time i look at it, or try to figure out somthing as simple as a Fucking Timer, it just confuses me even more. Link to comment
Mr.Hankey Posted February 8, 2008 Share Posted February 8, 2008 hm... sorry for my bad english but first it's not my native language and second i just wanted to make a quick reply =) I just tested something that seems to disable the collision of the car you are in but i think you shouldnt use this because i got a really weird bug where i floated to the sky like the gravity was to -0.003 Here's what i got so far: function disableCollision2 () outputChatBox ("test") local vehicle = getPlayerOccupiedVehicle (getLocalPlayer()) if (vehicle) then setElementCollisionsEnabled (vehicle, false) killTimer (timer) end end function disableCollision () outputChatBox ("test2") timer = setTimer (disableCollision2, 1000, 0) end addEventHandler ("onClientPlayerSpawn", getLocalPlayer (), disableCollision ) This bug appaers everytime i set the Collision of the vehicle you are in to false and i also tested it with the /crun command of the runcode resource and everytime it's the same. Edit: Note: This function has unwanted effects on vehicles with drivers at the moment.I think we have to wait for dp3 -.- Link to comment
DazzaJay Posted February 8, 2008 Author Share Posted February 8, 2008 well, often in race gamemode at the moment, it randomly starts races with no vehicle collision, and there is no floating in it. i think it has somthing to do with the Ghostmode code thats in the gametype Link to comment
eAi Posted February 8, 2008 Share Posted February 8, 2008 Type 'debugscript 3' in the console. You'll see scripting errors on screen then. Link to comment
Mr.Hankey Posted February 15, 2008 Share Posted February 15, 2008 oh i found out how the ghostmode works^^ I just found the function in the race mode and suddenly it seemed to be so obvious how it works =) You just set the collision of all vehicles except yours to false but because it's a client function it wont be synced so on the pc of another player all other cars dont have a collision. That's why it works so well in the race mode Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now