• 🏆 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!

How to add/subtract attributes using tomes

Status
Not open for further replies.
Level 10
Joined
Sep 3, 2009
Messages
458
Hello again I need some help. I'm trying to do a trigger that adds attibutes to a hero. I use loop triggers but the problem is when I do the loop and do the giver item to hero(its a tome) instead of automatically using it, it will just appear on the ground.

Trigger

  • Do Multiple ActionsFor each (Integer TransStatAdd[(Custom value of (Picked unit))]) from 1 to TransStatAGI[(Custom value of (Picked unit))], do (Actions)
    • Loop - Actions
      • Hero - Create Add AGI and give it to TransTarget[(Custom value of (Picked unit))]
Can anyone help
 
Level 10
Joined
Sep 3, 2009
Messages
458
The item has to be a powerup and it has to be marked as "automatically used".
You can do both in object editor.

I based it of a tome item Tome of Strength. It's really frustrating cause it should work. I don't know what I'm doing wrong.

Do they have an inventory? Is it full? Is it a hero inventory (can use items)?

In unrelated news, if you are trying to set strength/agility/intelligence you can do that directly with code.

Yup a hero, it has one item.

Wow then that would be awesome then ^_^ Do you by any chance know of this code?
 
Level 10
Joined
Sep 3, 2009
Messages
458
In GUI, Hero - Modify Hero Attributes.

OMG O. O there actually is a trigger lol thanks man I ma test

Does the tome of strength has the ability +Str? I know it sounds stupid but it could be a mistake.

yup I have modified abilities and It's already in the items ^_^

Hero - Modify Hero Attribute?

Use this by the way:
  • Actions
    • Set Point1 = (Position of (your unit))
    • Item - Create Tome of Strength at Point1
    • Unit - Order (your unit) to Right-Click (Last created item)
    • Custom script: call RemoveLocation (udg_Point1)

I'll try that too!
 
Level 10
Joined
Sep 3, 2009
Messages
458
What purpleploot said worked! +rep~!

But for the one Pharaoh gave, it didn't work, I wonder why. When I manual right-Click it it works.


Could you make 2 screenshots, one screenshot of the first data page of the unit (with abilities etc) and one with the item data?

Well I already deleted the items so I really can't XD but like I said it was based of the Tome of Strength item. I only modified the name and the ability in the item.
 
It worked for me by the way, but, if you move, the item will just stay there, so I tried the alternative Hero - Give Item to Hero.
  • Actions
    • Set Point1 = (Position of (your unit))
    • Item - Create Tome of Strength at (Point1)
    • Hero - Give (Last created item) to (your unit)
    • Custom script: call RemoveLocation (udg_Point1)
Here is the test map; press Escape to check and move the hero if you want at the same time. View attachment Power Up Instant Pickup.w3x
 
Status
Not open for further replies.
Top