[Question] SideChat through Trigger activated script.

UrbanSkaters

Valued Member!
I've got a script that is executed whenever a player enters a trigger. The script simply reads:

player sideChat "I'm entering the trading zone!";

For some reason this does not display a message in the SideChat. I've tried several other methods found during my searches and non of them work. Does anyone know the correct way to do this?

Thanks
 
Triggers are global when defined, but the actions they perform are local to the machine they are created on.

So if you create a trigger on the server, only the server runs the onActivated scripts - and there is no player object on the server :)

try a diag_log and you will see where it outputs, client rpt or server rpt.
 
it's definatly running locally, because I've tried diag_log and even if(!isServer) exitWith {} and it either exits with nothing (as expected if running locally) and saves nothing to the server log. I've pretty managed to figure out the Arma scripting language but this one area is stumping me, I can't get my head around the logic ! lol . All I want is a message to broadcast to all users, why can't this be like the good old "BASIC" days ;)
 
Sarge.. On the subject of diag_log , do you have any idea how i can force my script to save it server side..

diag_log format ["SAFEBASE: %1 entered the safe base",player];

Isn't saving to the server rpt and I've no idea how to achieve this via the script that is being activated by the trigger.
 
It is being saved in the client rpt ? did you check that ?

Triggers are a bit "tricky" .-)

Did you set the trigger to repeatable ? Did you set it so it reacts on players only ?

Let me see your script (trigger creation including conditions, the onactivate /deactivate one) and and i will see what i can do.

Where do you create the trigger? client or server ?
 
Much appreciated. To answer your questions:

Trigger set to repeatable , yes. Trigger set to react on players only, yes. Where do I create the trigger? in the mission file. The trigger is run on the client machine, I don't know how to create server side triggers yet :(

My trigger as requested:

Code:
class Item0
        {
            position[]={13637.799,40.052261,3023.6873};
            a=650;
            b=500;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="AdminBase";
            expCond="(vehicle player) in thislist && {((getPosATL player) select 2) < 20};";
            expActiv="adminbase = [] execVM ""Scripts\adminbase.sqf"";";
            expDesactiv="terminate adminbase; titleText [""You have left the Admin Base!"", ""PLAIN DOWN"", 3];";
            class Effects
            {
            };
        };

The adminbase.sqf script simply reads:

player sideChat "I'm in the admin base";
sleep 0.1;
diag_log format ["SAFEBASE: %1 entered the admin base",player];
 
you are aware that this trigger will only fire once when the first player joins the area ? After that the trigger is active as long as this player is in there, regardless how many more players join.
 
Nope, I assumed that was only the case if I set the repeating to 0 , which according to the in-game editor is activate once ? Both myself and other players are getting the message even when more than one person is in the trigger?
 
that only ends the serverside script. Mind to explain what you expect it to do ?
 
I've tried this in the trigger condition:

isServer && (vehicle player) in thislist && {((getPosATL player) select 2) < 20};

Nothing happens.. So I tried the if (isServer) in the action , and then in the script itself, again with no result. I'm starting to wonder if what I'm trying to achieve is even possible...
 
I've tried this in the trigger condition:

isServer && (vehicle player) in thislist && {((getPosATL player) select 2) < 20};

Nothing happens.. So I tried the if (isServer) in the action , and then in the script itself, again with no result. I'm starting to wonder if what I'm trying to achieve is even possible...

This can not work.

This is checking if the trigger was activated on the server, and is then checking if the player object is in the triggerlist.

There is NO player object on the server...
 
Back
Top