Jump to content

Recommended Posts

Posted (edited)

Hi guys, I have a mission that contains a vehicle respawn module. This respawn module is connected to a helicopter with [missionNamespace, this] call BIS_fnc_addRespawnPosition; in its init field. in the module's expression line I have execvm "MobileRespawn.sqf" . 
in mobilerespawn.sqf
 

vehInit =
   {
   clearWeaponCargoGlobal _this select 0;
   clearMagazineCargoGlobal _this select 0;
   [missionNamespace, _this select 0] call BIS_fnc_addRespawnPosition;
   };

This all works dandy when I host locally, however when I run it on a dedicated server it does not appear to run the script, or at least does not apply the script to the respawned vehicle. What am I not getting here?

Edited by Cockheaven
corrected vehicle starting init

Share this post


Link to post
Share on other sites

Update: The current configuration is working for land based vehicles, however it is not working for helicopters.

Share this post


Link to post
Share on other sites

That can't work at all.

Expression line:  _this execVM "MobileRespawn.sqf"

 

sqf:

clearWeaponCargoGlobal (_this select 0);

clearMagazineCargoGlobal (_this select 0);

[missionNamespace, (_this select 0)] call BIS_fnc_addRespawnPosition;

 

You don't need to define a function (vehInit) in this code (or you'll need to pass again the _this parameter).

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

but @pierremgi It is working for the Truck that is connected to the respawn module.....
I will try your suggestion, thanks!

Share this post


Link to post
Share on other sites

I'll be honest to say that I have absolutely no prior experience with dedicated servers, but as long as we are missing something here, or you have somehow delcared _this in the vehicle's init field you should somehow declare it (and pass it to) in the function you create. Otherwise there is no reference to your object inside the function. So I'll stand with pierremgi's post here too.

 

Again, this is if we are NOT missing something here. Maybe if you post the whole init field things could get clearer.

Share this post


Link to post
Share on other sites

_this must be placed in the expression line of the module. The hint says: _this refers to [<new vehicle>,<old vehicle>]. So you pass this array (the reason why you can reach the new vehicle by (_this select 0).

 

Now, if you don't want to bother yourself with codes, some modules can respawn whatever on your vehicle(s).

  • Like 1

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

×