| 07-18-2006, 04:07 AM | #1 |
I tried to make a trigger that will make you type the hero level of the hero with the following trigger. Trigger: it just happen to not launch the trigger at all, I had a pre-feeling that this wasn't going to work. nonetheless, suggestion for this? |
| 07-18-2006, 04:20 AM | #2 |
Pointing out the obvious, I don't see any events. Make an event for each player that can do this that runs the trigger when they type "-level " as a substring. That's the best answer I can give you with what you posted. |
| 07-18-2006, 05:18 AM | #3 |
the event looks like this Trigger: Player - Player 1 (Red) types a chat message containing <Empty String> as A substring |
| 07-18-2006, 05:27 AM | #4 |
Your if statement makes absolutely no sense. You are basically saying if a == a +1 which can never be true. Instead take out the if statement and make your event: Trigger: Player - Player 1 (Red) types a chat message containing -level as A substringThen change your conversions from string to integer to get the level to substring(6,Length(EnteredChatString). |
| 07-18-2006, 05:49 AM | #5 |
the only way why the event looks like this is cause I don't want to make a dozen triggers for all chat commands there are available, so I used empty string and then check the strings with variables. I do not exactly understand your explanation however ![]() |
| 07-18-2006, 06:27 AM | #6 | |
You don't have to make a trigger for each player for each command. Just put 12 events for each trigger, 1 event for each player. Also noticed this if statement from harshateja's post: Trigger: (Entered chat string) Equal to (-level + (String((Integer((Entered chat string))))))For example, if you type "-level 5" this will check the following: "-level 5" Equal to "-level 0" What's happening is you're trying to convert the string "-level 5" into an integer. Since you have non-numeric characters in that string, it will return 0. Therefore, that if statement will always return false. Simply change that conversion to the following: Quote:
|
| 07-18-2006, 09:55 AM | #8 |
what he wants is one trigger for all commands. not just one trigger per command. thats why he used that event Trigger: Player - Player 1 (Red) types a chat message containing <Empty String> as A substringjust change your first If - Condition to: Trigger: (Substring((Entered chat string), 1, 6)) Equal to -leveland your second one to Fireeye's condition. |
| 07-18-2006, 10:03 AM | #9 |
How about a substring of '-' ? |
| 07-18-2006, 10:08 AM | #10 |
ye, i guess that would be a little better if all the commands starts with a "-" which they usually do. Dunno if it will help much to the map though since you usually dont spamm constanly with a 0.01 interval in a game. Not that "that" would do anything anyways. |
| 07-18-2006, 11:20 AM | #11 |
all commands start with - so I could use that as a substring. I only need to display it to 1 player so thats easier as well. no do I not really get the "Substring((Entered chat string), 1, 6" what does the action do preciously?\\ P.S the hero is able to level up till 15 |
| 07-18-2006, 11:22 AM | #12 |
It creates a substring from the entered chat string starting at a, ending at b. |
| 07-18-2006, 11:57 AM | #13 | |
Quote:
But how does that detect my integer value in this case? |
| 07-18-2006, 01:44 PM | #14 |
that one doesnt, 1 to 6 checks for, obvious the first six chars on the string, being "-level" in this case. To check the int just do String 2 Integer (Substring(Entered Chat message, 8, 8)) (not 7 because there's a space between). |
| 07-18-2006, 03:30 PM | #15 |
Fireeye's trigger is fine, it will work good. A substring is just a part of a string cut up. Example: Word = fish, Min = 2, Max = 3, output = is Letter 2 to letter 3 = is. Word = Hello People, Min = 7, Max = 9, output = Peo A space is also a character (duh!). So Fireeye checked if the substring past the word -level was higher than the current level, and if it is set it. Code:
123456789 -level 5 He checks if 1234567 is = to "-level " (Notice the space), and sets the level to Substring - Min = 7, Max = stringlength, so its to the end. His method will work without flaws. |
