• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Save/load system compatable?

Status
Not open for further replies.
Level 8
Joined
Dec 9, 2009
Messages
397
I've searched the forum and there are a lot of questions on save/load systems, but none of them that I found answered the question I have.

Which save/load system should I use if I'm using The Witcher's Advanced Equipment System Not all of them seem to support more than what the hero is carrying in his 6 slots.

And how would I set up the save/load system to look at the items on the 2nd unit?


Thanks for any info.
 
Level 11
Joined
Apr 6, 2008
Messages
760
It can be dont since you can get the ability ids with this function

JASS:
function GetEquipItemID takes unit u, integer class returns integer
    local Inventory dat = LoadInteger(h,GetHandleId(u),1)
return dat.Item[class]
endfunction

loop it like this

JASS:
loop
    exitwhen index >=  itemclasses //Remove private on this global
    set ID = GetEquipItemID("Unit",index)
    //Do stuff like add the "Code" to the save/load string
    set index = index + 1
endloop

thou since its 9 item classes it will be alot of code ^^, could use some advance math to shorten it (saw some guy who tried to make something like that here on hive)

EDIT:

maybe next time read the documentation? :p
JASS:
//----- For SAVE/LOAD systems use these functions: -----
//
// use this function to get the index of the equipped item of class xyz (save these values in your load code) ...
// GetEquipItemIndex (u, class) it returns an integer
// unit integer
//
// ... and this function to equip a new item by this index (which you read out from the load code)!
// EquipItemByID (u, index)
// unit integer
//
//
// to implement this system, just copy this trigger in your map
// it requires jngp to work well
//
 
Last edited:
Status
Not open for further replies.
Top