• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Baltross needs help(With targeted unit) {increasing a hero's level through chat}

Status
Not open for further replies.
Level 3
Joined
Jan 3, 2008
Messages
52
NOTIC: its Done,finished Complete :p


Ok i don't know if it works but it should some how i was wondering if you could make that if Player 1 says like .Levelup #(with # i mean random number)
and the unit that is targeted (If hero) becomes that level

Or another thing if he says something like .Lumber # it will set the owner of the targeted units lumber to the number he says after

:mwahaha:
 
Last edited:
Level 11
Joined
Feb 16, 2009
Messages
760
I know it. Use this as an example:
  • Chat command
    • Events
      • Player - Player 1 (Red) types a chat message containing -herolevel as A substring
    • Conditions
    • Actions
      • Hero - Set No unit Hero-level to (Integer((Substring((Entered chat string), 7, 8)))), Hide level-up graphics
  • Chat command 2
    • Events
      • Player - Player 1 (Red) types a chat message containing -lumber as A substring
    • Conditions
    • Actions
      • Player - Add (Integer((Substring((Entered chat string), 9, 13)))) to Player 1 (Red) Current lumber
To use this yourself, remember to:
In the event use as A substring, or it won't work
In the second example, 9, 13 stands for the location of the number. If i typed for example -gold 55 then the trigger should search in 6(Include spaces when counting) up till 9 so it reconises up till 9999
 
Level 9
Joined
Aug 1, 2008
Messages
453
His gold trigger should work fine but the hero one won't. Heres the hero level up trigger
  • Hero Command
    • Events
      • Player - Player 1 (Red) types a chat message containing .levelup as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 9)) Equal to .levelup
    • Actions
      • Unit Group - Pick every unit in (Random 1 units from (Units currently selected by (Player((Player number of (Triggering player)))))) 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
              • Set Level_Hero = (Picked unit)
              • Hero - Set Level_Hero Hero-level to (Integer((Substring((Entered chat string), 10, 11)))), Show level-up graphics
            • Else - Actions
And remeber to make sure there is a Space after .levelup. EX -gold
Heres a map with both commands.
 

Attachments

  • Commands.w3x
    16.8 KB · Views: 47
Last edited:
if thats confusing (it would confuse me if i didnt know how it worked),

he means, the first substring number you place will be the starting point of where your trigger will start converting the string into a number, and the second number you place will be where it stops.

Ex: -Herolevel (<- has 11 characters, and since you want to convert the string number that the player types after -herolevel (for ex: -Herolevel 32)for what level you want your hero, then you skip the first 11 characters and you will be at the 32 number of your string.)

The end number will stop the counting process at how many spaces you indicate.

Ex: -Herolevel 32(<- has 13 characters, so you want to stop it at 13, so it stops counting numbers after the first 2 digits after the -Herolevel Part.(necessarily the end number doesnt matter, but if you want it to be cleaner, you'd put how many digits of your max hero level is (say its 100), so 3, and add that to the first number))
 
Level 3
Joined
Jan 3, 2008
Messages
52
I know it. Use this as an example:
  • Chat command
    • Events
      • Player - Player 1 (Red) types a chat message containing -herolevel as A substring
    • Conditions
    • Actions
      • Hero - Set No unit Hero-level to (Integer((Substring((Entered chat string), 7, 8)))), Hide level-up graphics
  • Chat command 2
    • Events
      • Player - Player 1 (Red) types a chat message containing -lumber as A substring
    • Conditions
    • Actions
      • Player - Add (Integer((Substring((Entered chat string), 9, 13)))) to Player 1 (Red) Current lumber
To use this yourself, remember to:
In the event use as A substring, or it won't work
In the second example, 9, 13 stands for the location of the number. If i typed for example -gold 55 then the trigger should search in 6(Include spaces when counting) up till 9 so it reconises up till 9999

I don't really understand Where does the 7, 8)))), and the 9, 13)))) come from? i don't get either one to work Please i might appear noobish but yea i ain't the best triggerer i mostly know the basics nothing special so please mate.
 
Level 3
Joined
Jan 3, 2008
Messages
52
His gold trigger should work fine but the hero one won't. Heres the hero level up trigger
  • Hero Command
    • Events
      • Player - Player 1 (Red) types a chat message containing .levelup as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 9)) Equal to .levelup
    • Actions
      • Unit Group - Pick every unit in (Random 1 units from (Units currently selected by (Player((Player number of (Triggering player)))))) 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
              • Set Level_Hero = (Picked unit)
              • Hero - Set Level_Hero Hero-level to (Integer((Substring((Entered chat string), 10, 11)))), Show level-up graphics
            • Else - Actions
And remeber to make sure there is a Space after .levelup. EX -gold
Heres a map with both commands.

OMFG THANK YOU, It works perfecto hehe ;D +Rep
 
Status
Not open for further replies.
Top