Set damage/armor chat command

wilze

Active Member
Reaction score
3
How do I modify a units damage/armor with a chat command? :banghead:

I have already made trigger that sets the health and mana of the unit to a requested value (after a tutorial by Tom Jones). Now I need help with this! Thanks in advance!

Edit: One more question, how would I make this trigger loop the unit animation?
Trigger:
  • Play Animation
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 4)) Equal to play
    • Actions
      • Unit Group - Pick every unit in Group_A and do (Actions)
        • Loop - Actions
          • Animation - Play (Picked unit)'s (Substring((Entered chat string), 6, (Length of (Entered chat string)))) animation
 

Amn

Member
Reaction score
18
for damage use the ability item attack damage bonus with 30 levels or more.
at level 1 put 0 bonus damage, increasing by 10 or 5 each level.
then u increase the level by trigger giving the ability to the unit if doesnt have it.

for armor u can do the same, the ability name is item armor bonus
 

wilze

Active Member
Reaction score
3
Holy crapper! I just imported your system into my map, and I think I did it properly. But I had to change the substring conditions in your test command trigger cause I already had another command that interfered with that one. But now when I test it, the unit I have selected inherits a bunch of abilities? And gains no damage? I'll upload the map so you can take a look.

Mediafire link:
http://www.mediafire.com/?631096q52nqyn6b
 

vypur85

Hibernate
Reaction score
803
Mind posting the triggers instead?

The system should work fine. Just copy the system trigger. Remember to auto generate unknown variables (can be found in File>Preference). The damage addition/setting trigger should be the source of your problem. Also, remember to create 5 separate Item Damage Bonus with correct damage value. Make sure you set the ability variable correctly at the Map Init trigger. I guess that's about it. :)

(The bolded phrase being the most important, judging from your description.)
 

wilze

Active Member
Reaction score
3
Trigger:
  • Damage System Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Int_DamageSys_DigitCount = 5
      • Set Abi_DamageSys_Damage[1] = Spawn Doodad
      • Set Abi_DamageSys_Damage[2] = Max Mana Modifier
      • Set Abi_DamageSys_Damage[3] = Terrain 2x2
      • Set Abi_DamageSys_Damage[4] = Fighter F
      • Set Abi_DamageSys_Damage[5] = Max Life Modifier

Trigger:
  • Damage System
    • Events
    • Conditions
    • Actions
      • -------- Required if unit does not have the dummy ability to begin with --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Abi_DamageSys_Damage[1] for Unit_DamageSys_Unit) Equal to (==) 0
          • Then - Actions
            • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
              • Loop - Actions
                • Unit - Add Abi_DamageSys_Damage[(Integer A)] to Unit_DamageSys_Unit
          • Else - Actions
      • -------- Determine Current Damage --------
      • Set Int_DamageSys_CurrentDmg = 0
        • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
          • Loop - Actions
            • Set Int_DamageSys_CurrentDmg = (Int_DamageSys_CurrentDmg + (((Level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit) - 1) x (Integer((Power(10.00, ((Real((Integer A))) - 1.00)))))))
      • -------- Add Damage --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Int_DamageSys_ADDdamage Greater than (>) 0
          • Then - Actions
            • Set Int_DamageSys_ADDdamage = (Int_DamageSys_ADDdamage + Int_DamageSys_CurrentDmg)
              • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
                • Loop - Actions
                  • Set Int_General = ((Int_DamageSys_ADDdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
                  • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
          • Else - Actions
            • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
              • Loop - Actions
                • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to 1
                • Set Int_General = ((Int_DamageSys_SETdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
                • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
      • Set Int_DamageSys_ADDdamage = 0
      • Set Int_DamageSys_SETdamage = 0

Trigger:
  • Set Damage
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 6)) Equal to (==) setdam
        • Then - Actions
          • Set Int_DamageSys_SETdamage = (Integer((Substring((Entered chat string), 8, 12))))
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 6)) Equal to (==) adddam
        • Then - Actions
          • Set Int_DamageSys_ADDdamage = (Integer((Substring((Entered chat string), 8, 12))))
        • Else - Actions
      • Unit Group - Pick every unit in Group_A and do (Actions)
        • Loop - Actions
          • Set Unit_DamageSys_Unit = (Picked unit)
          • Trigger - Run Damage System <gen> (checking conditions)
 

wilze

Active Member
Reaction score
3
Bump! (I think I'm allowed to bump now? My clock is telling me it's 24hrs since the last post, if not I'm sorry)
 

vypur85

Hibernate
Reaction score
803
Uh. The problem is as I've mentioned... (Read the bolded text from previous post)

You did not create 5 Item Damage Bonus abilities and set them to appropriate damage values. After that, define the abilities in the Map Initialisation trigger (ie Set Abi_DamageSys_Damage[1] = Item Damage Bonus 1, Set Abi_DamageSys_Damage[2] = Item Damage Bonus 2.... etc).

Read the 'How to implement' in the Set Damage thread. For reference, check out the demo map. You should be on the right track.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top