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

[JASS] get/store integer with integer index per unit

Status
Not open for further replies.
Level 6
Joined
Feb 18, 2005
Messages
263
Hi
I know the topic sounds quite difficult, but heck i disbelieve it is and i would do it myself, if i could figure out about the gamecache (i know how it should work, but it doesn't -.-)

So here is the reason why i need the script:
I'd like a spell-learning-system for my map in which a spell is not improved via levelup but via using it.
So i need a way to know how often a spell has been used by a specific unit.

And here is the semi-code for the functions i'd like to get:

Code:
function get_uses takes integer unit, integer ability returns integer uses
Cache <- Get_Cache_For_Unit(unit)
uses <- Get_Integer_By_Index(Cache, ability)
return uses
endfunction

function store_integer takes integer unit, integer ability, integer value returns nothing
Cache <- Get_Cache_For_Unit(unit)
Set_Integer_By_Index(Cache, ability, value)
endfunction

i hope everyone can understand what i want and i definitly look forward for any part of this beeing done for me.

Note:
The names for functions and variables my be different from my semicode.
 
Status
Not open for further replies.
Top