• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Game Cache store ability

Status
Not open for further replies.
Ability ids are integers
you can store them with Jass like
call StoreInt(<gamecache>,"key",'A000') for example

I guess you are using some sort of ability purshing system
so you need to store ability ids in variables
Whenever Unit buys ability
Set NumOfAbilities[Player Number] = NumOfAbilities[Player Number] +1
Custom script: set udg_Abilities[ConvertedPlayerNumber(GetOwningPlayer(<learning unit>))] = <id of learned ability>

when storing
For Each A integer from 1 to NumOfAbilities[Player Number of storing player]
Custom script: call StoreInt(gamecache,"keyname"+I2S(bj_forloopAindex),set udg_Abilities[ConvertedPlayerNumber(GetOwningPlayer(<learning unit>))])

anyway something like this
 
The weapon is an ability? Or an item? If it's an ability and the ability isn't stored along with the unit, all I can think of is make a Integer Variable for each ability (0=Not available, 1=Available) and save that. Then you save and load it as Game Cache and make loads of If/Then/Else triggers

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • LaserTurretAvailable equal to 1
    • Then - Actions
      • Unit - Add Laser Turret to UNIT
    • Else - Actions
And then add the command to set it to the ability level you saved it as.
 
Status
Not open for further replies.
Back
Top