Jump to content
Sign in to follow this  
shinkicker

Swao Vehicles in Game

Recommended Posts

Hello All,

I am trying to acheive the following.

I have two models - 'model1' and 'model2'

Both are very similiar, apart from the second has new additions (for example a mounted gun or amour reinforcements).

I am trying to work out how to change from 'model1' to 'model2' while in game through the context menu (think BatMobile). I can work out the addactions etc, but its the swapping models that I am not sure of.

I have seen people do this with units, for example putting on a sniper suit, but is there anyway to do this for a vehicle?

I don't mind titleText black out if it makes things easier. The most important thing is that the vehicle is in the same exact position.

I can also script some checks to make sure there are no players in cargo etc as well. I expect I will also need to find a way of copying the cargo from model1 to model2?

EDIT: Dam! Subject typo fail!

Share this post


Link to post
Share on other sites

AFAIK you cannot simply change the model. I guess hat those ghillie scripts do is they create a new dude, get the exact position and direction of the old one, move the old one out, put the new in the relevant position and direction, swap the player into the new dude and delete the old one. Anyway, that's how I would do it.

With a vehicle, that might be a tad more difficult, since you have to deal with the whole crew. You can get it with the crew command, and then process them in that order. All in all, it depends how many seats/turrets you have. If it's just one or two seats, it shouldn't be too hard. Move the current vehicle to [0,0,0]; (make sure to have it's exact position and direction retrieved before that); create the second one there; move the crew of the first one in the second one. The black out would probably be necessary. Then you delete the old one. Maybe you want to look at transmitting the current state of the vehicle (getdammage, setdammage is an easy but far from perfect way. An HandleDamage with an array to stock the current damage for each part would be awesome), the fuel (fuel, setfuel), the cargo, and all of it, actually.

Share this post


Link to post
Share on other sites
AFAIK you cannot simply change the model. I guess hat those ghillie scripts do is they create a new dude, get the exact position and direction of the old one, move the old one out, put the new in the relevant position and direction, swap the player into the new dude and delete the old one. Anyway, that's how I would do it.

With a vehicle, that might be a tad more difficult, since you have to deal with the whole crew. You can get it with the crew command, and then process them in that order. All in all, it depends how many seats/turrets you have. If it's just one or two seats, it shouldn't be too hard. Move the current vehicle to [0,0,0]; (make sure to have it's exact position and direction retrieved before that); create the second one there; move the crew of the first one in the second one. The black out would probably be necessary. Then you delete the old one. Maybe you want to look at transmitting the current state of the vehicle (getdammage, setdammage is an easy but far from perfect way. An HandleDamage with an array to stock the current damage for each part would be awesome), the fuel (fuel, setfuel), the cargo, and all of it, actually.

Actually I have no problem insisting that players all leave the vehicle first. Its just the model changing part.

Also your post also made me realise I am going to need to carry over damage and fuel too :eek:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×