• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Item triggering

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello, is there a way to make this item update itself if i, in example purchase an intelligence tome + 50?

  • Deathcap Acquires
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Item carried by (Triggering unit) of type Deathcap) is owned) Equal to True
    • Actions
      • Hero - Modify Intelligence of (Triggering unit): Add (Integer(((Real((Intelligence of (Triggering unit) (Exclude bonuses)))) x 0.25))).
  • Deathcap Loses
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • ((Item carried by (Triggering unit) of type Deathcap) is owned) Equal to True
    • Actions
      • Hero - Modify Intelligence of (Triggering unit): Subtract (Integer(((Real((Intelligence of (Triggering unit) (Exclude bonuses)))) x 0.20))).
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
not sure exactly what you are trying to do, but it seems like the simplest way would be to just (instantly) remove that item, and give the unit the upgraded version of the item (behind the scenes actually 2 different items, but to the player would just seem like it upgraded.)
 
Level 7
Joined
Feb 23, 2020
Messages
253
not sure exactly what you are trying to do, but it seems like the simplest way would be to just (instantly) remove that item, and give the unit the upgraded version of the item (behind the scenes actually 2 different items, but to the player would just seem like it upgraded.)
It's an item that incresaes the intelligence of the wearer by 25%, this works fine, but if the hero gains an base intelligence increase, the 25% does not add up. This is pretty much a copy of Rabadons Deathcap from LoL.

Edit: Oh yeah, when the wearer loses the item it's kinda bugged since it works with any item. What condition should i use to specify which item is lost?

Edit: I fixed the bug :))
 
Last edited:
Level 12
Joined
Mar 13, 2020
Messages
421
You need a trigger that refresh the 25%...

time event with every 2 sec should be fine

and about the lose i can watch in 1 hour when I’m at home how I handle it in my map because I used only triggered items ... to not use any (green bonuses) and only the base ( like base damage ) to avoid the green bonus numbers
 
Level 7
Joined
Feb 23, 2020
Messages
253
You need a trigger that refresh the 25%...

time event with every 2 sec should be fine

and about the lose i can watch in 1 hour when I’m at home how I handle it in my map because I used only triggered items ... to not use any (green bonuses) and only the base ( like base damage ) to avoid the green bonus numbers

Yeah i was thinking about making an event that refreshes it, but i dont really know how to do that. Glad for any help i can get
 
Level 7
Joined
Feb 23, 2020
Messages
253
if I’m at home in 1 hour I send you my example from my map...

Would be really cool, thank you. This problem i solved, brain lagged a bit.

  • Deathcap Loses
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • ((Item carried by (Triggering unit) of type Deathcap) is owned) Equal to True
      • (Item-type of (Item being manipulated)) Equal to Deathcap
    • Actions
      • Hero - Modify Intelligence of (Triggering unit): Subtract (Integer(((Real((Intelligence of (Triggering unit) (Exclude bonuses)))) x 0.20))).
 
Level 12
Joined
Mar 13, 2020
Messages
421
Fi
Would be really cool, thank you. This problem i solved, brain lagged a bit.

  • Deathcap Loses
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • ((Item carried by (Triggering unit) of type Deathcap) is owned) Equal to True
      • (Item-type of (Item being manipulated)) Equal to Deathcap
    • Actions
      • Hero - Modify Intelligence of (Triggering unit): Subtract (Integer(((Real((Intelligence of (Triggering unit) (Exclude bonuses)))) x 0.20))).

The problem I think for your method is that you multiply the amount of the intelligence... but when the hero get the item... and later after a Ton of Intelligence gain by levels and stuff and he sell the item... he lose more intelligence... I think

that’s why we need the refresher for the item set the value all time in a variable...

set the 25% in a variable
Then add the variable to his current intelligence

refresh it all 2 sec in the variable
And Set it all 2 sec to the new amount

to avoid things...

