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

[Trigger] Trigger problems...

Status
Not open for further replies.
Level 1
Joined
Oct 21, 2007
Messages
3
Im making a LoaP map and im working on the triggers for the host... and I got one called "-give (color)" and i cant get it to work... here is the trigger...

Give Blue
Events
Player - Player 7 (Green) types a chat message containing -give blue as An exact match
Conditions
Actions
Unit - Change ownership of (Targeted unit) to Player 2 (Blue) and Change color

I also got one for host called "level *1-15*" that wont work either...

Level 1
Events
Player - Player 7 (Green) types a chat message containing -level 1 as An exact match
Conditions
Actions
Hero - Set (Targeted unit) Hero-level to 1, Show level-up graphics


and I also got one for booting players...

Boot Red
Events
Player - Player 7 (Green) types a chat message containing -boot red as An exact match
Conditions
Actions
Game - Defeat Player 1 (Red) with the message: The Host booted you...

can someone tell me what I am missing or done wrong? (just started making maps...)
 
Level 10
Joined
Jul 14, 2004
Messages
463
I think you should not use "exact match" but "as a part string" (or something like that), since the string you want is always longer than e.g. "-give" (the color should follow, shouldn't it?). Exact match means only the letters you gave, none more or less.
EDIT: Hm, I saw you already took care of that. Anyways, try it with "as a part string", does it work then? And make sure that the player you are testing it is the one in slot 7.
 
Level 1
Joined
Oct 21, 2007
Messages
3
im trying to get it to where when I click on a unit and type *-give blue*, the unit will become one of blues units...

once again i just got into this a few days ago, and im getting most of everything except for this :(

I tried making it *a substring* instead of a *exact match* and it still didnt work...
 
Level 10
Joined
Jul 14, 2004
Messages
463
...how could I miss that. Probably you want to do the actions with the selected units. In this case pack them into a PickEveryUnitInUnitGroup with group "Units selected by Player 7" and then of course "picked unit" instead of "targeted unit".
EDIT: you were faster than me. But I seem to have had the right theory...
Try to display a text message as first action in the trigger, then you know if there is a problem with the events or with the actions.
 
Level 1
Joined
Oct 21, 2007
Messages
3
it worked ^_^ ty
I also got the booting thing working, and im sure the leveling thing works also ^_^

ty ty ty XD :pal:

EDIT:
...how could I miss that. Probably you want to do the actions with the selected units. In this case pack them into a PickEveryUnitInUnitGroup with group "Units selected by Player 7" and then of course "picked unit" instead of "targeted unit".

that worked
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
JASS:
function GetUnitsSelectedAll takes player whichPlayer returns group
    local group g = CreateGroup()
    call SyncSelections()//THIS LINE IS THE PROBLEM; MAKE A CUSTOM FUNC WITHOUT IT, OR JUST USE THE NATIVE
    call GroupEnumUnitsSelected(g, whichPlayer, null)
    return g
endfunction

Does weird shiz on BNet - doesn't detect your selection properly, for eg.
 
Status
Not open for further replies.
Top