Jump to content

Recommended Posts

You can do this kind of thing apart. Be sure any attached object will flicker more or less during the fall. try something like:

player addAction ["chemLight",{
_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;
{  _lgt = "Chemlight_Blue" createVehicle [0,0,0];
   _lgt attachTo [_x, [0,-0.03,0.07], "LeftShoulder"];
 } forEach (units _caller select {local _caller});
 },nil, 5,false, true,"","(getPosATL _this) select 2 > 80"];

 

  • Like 1

Share this post


Link to post
Share on other sites

sure! The local condition (done) is OK for that.. As players are on different PCs, they will now just order for the local AIs (in player's group).

Share this post


Link to post
Share on other sites
On ‎1‎/‎29‎/‎2018 at 5:31 PM, pierremgi said:

You can do this kind of thing apart. Be sure any attached object will flicker more or less during the fall. try something like:

player addAction ["chemLight",{
_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_lgt = "Chemlight_Blue" createVehicle [0,0,0];
    _lgt attachTo [_x, [0,-0.03,0.07], "LeftShoulder"];
 } forEach (units _caller select {local _caller});
 },nil, 5,false, true,"","(getPosATL _this) select 2 > 80"];

 

I am getting an error defined variable _caller on line 7.

 

Thanks

Share this post


Link to post
Share on other sites

Disabled the weird possibility to switch backpack / parachute during the jump. Caused too much accident pressing the enter key.

Share this post


Link to post
Share on other sites

Hey @pierremgi, I hate to be a pain but when I test this script using the standard 0 = [this,1000,90,true] execVM "MGI_HALO.sqf" on a pole init in a local hosted mission all works well but as soon as I use on a dedicated server I get no "Halo Jump" option on the pole, am I doing something wrong?

Share this post


Link to post
Share on other sites

No idea so far. Check the code is present in init field of your pole and the sqf in mission folder root. If you placed it elsewhere, you need to mention the path. If it's OK, then a battleEye compatibility with added action or a mod like ACE?? I don't know.

Share this post


Link to post
Share on other sites

Hello, if possible could you explain to me what would need to be done to prevent players from using this Halo whenever they want. After a particular player uses the Halo I would like them to have to wait 15 minutes before they could use it again. I would also like a hint that lets a particular player know how long they have to wait to use it again. If you could explain in detail or post some code that would be awesome.

 

Edit:

 

I found this while looking through the forums (I modified the hint)

 

 if (diag_tickTime < (uiNamespace getVariable ['tag_cooldown',-1])) exitWith {
			hint (format ['HQ: \n Next jump available in %1 seconds.',(round ((uiNamespace getVariable ['tag_cooldown',-1]) - diag_tickTime))]);
		};
		_cooldown = 900; 	// cooldown duration in seconds
		uiNamespace setVariable ['tag_cooldown',(diag_tickTime + _cooldown)];

and inserted it into the add action in the MGI Halo.sqf like so...

 

_pole addAction ["<t color='#00ffff'>HALO jump</t>",{
  params ["_target","_caller","_id","_parameters"];
  if (diag_tickTime < (uiNamespace getVariable ['tag_cooldown',-1])) exitWith {
			hint (format ['HQ: \n Next jump available in %1 seconds.',(round ((uiNamespace getVariable ['tag_cooldown',-1]) - diag_tickTime))]);
		};
		_cooldown = 900; 	// cooldown duration in seconds
		uiNamespace setVariable ['tag_cooldown',(diag_tickTime + _cooldown)];
  openmap [true,false];
  hint "Pilot: \n Select location for LZ";
  _parameters params ["_jump_alt","_jump_safety"];

It seems to work as intended with just me sampling the MP mission in the editor that I'm creating, but I have no idea if the timer will prevent everyone from using the Halo until the time runs out or if it will only affect the player that used the Halo. I'm very new to scripting, but I'm trying to learn as much as I can and don't really have anyone to help me test the functionality right now.

 

 

 

Share this post


Link to post
Share on other sites

The inner code of addAction applies to the caller only (and his Ais here but that doesn't matter).

So you can try something like:

if (isNil {_caller getVariable "jumpTimer"}) then {
  _caller setVariable ["jumpTimer",900];
  _caller spawn {
    _timer = _this getVariable "jumpTimer";
    _go = diag_tickTime;
     waitUntil {uiSleep 1; hintSilent format ["HQ: \n Next jump available in %1 seconds.",_go +_timer - diag_tickTime]; diag_tickTime > _go + _timer -1};
     hintSilent "";
     _this setVariable ["jumpTimer",nil];
  }; // end spawn
  <code>
};   // end if here

 

Not tested

Cooldown will be included in the module version of this script.

Share this post


Link to post
Share on other sites
15 hours ago, pierremgi said:

The inner code of addAction applies to the caller only (and his Ais here but that doesn't matter).

So you can try something like:


if (isNil {_caller getVariable "jumpTimer"}) then {
  _caller setVariable ["jumpTimer",900];
  _caller spawn {
    _timer = _this getVariable "jumpTimer";
    _go = diag_tickTime;
     waitUntil {uiSleep 1; hintSilent format ["HQ: \n Next jump available in %1 seconds.",_go +_timer - diag_tickTime]; diag_tickTime > _go + _timer -1};
     hintSilent "";
     _this setVariable ["jumpTimer",nil];
  }; // end spawn
  <code>
};   // end if here

 

Not tested

Cooldown will be included in the module version of this script.

Sweet a module version is coming...Love it @pierremgi

Share this post


Link to post
Share on other sites

Hello

I am looking for a jump script that will apply to only a certain player class.  And the addaction would be applied to the player themselves.  The idea is the class paratrooper will be able to jump to another location once his timer is up and not be dependent on a item like a pole after each area is cleared.  Only dependent on timer and classname. Also this seems like a work around to white listing class names.

 

So for this code.

 

 0 = [this,1000,90,true] execVM "MGI_HALO.sqf"

 

Would 0 be changed to this?

Share this post


Link to post
Share on other sites

0 is just a handle needed by the init code of an object/unit. That doesn't do anything interesting for your problem.

 

You can try a code in init.sqf:

{

  [_x,1000,90,true] execVM "MGI_HALO.sqf";

} forEach ((switchableUnits + playableUnits) select {_x isKindOf "B_soldier_PG_F"});

 

in the MGI_HALO.sqf, there are 2 addActions

find the 2 lines:

[_jump_alt,_jump_safety], 5,false, true,"","vehicle _this == _this"]

(one of them is the last one)

Replace by:

[_jump_alt,_jump_safety], 5,false, true,"","vehicle _this == _target && isNil {_this getVariable 'jumpTimer'} "]

Should work.

 

You can also modify the code for enabling only paratrooper AIs in group. So the part of code adding a parachute becomes useless... As all the stuff for placing a current backpack on ventral. I don't want to rework this script in this way.

At this time,  just add a filter for your purpose. Replace:

} forEach _MGI_units;

by

} forEach (_MGI_units select {_x isKindOf "B_soldier_PG_F"}) ;

 

 

  • 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

×