• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Display Text - Trigger once per player

Status
Not open for further replies.
Level 1
Joined
Feb 24, 2020
Messages
4
Hi Hive,

I am trying to setup a trigger for displaying a text message when entering zones or walking up to quest givers etc.

I want it to trigger once per player, currently it triggers for the first person to trigger it and then wont work anymore.

If someone can point me in the right direction that would be amazing.

I have attached a screenshot of the trigger, its using a Boolean Array of 1 and set to False default.

Thanks


View media item 129044
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • _tst[(Player number of (Owner of (Triggering unit)))] Equal to False
    • Actions
      • Set VariableSet _tst[(Player number of (Owner of (Triggering unit)))] = True
      • Game - Display to (All players) the text: test
where tst is your boolean array variable
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
I want it to trigger once per player, currently it triggers for the first person to trigger it and then wont work anymore.
What do you mean by person, is it the unit or the player?
I'm confused, your script may work once per player that owns the entering unit and nothing more...
which you're trying to point out on the underlying condition.
If this doesn't work, debug the player number instead of displaying that 'test' and another for displaying the boolean value.
If it doesn't show then transfer the condition inside the actions using if else block and put the debug messages above of it.
Finally, test entering each unit with different players.
If the debug message doesn't show the values this time then we have the problem...
Probably, it's the region.

Or If you're referring to that region to be activated again on some point by the player
Use timers or local with waits to make the condition true again.
(Waits are inaccurate on some cases although they're not that harmful in this kind of script)
You may use shadowing variables if the event response TriggeringUnit() doesn't work in this type of event with waits.
For accuracy and efficiency, a countdown or periodic timer will do but takes long way.

If you're just making it multi unit instance then do use of their handleIds.
 
Level 1
Joined
Feb 24, 2020
Messages
4
Thanks for the reply's guys, really appreciate it. I was going to make it a global chat and give up.

I got it to work as intended with what A]mun posted.

[(Player number of (Owner of (Triggering unit)))] instead of [(Player number of (Triggering player)))].

I also removed the conditions defining each player.

Thanks!!


Edit

I was trying to make it trigger only once per player, its a single unit 8 player RPG and I didnt want all NPC dialog to be global.
 
Status
Not open for further replies.
Top