WolfieeifloW
WEHZ Helper
- Reaction score
- 372
The "tooltip" for the substring command is cutoff in NewGen...
So I need help with this.
I'm making a little trigger just for testing purposes that when a player types "-lvlup" they level up once.
This part works !
But, I also want the player to be able to type "-lvlup#" where # gets replaced with a real number.
There can be two numbers here too, so I tried to substring both:
Like I said, if you type "-lvlup" it works, but if you try something like "-lvlup7", it doesn't work.
Thanks in advance TH.net!
So I need help with this.
I'm making a little trigger just for testing purposes that when a player types "-lvlup" they level up once.
This part works !
But, I also want the player to be able to type "-lvlup#" where # gets replaced with a real number.
There can be two numbers here too, so I tried to substring both:
Code:
LevelUp
Events
Player - Player 1 (Red) types a chat message containing -lvlup as A substring
Player - Player 2 (Blue) types a chat message containing -lvlup as A substring
Player - Player 3 (Teal) types a chat message containing -lvlup as A substring
Player - Player 4 (Purple) types a chat message containing -lvlup as A substring
Player - Player 5 (Yellow) types a chat message containing -lvlup as A substring
Player - Player 6 (Orange) types a chat message containing -lvlup as A substring
Player - Player 7 (Green) types a chat message containing -lvlup as A substring
Player - Player 8 (Pink) types a chat message containing -lvlup as A substring
Player - Player 9 (Gray) types a chat message containing -lvlup as A substring
Player - Player 10 (Light Blue) types a chat message containing -lvlup as A substring
Player - Player 11 (Dark Green) types a chat message containing -lvlup as A substring
Player - Player 12 (Brown) types a chat message containing -lvlup as A substring
Conditions
Actions
Set tempGroup = (Units in (Playable map area) owned by (Triggering player))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Entered chat string) Equal to (==) -lvlup
Then - Actions
Unit Group - Pick every unit in tempGroup and do (Actions)
Loop - Actions
Hero - Set (Picked unit) Hero-level to ((Hero level of (Picked unit)) + 1), Show level-up graphics
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Length of (Entered chat string)) Equal to (==) 7
Then - Actions
Unit Group - Pick every unit in tempGroup and do (Actions)
Loop - Actions
Hero - Set (Picked unit) Hero-level to ((Hero level of (Picked unit)) + (Integer((Substring(-lvlup, 6, 7))))), Show level-up graphics
Else - Actions
Unit Group - Pick every unit in tempGroup and do (Actions)
Loop - Actions
Hero - Set (Picked unit) Hero-level to ((Hero level of (Picked unit)) + (Integer((Substring(-lvlup, 6, 8))))), Show level-up graphics
Custom script: call DestroyGroup(udg_tempGroup)
Thanks in advance TH.net!