• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Fix: Ability Choose and Upgrade System refuses to work

Status
Not open for further replies.

Ardenian

A

Ardenian

  • Hero build
    • Events
      • Unit - A unit Finished Construction
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Constructed structure)) Equal Necromancer
    • Actions
      • Set playernumber = (Player number of (Owner of (Constructed structure)))
      • Set Hero_Player[playernumber] = (Constructed structure)
  • Get ability
    • Events
      • Unit - A unit Sells an item (from the shop)
    • Conditions
      • (Item-type of (Item being manipulated)) Equal Ability_Item[1]
    • Actions
      • Set playernumber = (Player number of (Owner of (Selling unit)))
      • Einheit - Add Hero_Ability[1] to Hero_Player[playernumber]
Basically, a unit builds a structure, this structure will replace the Hero_Player with pre-set no unit. Next, if a dummy shop sells a indexed item, a corresponding ability will be given to the constructed unit.

The test map is attached, it contains all the triggers. If you test it, the dummies are selectable via the worker tooltip on the left bottom.

Please help me, I need this working for my map.

EDIT: Added replay, it does not really show much, but at least some steps from the trigger.
 
Last edited by a moderator:

Ardenian

A

Ardenian

It is not doing what I expect it to do.
It simply does not give the ability to the unit and I cannot think of any reason why it does not.
 
Level 9
Joined
Apr 23, 2011
Messages
527
his problem was the ability would not be given to the unit. anyway i solved it.

the problem is that the event does not run. i tried some workarounds, but it didn't work. ultimately, i had to go with using upgrades. took me a while due to really messy object and trigger editors q_q
 

Attachments

  • test.w3x
    28.7 KB · Views: 62

Ardenian

A

Ardenian

his problem was the ability would not be given to the unit. anyway i solved it.

the problem is that the event does not run. i tried some workarounds, but it didn't work. ultimately, i had to go with using upgrades. took me a while due to really messy object and trigger editors q_q

Oh, thank you a lot! Now it should work.

Yeah, I am sorry, it is really messy at the moment.
I'd give you rep again, but you are helping me that often I still have to spread it again :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
  • Get ability
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Ability_Item[1]
    • Actions
      • Set playernumber = (Player number of (Owner of (Selling unit)))
      • Unit - Add Hero_Ability[1] to Hero_Player[playernumber]
      • Trigger - Turn on Upgrade ability <gen>
      • Trigger - Turn off (This trigger)
Condition was incorrect.

Before...
  • (Item-type of (Item being manipulated)) Equal to Ability_Item[1]
(Item being manipulated) might return null due to there being no item manipulated. That event response is for inventory manipulation events, not item sales from shops events.

Fix...
  • (Item-type of (Sold Item)) Equal to Ability_Item[1]
(Sold Item) correctly returns the item which was sold from the shop. The result is the "Magic Ward" ability is correctly added to the building as you wanted.
 

Ardenian

A

Ardenian

@Dr Super Good: Oh thank you. Tho I am very sure that it didn't work with the fixed solution.

I will stay with the upgrade opportunity that Light showed me.
Thank you for explaining me the mistake!
 

Ardenian

A

Ardenian

Oh, I understand...

Hm, am not sure what I will do. I will try it again the way you suggest and then I decide.
Thank you!
 
Status
Not open for further replies.
Top