• 🏆 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 Response to Specific Name!

Status
Not open for further replies.
Level 3
Joined
Dec 11, 2012
Messages
43
Hello I am trying to make a trigger that only executes itself when a specific player name says the command.

For example lets say I wanted to make "thisexamplename" get all of blue players units when he says -give me blue. No matter what color "thisexamplename" is on the trigger will only work if his name says the command.
 
Level 3
Joined
Dec 11, 2012
Messages
43
I strongly advise against this.
If someone opens your map and see the trigger he can use that name for his own purposes.

This is for debugging purposes and the map will be protected when the time comes to release. I know its possible to deprotect a map but there are ways to cover that. I thank you for your concern but as of right now theres no need to worry.

use a string condition

  • (Name of (Triggering player)) Equal to examplename


Thank you for this information I have found it and will use it well. Under events when I put it as player - chat message do I have to assign this event over for every color or is there a possible way to make one event and have it set just to the name regardless of color?

Pgwl1bE.png
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
This is for debugging purposes and the map will be protected when the time comes to release. I know its possible to deprotect a map but there are ways to cover that. I thank you for your concern but as of right now theres no need to worry.
Someone like myself can just open the map in MPQEdit, extract the JASS script file/files and then ctrl+F the appropriate triggers to know what key names were used. I did this over a decade ago to LoaP Resident Evil where I spoofed the creators name to get access to his cheats.

There is no such concept as map protection. One can damage or corrupt maps to prevent World Edit from working on them directly but there are still other ways to edit them and reading from a map is always trivial.
Thank you for this information I have found it and will use it well. Under events when I put it as player - chat message do I have to assign this event over for every color or is there a possible way to make one event and have it set just to the name regardless of color?
What does it have to do with color at all? If you mean players then yes, you must assign the even for every player. In GUI one can make a loop to do this by using the actions to dynamically add events to another trigger in an initialization trigger. With JASS you can write a simple loop in the initialization function.

Since player names are case insensitive you will want to make sure to convert the case of the player name to either upper or lower case before comparing. This makes the trigger more robust.
 
Level 3
Joined
Dec 11, 2012
Messages
43
Alright thanks one more question how do I make it that all of one players units and buildings change owners to the person who said the command? I think I got it figured out but I wanted to be sure so heres a screenshot did I do this right?
 

Attachments

  • help.png
    help.png
    26.7 KB · Views: 58
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
I think I got it figured out but I wanted to be sure so heres a screenshot did I do this right?
The trigger makes no sense. There is no picked unit in the context.

Pick every unit in unit group consisting of all units owned by the target player. Then for each of those units change ownership of the picked unit to triggering player. Basically use a for unit in unit group loop instead of a for player in player group loop.
 
Level 3
Joined
Dec 11, 2012
Messages
43
The trigger makes no sense. There is no picked unit in the context.

Pick every unit in unit group consisting of all units owned by the target player. Then for each of those units change ownership of the picked unit to triggering player. Basically use a for unit in unit group loop instead of a for player in player group loop.

Do you mean like this?
 

Attachments

  • help.png
    help.png
    25.6 KB · Views: 73
Status
Not open for further replies.
Top