• 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.

[Solved] Removing ability with chat string

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi! I'm trying to remove abilities based on -forget (like GoH) but I'm having problems with it.

  • Preloads
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Skills and Skill Name --------
      • Set Skill[1] = Entangling Roots
      • Set Skill[2] = Envenomed Strike
      • Set Skill[3] = Pulverize
      • Set Skill[4] = Throw Rock
  • Forget Skill
    • Events
      • Player - Player 1 (Red) types a chat message containing -forget as A substring
      • Player - Player 2 (Blue) types a chat message containing -forget as A substring
      • Player - Player 3 (Teal) types a chat message containing -forget as A substring
      • Player - Player 4 (Purple) types a chat message containing -forget as A substring
      • Player - Player 5 (Yellow) types a chat message containing -forget as A substring
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 9, (Length of (Entered chat string)))) Equal to (Name of Skill[(Integer A)])
              • (Substring((Entered chat string), 1, 7)) Equal to -forget
            • Then - Actions
              • Player - Add (Level of Skill[(Integer A)] for Heroes[1]) to (Triggering player) Current lumber
              • Unit - Remove Skill[(Integer A)] from Heroes[1]
            • Else - Actions
 
Last edited:
  • (Substring((Entered chat string), 9, (Length of (Entered chat string)))) Equal to (Name of Skill[(Integer A)])
Start from 9 not 8.

Additonaly:
- you could replace (Integer A) with custom integer parameter
- add conditions from placement of "-forget":

  • Forget Skill
    • Events
      • Player - Player 1 (Red) types a chat message containing -forget as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 7)) Equal to -forget
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
I followed your first and third suggestions. Didn't understand the second one :) Replace (Interger A) with what? which custom integer parameter?... I mean,I have like 8 (Interger A)

It didn't work though =/ I'm testing with '-forget Throw Rock' and doesn't remove the skill.

Edit: Works doing it the 'dumb' way:

  • Preloads
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Skills and Skill Name --------
      • Set Skill[1] = Entangling Roots
      • Set SkillName[1] = (Name of Skill[1])
      • Set Skill[2] = Envenomed Strike
      • Set SkillName[2] = (Name of Skill[2])
      • Set Skill[3] = Pulverize
      • Set SkillName[3] = (Name of Skill[3])
      • Set Skill[4] = Throw Rock
      • Set SkillName[4] = (Name of Skill[4])
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm lost in the mid of everything... I'm confused :D

EDIT: It took my some time, but I finally understood everything. Edited the triggers in the first post to the one I actually have working. Thanks a lot for your help :)
 
Status
Not open for further replies.
Top