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.
  • 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 The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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