you can use a array variable DeathcapValue[Playernumber(ownerofunit(heromanipulatingitem] to save for each player this amount in a variable...
 
Level 7
Joined
Feb 23, 2020
Messages
253
Fi


The problem I think for your method is that you multiply the amount of the intelligence... but when the hero get the item... and later after a Ton of Intelligence gain by levels and stuff and he sell the item... he lose more intelligence... I think

that’s why we need the refresher for the item set the value all time in a variable...

set the 25% in a variable
Then add the variable to his current intelligence

refresh it all 2 sec in the variable
And Set it all 2 sec to the new amount

to avoid things...

you can use a array variable DeathcapValue[Playernumber(ownerofunit(heromanipulatingitem] to save for each player this amount in a variable...

Maybe i'm wrong, but if i refresh it every 2 sec, i think it would keep stacking endlesly?
 
Level 12
Joined
Mar 13, 2020
Messages
421
You can avoid this endlesly....
Set the variable to the intelligence of the hero and the amount and then use

Set intelligence and not add intelligence

and you can turn of the trigger (refresher when the hero get an item to avoid leaks like you buy a int item at the same moment it refresh)

or use a real variable to refresh

Event
hero gains a level and hero get a item

Condition
Item not equal to deathcap

Action refresh...
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
since the ways to change permanent levels of attributes are pretty limited ( usually only by level gain or tomes ) it would be much more efficient to set up triggers that test for those specific events:

  • level gain trigger
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Triggering unit) is in ThisItemGroup Equal to True
    • Actions
  • tome use trigger
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Tome of Knowledge
        • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence
        • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +2
      • Actions
these would be more efficient and more precise.

Edit:

you would add the units with the item into the unit group and detect when they got a new level like this. obv these triggers are very partial...
 
Last edited:
Level 12
Joined
Mar 13, 2020
Messages
421
Maybe i'm wrong, but if i refresh it every 2 sec, i think it would keep stacking endlesly?

just use your brain ( not meaning it bad )
And calculate all problems can affort your trigger and do solution to avoid the problems / and test your triggers you can clearly find problems if you test your triggers and fix and test again and at the end after 10 - 20 min of testing and working on you will find a solution and working trigger by urself... just keep on and learn by testing and doing :)
 
Level 7
Joined
Feb 23, 2020
Messages
253
just use your brain ( not meaning it bad )
And calculate all problems can affort your trigger and do solution to avoid the problems / and test your triggers you can clearly find problems if you test your triggers and fix and test again and at the end after 10 - 20 min of testing and working on you will find a solution and working trigger by urself... just keep on and learn by testing and doing :)

Alright thank you, i will try to fix this and come up with a solution
 
Level 7
Joined
Feb 23, 2020
Messages
253
since the ways to change permanent levels of attributes are pretty limited ( usually only by level gain or tomes ) it would be much more efficient to set up triggers that test for those specific events:

  • level gain trigger
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Triggering unit) is in ThisItemGroup Equal to True
    • Actions
  • tome use trigger
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Tome of Knowledge
        • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence
        • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +2
      • Actions
these would be more efficient and more precise.

Edit:

you would add the units with the item into the unit group and detect when they got a new level like this. obv these triggers are very partial...


I understand what you mean, i'll try that out aswell
 
Level 18
Joined
Oct 17, 2012
Messages
821
You could take advantage of New Bonus if you on patch 1.31+. It will make your inquiry a breeze to solve.

In essence, the system manipulates item bonus stat abilities via the new natives for abilities. This note is just in case you did not want to import an entire system. Then again, you might as well import the system since it does all the work for you, lessening the time wasted brewing over this issue of yours. In addition, it could become a blessing for future endeavors.

I have a bit of a gripe with the system since it is not so easy to extend the system with new custom stats. So, there is that to consider.

If you are in need of assistance for setting up the system in your map, feel free to ask me.
 
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
You could take advantage of New Bonus if you on patch 1.31+. It will make your inquiry a breeze to solve.

In essence, the system manipulates item bonus stat abilities via the new natives for abilities. This note is just in case you did not want to import an entire system. Then again, you might as well import the system since it does all the work for you, lessening the time wasted brewing over this issue of yours. In addition, it could become a blessing for future endeavors.

I have a bit of a gripe with the system since it is not so easy to extend the system with new custom stats. So, there is that to consider.

If you are in need of assistance for setting up the system in your map, feel free to ask me.

I will take a look at this, always a bit messy with new systems at first and thanks.
 
Level 7
Joined
Feb 23, 2020
Messages
253
since the ways to change permanent levels of attributes are pretty limited ( usually only by level gain or tomes ) it would be much more efficient to set up triggers that test for those specific events:

  • level gain trigger
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Triggering unit) is in ThisItemGroup Equal to True
    • Actions
  • tome use trigger
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Tome of Knowledge
        • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence
        • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +2
      • Actions
these would be more efficient and more precise.

Edit:

you would add the units with the item into the unit group and detect when they got a new level like this. obv these triggers are very partial...

I tried this method but i cant really seem to make it work properly, it does not really update the intelligence the way i want it too.

  • Deathcap Tomes
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Item carried by (Triggering unit) of type Deathcap) is owned) Equal to True
      • (Item-type of (Item being manipulated)) Equal to Deathcap
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Tome of |cff0000ffIntelligence|r +50
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +10
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +9
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +8
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +7
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +6
              • (Item-type of (Item being manipulated)) Equal to Tome of |cff0000ffIntelligence|r +5
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +4
              • (Item-type of (Item being manipulated)) Equal to Tome of intgellience +3
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence +2
              • (Item-type of (Item being manipulated)) Equal to Tome of Intelligence
              • (Item-type of (Item being manipulated)) Equal to Tome of |cffc82583Knowledge|r
              • (Item-type of (Item being manipulated)) Equal to Tome of Knowledge
        • Then - Actions
          • Set VariableSet Deathcap_BaseInt = (Intelligence of (Triggering unit) (Exclude bonuses))
          • Set VariableSet DeathcapTomes = 1.25
          • Hero - Modify Intelligence of (Triggering unit): Set to (Deathcap_BaseInt x (Integer(DeathcapTomes))).
        • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
I threw a map together using a system I made that allows for scaling % Intelligence. It's definitely not the best way of going about this but it seems to work fine.

It uses a Unit Indexer which is a system that assigns a unique Custom Value to each unit.

