HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

CBS Game Cache

07-31-2008, 06:41 PM#1
Flame_Phoenix
Hi as some of you know, I am making a bag system called CBS for a campaign.
However, I have a real problem, There is no way of storing items into cache and then having them back in the next chapter !!!

Is there a way for me to store all items of an "Item Array" into the cache and then restore them to the game in the next level of a campaign ??
Toadcop how did you do it man! =P
Plz if you help you all get +rep !!
07-31-2008, 07:18 PM#2
Captain Griffen
Yes there is.

Store the ID and the charges for each inventory slot, or whatever the hell you want.
07-31-2008, 08:00 PM#3
Flame_Phoenix
Quote:
Yes there is.

Store the ID and the charges for each inventory slot, or whatever the hell you want.
How do I know if an Item is chargeable ?
07-31-2008, 08:06 PM#4
Here-b-Trollz
It doesn't matter. If it has 0 charges, then it will get 0 charges. If it has 999, it will get 999.
07-31-2008, 08:28 PM#5
Flame_Phoenix
If I store the ID, it will be like Creating a new Item, and I will lost the charges of the items ... is there a better way ?
07-31-2008, 09:56 PM#6
TEC_Ghost
Dude, lol he just said STORE the charges so you can reset them on load.
07-31-2008, 10:01 PM#7
Flame_Phoenix
Quote:
Dude, lol he just said STORE the charges so you can reset them on load.
Again, I ask, How do I know if an Item is chargeable (if is not permanent per example) and how many charges it has ?
That Way I will need two variables =S
07-31-2008, 10:08 PM#8
Captain Griffen
Quote:
Originally Posted by Flame_Phoenix
Again, I ask, How do I know if an Item is chargeable (if is not permanent per example) and how many charges it has ?
That Way I will need two variables =S

You don't need to.
07-31-2008, 10:12 PM#9
Themerion
Quote:
Originally Posted by Here-be-Trollz
It doesn't matter. If it has 0 charges, then it will get 0 charges. If it has 999, it will get 999.

So: Setting charges for a non-chargeable item will do nothing. The item will be like before (non-charged). You can simply treat all items as if they were charged. So...

Quote:
Originally Posted by Captain_Griffen
You don't need to [know if the item is charged or not]

... because it doesn't matter.
07-31-2008, 11:48 PM#10
Pytho
Quote:
Originally Posted by Flame_Phoenix
Again, I ask, How do I know [...] how many charges it has ?
Collapse JASS:
native          GetItemCharges  takes item whichItem returns integer
native          SetItemCharges  takes item whichItem, integer charges returns nothing
08-01-2008, 08:10 AM#11
Toadcop
in my case i simply save cache to harddrive and thats it =) and you have unique ID for anything between any map... it's like own scope for campaign.
08-01-2008, 08:29 AM#12
Flame_Phoenix
Quote:
in my case i simply save cache to harddrive and thats it =) and you have unique ID for anything between any map... it's like own scope for campaign.
Oh dear God Of heaven ...
Ok guys, thx for clearing my mind up, I will soon post something =D