Jump to content

Make Collision Radius Bigger?


Recommended Posts

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) 
    setCameraPosition(x-3, y-3, z+3) 
    if getGroundPosition(x, y, z) ~= 0 then 
        setTimer(alignToGround, 200, 1) 

if i change that to this:

    g_Vehicle = vehicle 
    local x, y, z = getElementPosition(g_Vehicle) 
    setCameraPosition(x-3, y-3, z+3) 

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
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?


i tried this:

timerID = setTimer( g_root, 1000, 0, 
  setElementCollisionsEnabled ( theCar, false ) 

and nothing happend.

Link to comment

timerID = setTimer( g_root, 1000, 0, funcCar ) 
function funcCar( player ) 
local theCar = getPlayerOccupiedVehicle ( player ) 
setElementCollisionsEnabled ( theCar, false ) 

local g_Vehicle = getPlayerOccupiedVehicle ( player ) 
local x, y, z = getElementPosition (g_Vehicle) 
toggleCameraFixedMode (true) 
setCameraPosition ( x-3, y-3, z+3 ) 
toggleCameraFixedMode ( false ) 

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

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

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

hm... sorry for my bad english but first it's not my native language :S 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) 
function disableCollision () 
    outputChatBox ("test2") 
    timer = setTimer (disableCollision2, 1000, 0) 
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.


Note: This function has unwanted effects on vehicles with drivers at the moment.
I think we have to wait for dp3 -.-
Link to comment

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 :D

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...