• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

"Add Ability To Item" Added Abilities not transferring between maps

Level 6
Joined
Sep 15, 2020
Messages
67
I'm tinkering with the concept of dynamic, randomly-generated items that persist and can be upgraded across a campaign. In short, say I generate an Axe with two random abilities (Took me some figuring out to realize you can only add abilities to items currently carried by a Hero), and Save the Hero carrying the Axe in a GameCache, then load the next level, which is a duplicate of the same map with the same custom object and variable data. When I load the Hero into the 2nd map, his Axe reverts to a blank default with no abilities. What steps, GUI only preferred, should I take to transfer the Axe's properties between maps?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I'm tinkering with the concept of dynamic, randomly-generated items that persist and can be upgraded across a campaign. In short, say I generate an Axe with two random abilities (Took me some figuring out to realize you can only add abilities to items currently carried by a Hero), and Save the Hero carrying the Axe in a GameCache, then load the next level, which is a duplicate of the same map with the same custom object and variable data. When I load the Hero into the 2nd map, his Axe reverts to a blank default with no abilities. What steps, GUI only preferred, should I take to transfer the Axe's properties between maps?
I assume Game Cache simply saves the Item-Type Id and Item Charges of each inventory slot (I never used it before). I imagine you'll have to save the new Abilities of the Axe separately and add them again upon loading. Remember that just about everything is an Integer or can be made to act like one (IE: saving an index of an Ability Code array).

If Game Cache isn't flexible enough to do this, you can rely on your own save/load system:
 
Last edited:
Level 6
Joined
Sep 15, 2020
Messages
67
I assume Game Cache simply saves the Item-Type Id and Item Charges of each inventory slot (I never used it before). I imagine you'll have to save the new Abilities of the Axe separately and add them again upon loading. Remember that just about everything is an Integer or can be made to act like one (IE: saving an index of an Ability Code array).

If Game Cache isn't flexible enough to do this, you can rely on your own save/load system:
Thanks for the tip. I did give it a shot but couldn't seem to make it work out.

I saved the randomly assigned abilities to two integer variables, and saved those to Cache along with the Paladin carrying the modified axe.
I loaded the Hero in the next map, saved him in a Variable as <Hero>, set an Item variable to "Item carried by <Hero> of type (Modular Axe)"
I then loaded the two Item Ability Variables from before and ran them through my script to get the abilities, and added them to <Item>
But nothing, not even the proper names of the item name affixes applied properly.

Some further tinkering to be considered at a later point, when the next burst of compulsive inspiration hits.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Thanks for the tip. I did give it a shot but couldn't seem to make it work out.

I saved the randomly assigned abilities to two integer variables, and saved those to Cache along with the Paladin carrying the modified axe.
I loaded the Hero in the next map, saved him in a Variable as <Hero>, set an Item variable to "Item carried by <Hero> of type (Modular Axe)"
I then loaded the two Item Ability Variables from before and ran them through my script to get the abilities, and added them to <Item>
But nothing, not even the proper names of the item name affixes applied properly.

Some further tinkering to be considered at a later point, when the next burst of compulsive inspiration hits.
You should post your triggers, I can't suggest too much without seeing them.
But my gut tells me that you saved the wrong Integer Id for the abilities.
 
Top