Basic question (Selected units) - Also Wc3 GUI tags

ablationer

New Member
Reaction score
0
Hello, two quick questions here, Firstly, I want to make this basic trigger

triggertest1.png


But it does not work, it changes the stat of any other unit that is selected, not the one the player 9 has selected, how do i fix it?

Also, how does the wc3 GUI triggers tags work exactly? I took a screenshot but i seen the tags thing
 

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Trigger:
  • ______


Just hit the @ thingy and go to your trigger and right click on it, and "Copy as Text" and paste it inbetween the ___'s

Edit Its
Trigger:
  • _____<div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_2">
    • <li class="lasttree"><span class="default">Just hit the button thingy</span></li>
    • </ul>
    • </div></div>
 

ablationer

New Member
Reaction score
0
Trigger:
  • testgivestr
    • Events
      • Player - Player 9 (Gray) types a chat message containing str+ as An exact match
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by Player 9 (Gray)) and do (Hero - Modify Strength of (Picked unit): Add 2)

Oh, I see, cool, so any idea how to make this work?
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
I don't understand your problem... Could you explain better?
 

ablationer

New Member
Reaction score
0
Well, it seems simple enough, i just want that, whenever i have a hero selected and i type something, it increases its stat, thats it
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Oh. Just add this condition where it picks them:
(Matching Unit) is owned by (Player 9)
 

ablationer

New Member
Reaction score
0
But I need it to be for any player, like any hero that the player 9 selects, either it's his or not
 

Ticer

New Member
Reaction score
2
In the action part, replace gray player with triggering player. For the events, you might just have to make an event for each human player, i.e. player red types... player blue types... ect. There might be an easier way to do that part that I don't know about.
 

ablationer

New Member
Reaction score
0
There is no triggering player, but anyway I only need to make it available for player 9, only when he types, and only the unit he has selected, no matter who's controlling it
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
If/Then/Else Put under the condition whether selected unit is a hero, then do wadeva u did after.

Wait my bad, no such trigger.


First u pick all units selected by gray, thn in the loop, u create an if/then/else, thn the if u put a boolean comparison, checking whether picked unit is a hero, then whatever actions u wan. Else do nothing.
 

Faust

You can change this now in User CP.
Reaction score
123
There is no triggering player, but anyway I only need to make it available for player 9, only when he types, and only the unit he has selected, no matter who's controlling it


Then who do you think types the chat string?
 

ablationer

New Member
Reaction score
0
If/Then/Else Put under the condition whether selected unit is a hero, then do wadeva u did after.

Wait my bad, no such trigger.


First u pick all units selected by gray, thn in the loop, u create an if/then/else, thn the if u put a boolean comparison, checking whether picked unit is a hero, then whatever actions u wan. Else do nothing.
And what would this look like in a trigger form?


Then who do you think types the chat string?
But there is no triggering player choice in the action for the unit group
 

crazyfanatic

New Member
Reaction score
20
make it to pick units matching condition selected by player 9 AND matching unit is a hero, or the Hero-class trigger actions wont work ;)
 

Admit

New Member
Reaction score
25
Trigger:
  • Stat
    • Events
      • Player - Player 9 (Gray) types a chat message containing -str+ as A substring
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is selected by (Triggering player)) Equal to True))) and do (Hero - Modify Strength of (Picked unit): Add 2)


Tested it and it works.
 

Baltazhar

Active Member
Reaction score
55
Trigger:
  • Stat
    • Events
      • Player - Player 9 (Gray) types a chat message containing -str+ as A substring
    • Conditions
    • Actions
      • Set Temp_Group = (Units selected by (Triggering player)
      • Unit Group - Pick every unit in (Temp_Group) and do multiple actions:
        • If ((Picked unit) is A Hero Equal to True)
          • Then
            • Hero - Modify Strength of (Picked unit): Add 2
          • Else
      • Custom Script (call DestroyGroup udg_TempGroup)

Hand drawn, so there might be spelling errors and such, but I think it's pretty accurate.
Whenever player 9 types a message, it checks all the units he has selected. If it's a Hero, it gets +2 Str.
Only player 9 can type the message, but he can give the bonus to all other players' heroes.

That sounds like what you had in mind.

EDIT:
Oh just another note, I removed the leaks as well by using Temp_Group and removing it in the end. You will need a Unit Group variable named Temp_Group for this to work.
Not sure how much you are into those things.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Balthazar's one is the right one, the others work too, but they dun fit ur description. Admit's trigger is only for player 9's unit. So is crazy fanatic's. I dun tink i have to psot my trigger right? Balthazar's one is betta.
 

Admit

New Member
Reaction score
25
My trigger does works for every player (just add them to the event), however i forgot that group leaks, other then that mine and Baltazhar triggers are basicly the same.

Edit* ah i saw what you ment now..
 

Baltazhar

Active Member
Reaction score
55
Sky if you have one that's actually made in the editor and not free-hand like mine, I think that could be useful.
I've obviously tried my best, but I have no clue if I got the right terms or not, so imo, post away :)

Easier to follow a trigger if you don't have to start wondering what things should have been :p

EDIT:
Admit what we're after is a trigger that will allow Player 9 (and ONLY player 9), to select units of his/her choice, and then give them additional str. Your trigger allows each player (if you add the players in the event), to give their own units more Str.
Think of it has Player 9 being God, with endless possibilities to modify the rest of the players' units.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Ok since Balthazar said so....
Trigger:
  • Untitled Trigger 001
    • Events
      • Player - Player 9 (Gray) types a chat message containing str+ as An exact match
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by Player 9 (Gray)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Hero - Modify Strength of (Picked unit): Add 2
            • Else - Actions
              • Do nothing

Untested though. It should work.
 

Baltazhar

Active Member
Reaction score
55
Just FYI skyblade, using the "Do Nothing" action is absolutely useless in the editor. If you remove it and leave it empty, it has the same effect and doesn't require those few bits of mapsize.
Doesn't matter in smaller maps, but having around 500 triggers, it can save up space :)

And you trigger has leaks, should use a unit group and remove it at the end.
Other than that, it looks great. Couldn't see why it shouldn't work :D
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top