Jump to content
Sign in to follow this  
sabot10.5mm

vehicle respawn module.

Recommended Posts

i created a single player mission with respawning vehicles and a respawn for the player, but once the player dies he cant enter vehicles anymore... i figured since the Lock option is set to default maybe this is causing the problem? anyway to set the lock status on respawn for a spawned vehicle?

Share this post


Link to post
Share on other sites

im fairly new to scripting, where should i put this? in the vehicle respawn module? specifically the expression field?

Share this post


Link to post
Share on other sites

I guess you're using the module from Modules (F5) -> Multiplayer -> Vehicle Respawn which is connected to your empty vehicle?

 

You'd be correct in using the expression field for that.  It would look like this:

 

MjAuUho.jpg

 

Probably want to turn off the explosion effect, so annoying. :)

Share this post


Link to post
Share on other sites

help me understand.. why doesnt a command like this work. _this allowdamage false; in the expression field

Share this post


Link to post
Share on other sites

If you hover over the words "Expression:" you'll see a little tool tip that explains more about that field.  In this case it tells you that the passed arguments you have access to is an array of:

[<new_vehicle>, <old_vehicle>]

Which means that _this (the input array accessible to the commands in the expression field) contains an array with two elements, both objects, 0 being the new vehicle and 1 being the old.

 

So while you'd use normally this in the init field of an object to refer to the object, in this case within the Expression field you'd need to use _this select 0 (the first element of the arguments array, _this) to refer to the new vehicle:

(_this select 0) allowDamage false;

Since _this select 0  would be the first element of the array and is the object of the newly respawned vehicle.  Just the same as when we used _this select 0 lock 0; above to unlock the newly spawned vehicle.

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  

×