• 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.

Game Cache store ability

Status
Not open for further replies.
Level 19
Joined
Aug 24, 2007
Messages
2,888
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
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
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.
Top