Jump to content

Problem with custom object's collision


MatthewB

Recommended Posts

Hello everyone,

i have created a new object in Z-modeler and col editor (it's flat terrain). I added it to my server and it works well but there is a little problem. I set the Material to 'Long wet grass' - but when i am driving a vehicle on my custom object, my vehicle is destroying (doors, bumper etc.) and i can see sparks out of my vehicle. After 60 secs of driving my vehicle is exploding. So:

I set the Material to GRASS, but my vehicle thinks its a road or something - how to remove the sparks and cancel vehicle destroying?

PS It happens only when i use createObject. When i replace original GTA SA Objects - it works well and my vehicle is not destroying

i hope you guys will help me

thank you.

Link to comment

Well i did something like that but it doesnt solved the problem.. i can still see sparks

function kolizjeKolizje(collider,force, bodyPart, x, y, z, nx, ny, nz, hf, model) 
if (collider ) then 
if ( getElementModel(collider) == 13156 ) then 
local hp = getElementHealth(source) 
local panel0 = getVehiclePanelState(source,0) 
local panel1 = getVehiclePanelState(source,1) 
local panel2 = getVehiclePanelState(source,2) 
local panel3 = getVehiclePanelState(source,3) 
local panel4 = getVehiclePanelState(source,4) 
local panel5 = getVehiclePanelState(source,5) 
local panel6 = getVehiclePanelState(source,6) 
  
setTimer ( setVehiclePanelState,50, 1, source,0,panel0) 
setTimer ( setVehiclePanelState,50, 1, source,1,panel1) 
setTimer ( setVehiclePanelState,50, 1,source,2,panel2) 
setTimer ( setVehiclePanelState,50,1,source,3,panel3) 
setTimer ( setVehiclePanelState,50,1,source,4,panel4) 
setTimer ( setVehiclePanelState,50,1,source,5,panel5) 
setTimer ( setVehiclePanelState,50,1,source,6,panel6) 
setTimer ( setElementHealth,50,1,source,hp) 
  
end 
end 
end 
addEventHandler("onClientVehicleCollision",getRootElement(), kolizjeKolizje) 
  
  

Link to comment

It's probably your col file that fails because Material of the col mesh has no impact on where collision occurs. It only sets properties of the collision mesh, eg. if it's grass and it's raining you'll be sliding on it, if it's wood and you shoot it you see brown particles fly off.

You may have to re-export the .col files from CollEditor or maybe your script doesn't replace the collision for custom model and it uses the original col of the model you're replacing.

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