• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Level-up command problem?

Status
Not open for further replies.
Level 20
Joined
Apr 14, 2012
Messages
2,901
Ok so I've tried to make a level up trigger for my map. I did everything right, didn't I? But I can't figure out what's wrong with my trigger:

  • lvlup
    • Events
      • Player - (Owner of Defender Of Light 0001 <gen>) types a chat message containing -lvlup as An exact match
    • Conditions
      • (Substring((Entered chat string), 1, 7)) Equal to -lvlup
    • Actions
      • Set LV_Temp_Int = (Integer((Substring((Entered chat string), 8, (Length of (Entered chat string))))))
      • Set LV_Group = (Units currently selected by (Triggering player))
      • Unit Group - Pick every unit in LV_Group and do (Actions)
        • Loop - Actions
          • Hero - Set (Triggering unit) Hero-level to ((Hero level of (Picked unit)) + LV_Temp_Int), Show level-up graphics
      • Custom script: call DestroyGroup(udg_LV_Group)
 
Level 4
Joined
Jan 27, 2010
Messages
133
Should be picked unit twice in loop.

Should be substring and in EVENT.

Also, first try without the substring in condition and level, just to make sure that the rest is working.

  • lvlup
  • Events
  • Player - (Owner of Defender Of Light 0001 <gen>) types a chat message containing -lvlup as A SUBSTRING
  • Conditions
  • Actions
  • Set LV_Temp_Int = 1
  • Set LV_Group = (Units currently selected by (Triggering player))
  • Unit Group - Pick every unit in LV_Group and do (Actions)
    • Loop - Actions
      • Hero - Set (PICKED UNIT) Hero-level to ((Hero level of (Picked unit)) + LV_Temp_Int), Show level-up graphics
  • Custom script: call DestroyGroup(udg_LV_Group)
 
Status
Not open for further replies.
Top