• 🏆 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!

[General] How to make trigger clear message like so

Status
Not open for further replies.
Level 4
Joined
Dec 16, 2013
Messages
84
sorry for my english

how to make trigger like this

Show message: Please pick a hero
Clear "please pick a hero" message to the player who is done picked a hero.

so the "Please pick a hero" message will be still shown to the player who has not pick their hero.

here is my trigger, im so confused haha
  • Buy Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Tavern 0001 <gen>
    • Actions
      • Unit - Move (Sold unit) instantly to (Random point in Map <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Sold unit)) Equal to (Owner of (Sold unit))
        • Then - Actions
          • Camera - Pan camera for (Owner of (Sold unit)) to (Position of (Sold unit)) over 0.00 seconds
          • Selection - Select (Sold unit) for (Owner of (Sold unit))
          • Camera - Set the camera bounds for (Owner of (Sold unit)) to camera <gen>
        • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Equal to (Owner of (Sold unit))
            • Then - Actions
              • Cinematic - Clear the screen of text messages for (All players matching ((Picked player) Equal to (Owner of (Sold unit))))
              • Cinematic - Clear the screen of text messages for (All players matching ((Picked player) Equal to (Owner of (Sold unit))))
            • Else - Actions
 
Level 6
Joined
May 20, 2014
Messages
228
For the first part, you don't even have to use loop, you can just consolidate this even further:

  • Buy Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Selling unit) Equal to Tavern 0001 <gen>
    • Actions
      • Unit - Move (Sold unit) instantly to (Random point in Map <gen>)
      • Camera - Pan camera for (Owner of (Sold unit)) to (Position of (Sold unit)) over 0.00 seconds
      • Selection - Select (Sold unit) for (Owner of (Sold unit))
      • Camera - Set the camera bounds for (Owner of (Sold unit)) to camera <gen>
Since the condition in the loop is literally 1=1... and is unnecessary.

As for clearing messages.... let me figure out something.

edit: Maybe this will work?

  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Sold unit)) Equal to (Picked player)
        • Then - Actions
          • Cinematic - Clear the screen of text messages for (Player group((Picked player)))
        • Else - Actions
I don't really know if it would work by explicitly converting a player into a player group and then allowing it do that way. I'm not even sure if it would cause leaks as well... so someone else will have to reply to that.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Picked player) Equal to (Owner of (Sold unit))
        • Then - Actions
          • Cinematic - Clear the screen of text messages for (All players matching ((Picked player) Equal to (Owner of (Sold unit))))
          • Cinematic - Clear the screen of text messages for (All players matching ((Picked player) Equal to (Owner of (Sold unit))))
        • Else - Actions

>>

  • Cinematic - Clear the screen of text messages for Owner of (Sold unit)
not sure if it will fix it but..
 
Level 6
Joined
May 20, 2014
Messages
228
> not sure if it will fix it but..

The problem is that the action is only linked to player groups so you can't really make that happen.
 
Level 6
Joined
May 20, 2014
Messages
228
> If that's the case my solution will work, no? or I am getting the wrong idea?

I meant that there isn't an option to set it to how you did in your post on WE. The only ones are on this image.

That's why I thought what I said will work but I'm not sure as I haven't tested it.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
I see. I was too lazy to open the editor so that's why. The correct one would be this:

  • Cinematic - Clear the screen of text messages for (Player group((Owner of (Sold unit))))
plan B for me would be the following:
  • Actions
    • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetSoldUnit()) then
    • Custom script: call ClearTextMessages()
    • Custom script: endif
 
Status
Not open for further replies.
Top