Jump to content
Sign in to follow this  
alleycat

Locality problem with custom halo script

Recommended Posts

I created a HALO script that works like this:

Player moves up to flagpole, performs an action, gets teleported and halodropped. When I ordered an AI to perform the action the teleportation worked, however how to make other things like hints and screen effects local to only the unit that performed it?

_obj = _this select 0;

_caller = _this select 1;

_id = _this select 2;

_caller setpos (getMarkerPos "mrk_halo" );

cutText ["", "BLACK OUT",0.1];

[_caller, 700] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";

sleep 2;

cutText ["", "BLACK IN",0.5];

sleep 0.5;

//Initiate altimeter loop

while

{

(getPos _caller select 2) > 400} do {hintsilent parseText format["<t color='#FFFFFF' shadow='1' shadowColor='#000000' underline='true'>Altitude<br/></t><t color='#66F4F0' size='1.4'>%1</t>",(getPos _caller select 2)];

sleep 0.1;

};

while

{

(getPos _caller select 2) > 10} do {hintsilent parseText format["<t color='#FFFFFF' shadow='1' shadowColor='#000000' underline='true'>Altitude<br/></t><t color='#66F4F0' size='1.4'>%1</t><br/><t shadow='1' shadowColor='#000000' color='#D5780D' underline='false' size='1'>LOW ALTITUDE</t>",(getPos _caller select 2)];

sleep 0.1;

};

hintsilent "";

---------- Post added at 01:13 AM ---------- Previous post was at 01:04 AM ----------

I think I can get around it by using

If (local _caller)

to execute it on local machines only, however the AI seems still to count as local. How to extend the condition to LOCAL AND AI?

---------- Post added at 01:53 AM ---------- Previous post was at 01:13 AM ----------

Also another problem. I want to run a script on INIT that basically displays some hints to players, depending on their side

In init.sqf:

playableunits execVM "overview.sqf";

overview.sqf

_caller = _this select 0;

If (isPlayer _caller && side _caller == WEST) then {

sleep 1;

hintsilent parseText format["<t color='#FFFFFF'>Move to the flagpole to initiate the HALO drop.</t>];

}

However the script does not appear to have any effect. Also there are no script errors.

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  

×