Jump to content
RealLocutus

Trigger: Displaying message for player

Recommended Posts

I have been searching for a while now but did not really find anything helpfull. 

 

What do I want?

I want to make a trigger that can be activated by any player. But the text that is shown by this trigger should only be visible for the player who just activated this trigger.

How can I do that? Its for a MP Mission on a dedicated server.

 

Thanks.

Share this post


Link to post
Share on other sites

Make local trigger with this activation:

player inArea thisTrigger

 

Share this post


Link to post
Share on other sites

Yep. Local triggers are made for that but they are scripted only. See createTrigger, with makeGlobal set to false as option.

 

As workaround, you can use an edited trigger (NOT server only) but it's a little bit trickier because the trigger is activated for everyone. If you need an activation for each player, you can set  a trigger like this:

trigger : none none  (no preset condition, as you want a local one)

repeatable (mandatory for firing on each player, and furthermore each time the player enters area).

NOT server only (must fire on each PC)

 

Condition: isNil "trigRearm" && player inArea thisTrigger

check if a variable trigRearm (on each PC) is not defined, (so not, by default)  and if the local player is in area of the trigger

 

on activation: if (player inArea thisTrigger) then {hint "you  enter in area"} else {trigRearm = TRUE};

the hint will be displayed only where the local player is in area. Yes , you need to recheck that, for filtering the locality.

and the trigger is deactivated by the existing variable trigRearm (set to what you want) for all other players (so the trigger will be fired again by everyone else, once condition are met again)

 

on deactivation: [] spawn {sleep 1; trigRearm = nil};

When the player leaves the area OR when the variable trigRearm is set (true here), the trigger is deactivated. After one second, trigRearm set to nil make it rearmed and you can fire it again if the local player enters the area.

 

Do not publicVariable trigRearm. Let it global (global variable) but not broadcast. So it stays on PC locally.

  • Like 1

Share this post


Link to post
Share on other sites

Too complicated, @pierremgi. These settings should be enough:

  • Activation:
    • Type: none
    • Activation: none
    • Repeatable: checked
    • Server only: unchecked
  • Condition:
player inArea thisTrigger
  • On activation:
hint "You've entered!";
  • On deactivation:
hint "You've left!";

 

  • Like 2

Share this post


Link to post
Share on other sites

All of you - thanks for your help. :) It works now as intended.

Share this post


Link to post
Share on other sites
20 hours ago, Schatten said:

Too complicated, @pierremgi.

 

 

You're right. It seems a local condition (by player) seems to trigger locally... and the global effect by default is not so global in this case. Truly BIKI createTrigger is not so clear about that (or I'm too old for that). 😔

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

×