Jump to content
major-stiffy

Possible to make a respawned vehicle an arsenal?

Recommended Posts

I'm making a mission for 2 people (MP) and using the vehicle respawn module.

1) the players original vehicle is an arsenal.

2) if the players vehicle is destroyed I want the new spawned vehicle to be arsenal also.

 

Very noobish at scripting and have messed with this for hours. Can someone show me how to do this?

 

I know this works but not how to implement it.

["AmmoboxInit",[this,true]] remoteExecCall ["BIS_fnc_arsenal"];

Appreciate any help.

Share this post


Link to post
Share on other sites
7 hours ago, major-stiffy said:

I know this works but not how to implement it.


["AmmoboxInit",[this,true]] remoteExecCall ["BIS_fnc_arsenal"];

Appreciate any help.

No need to remoteExec anything the arsenal function takes care of all that for you.

Quote

"AmmoboxInit" - adds a virtual ammobox. Action to access the Arsenal will be added automatically to all clients

 

As for the vehicle respawn module, just use the expression property on the module.

params[ "_newVehicle", "_oldVehicle" ];

_newVehicle setVariable[  "bis_fnc_arsenal_action", nil ];
[ "AmmoboxInit", [ _newVehicle, true ] ] call BIS_fnc_arsenal;

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, Larrow said:

just use the expression property on the module.

 

No matter how I destroy the vehicle (and I have taken rating into account when destroying directly), the arsenal only appears on the first respawned vehicle. If I destroy it more than once, the arsenal is not applied. 

  • Like 2

Share this post


Link to post
Share on other sites

Updated previous post with a fix to module expression code.

 

Module respawn function copies all the vehicle's variables to the new one. So when it tries to add a new arsenal to the vehicle it thinks it already has one.

bis_fnc_arsenal_action is not nil.

  • Like 2

Share this post


Link to post
Share on other sites
5 hours ago, Larrow said:

As for the vehicle respawn module, just use the expression property on the module.

 

Thanks Larrow, I'll give it a go!

 

2 hours ago, Harzach said:

If I destroy it more than once, the arsenal is not applied. 

 

That stinks.

Any thoughts on adding an arsenal on the vehicle using cursorObject and addAction? Or some other means with addAction if arsenal is not applied?

 

Edit: I see Larrow amended his post will try it out tomorrow. Thanks!

Share this post


Link to post
Share on other sites

I made a module for that . See documentation link about "respawn vehicles" module. (this module can add also all addactions available on the vehicle, no matter how/when they were scripted).

Share this post


Link to post
Share on other sites

Going to grab that module addon and check them out. Looks very convenient. The documentation answered one question I had.

Quote

As any other modules (and logics or objects) placed in editor (3den), server and clients must have them, so the addon.

 

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

Also for anyone interested, Larrow script worked. Thanks!

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

×