Custom Value explained:

Custom Value is a stat provided by Blizzard, and as the name suggests it's basically a means to create and store your own custom data to a unit. You can Set a unit's custom value to be equal to any Integer value you'd like and you can Get this information from a unit whenever you'd like. This is great and all but it has many limitations. For starters, you can only assign a single custom value to a given unit. On top of that, it can only store Integer values. So that's where the Unit Indexer comes into play. The Unit Indexer enables the true power of custom value, and it does so by assigning a unique custom value to each unit in your map. So the system does this for your preplaced units at the start of the game as well as whenever you create a new unit. Why is this useful? Because now you can take advantage of another useful thing, variable Arrays. An Array allows you to use a single Variable to store many many things. You can enable an Array in the Variable Editor when you create a Variable by clicking the Array checkbox. After doing so you'll see some brackets appear after your variable, like AbilityPower[].

Using the custom value of a unit as the Index in an Array --> [ the integer in these brackets ], you can assign each unit it's own Value for that Variable.
  • --- EXAMPLE: ---
  • Set Variable AbilityPower[custom value of some unit] = 100
  • Set Variable AbilityPower[custom value of some OTHER unit] = 200
This works because each unit has it's own unique custom value, therefore each unit will have it's own unique Index in the Array.

In this case I use this method to keep track of each Hero's White Intelligence (starting int + int per level) and Green Intelligence (int added from items like Robe of the Magi). I also use it to keep track of how many Deathcap's a Hero is carrying.

Keeping track of these values allows me to modify a Hero's Intelligence any way I'd like. Keep in mind that I didn't design the system to be very flexible so it only works for Deathcaps at the moment. That being said, it could be modified to work for other +% Intelligence items as well in addition to Deathcap. It's also a bit limited due to the limitations of working in GUI (aka not coding it).
 

Attachments

  • Intelligence Scaling 1.w3m
    27.4 KB · Views: 16
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
I threw a map together using a system I made that allows for scaling % Intelligence. It's definitely not best way of going about this but it seems to work fine.

It uses a Unit Indexer which is a system that assigns a unique custom value to each unit. This is basically an Integer id, and since each unit will have it's own id you can differentiate between them and take advantage of Variable Arrays.

So using the custom value of a unit as the Index in an Array --> [ the integer in these brackets ], you can assign each unit it's own Value for that Variable.
  • --- EXAMPLE: ---
  • Set Variable AbilityPower[custom value of some unit] = 100
In this case I use this method to keep track of each Hero's White Intelligence (starting int + int per level) and Green Intelligence (int added from items like Robe of the Magi). I also use it to keep track of how many Deathcap's a Hero is carrying.

Keeping track of these values allows me to modify a Hero's Intelligence any way I'd like. Keep in mind that I didn't design the system to be very flexible so it only works for Deathcaps at the moment. That being said, it could be modified to work for other +% Intelligence items as well in addition to Deathcap. It's also a bit limited due to the limitations of working in GUI (aka not coding it).

Wow, that's impressive. Thank you very much mate
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
I threw a map together using a system I made that allows for scaling % Intelligence. It's definitely not the best way of going about this but it seems to work fine.

It uses a Unit Indexer which is a system that assigns a unique Custom Value to each unit.

Custom Value explained:

Custom Value is a stat provided by Blizzard, and as the name suggests it's basically a means to create and store your own custom data to a unit. You can Set a unit's custom value to be equal to any Integer value you'd like and you can Get this information from a unit whenever you'd like. This is great and all but it has many limitations. For starters, you can only assign a single custom value to a given unit. On top of that, it can only store Integer values. So that's where the Unit Indexer comes into play. The Unit Indexer enables the true power of custom value, and it does so by assigning a unique custom value to each unit in your map. So the system does this for your preplaced units at the start of the game as well as whenever you create a new unit. Why is this useful? Because now you can take advantage of another useful thing, variable Arrays. An Array allows you to use a single Variable to store many many things. You can enable an Array in the Variable Editor when you create a Variable by clicking the Array checkbox. After doing so you'll see some brackets appear after your variable, like AbilityPower[].

Using the custom value of a unit as the Index in an Array --> [ the integer in these brackets ], you can assign each unit it's own Value for that Variable.
  • --- EXAMPLE: ---
  • Set Variable AbilityPower[custom value of some unit] = 100
  • Set Variable AbilityPower[custom value of some OTHER unit] = 200
This works because each unit has it's own unique custom value, therefore each unit will have it's own unique Index in the Array.

In this case I use this method to keep track of each Hero's White Intelligence (starting int + int per level) and Green Intelligence (int added from items like Robe of the Magi). I also use it to keep track of how many Deathcap's a Hero is carrying.

Keeping track of these values allows me to modify a Hero's Intelligence any way I'd like. Keep in mind that I didn't design the system to be very flexible so it only works for Deathcaps at the moment. That being said, it could be modified to work for other +% Intelligence items as well in addition to Deathcap. It's also a bit limited due to the limitations of working in GUI (aka not coding it).

This post should be a tutorial. :grin: Then you wouldn't have to keep repeating yourself...
 
Status
Not open for further replies.
Top