HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Items and Game Cache

05-28-2005, 11:32 AM#1
Captain Griffen
Anyway to save items directly into a game cache, or will I have to turn it into an integer then back again?
05-28-2005, 11:40 AM#2
divine_peon
i dunno, but what i'm doing is place it in a unit with inventory..
05-28-2005, 12:54 PM#3
Vexorian
Explain more.

You want to save it in a gamecache so you use it on another map? or so you use it on the same map as a part of a system?

For another map: IF it can't be on the unit's inventory, you will have to save the item's type as integer, and the item's charges as another integer.

For your map in a system: Use H2I to type cast the item's pointer to an integer, save the integer and when loading load the integer and typecast it to item
05-28-2005, 03:18 PM#4
Captain Griffen
It's for between maps in a Campaign. It's not too greater problem if I can't, it'd just be easier with how I've got it set up at the moment.

Would it be possible to get the raw data 4 letter name as a string, save that, then change that back into the item?
05-28-2005, 07:13 PM#5
Vexorian
I think I explained, use JASS , GUI sucks , in JASS the ids of items or any objects are just integers so you can save that as an integer and when loading the item you can just use the stored integer directly
05-28-2005, 07:44 PM#6
Captain Griffen
Ah, okay, thanks.
05-29-2005, 08:02 AM#7
Captain Griffen
I'm working with item classes here by the way.

I think I've got it to save the 4 letter string on the item class, but I haven't been able to change that string into an item class variable.

Anyone know how? (keep in mind I know very little about JASS)
05-29-2005, 11:55 AM#8
divine_peon
hmm, i'll use the Item[*string here*] array.

so basically, you load the integer from the cache then create a variable type Item-Type array then set it on map initialization.

ex.
Map init.
Code:
set item[1111]=RingofRegen.

then load the item..
Code:
item-create item[load gamecache integer] in center of region.
05-29-2005, 01:14 PM#9
Captain Griffen
That way wouldn't really work, since I'd have to set out all of the item types before I started on the campaign maps properly, or have to copy every new item across to every map.

So, if anyone knows how to change the 4 letter raw data name for the item type into the item type, I'd be grateful, or I'll just put it into a unit then save that.
05-29-2005, 01:25 PM#10
divine_peon
you only have to do it once. the next time you'll do it are just copy and pastes..
05-29-2005, 03:18 PM#11
Captain Griffen
To 30+ maps.

Every time.