HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Drag and Drop Object Oriented Backpack

01-23-2004, 09:59 PM#1
weaaddar
http://weaaddar.wc3campaigns.com/bagdemo.w3x

I have made a new little invention for warcraft III. A drag and drop backpack that keeps a count of how many items are in it for you. The best part is you can drop it and trade it to another hero and he can access those items.

Actually the best part is it uses no global variables and has two classes in it:

There are two object-types I create. The Herostr object and the backpack object. They are created automatically so the user doesn't have to do anything,

The BP object consist of an instance identifier of its handle, and an array of item ids the size of the constant Itemlimit().

The Herostr object consists on three instance identifier handles, one for the unit you passed it and two for the dummy units it creates required for the triangle swap method. Its other instance Identifiers include it's current state
the bp object it owns, and the bp objects position.

Because the BP object is seperate of the herostr I can allow you to swap backpacks and still retain unique arrays of private items stored.

As far as the rest of the stuff it was basically just a port of some of the methods from DT4A to this map, the drag and drop was just too cool not to use. And war3 has already a counter on items so why not use it?

The comments are sparse and I'm sorry but unlike DT4A this was not some culminating project of experience but a simple tech demo to test the game cache.

NOTES:
Should work with everything.
Edit: fixed link
01-24-2004, 01:42 AM#2
311
I added +15 claws and junk just to see if it would work, it dont know your +stats so its kinda usless in my case :(. Your other demo does but I dont like the setup of that ome like the icon that you click to see your bag, and the submerge ability as no item and switching items off and on is weird. If you want the coolest thing ever possbile can you make it like backpack how it now but be able to know your +stats and stuff. I would be so so so so happy if you could
01-24-2004, 01:52 AM#3
weaaddar
You do realize you can custom your item you chose for no item right?

I just chose the first item I can find with a down arrow in it.

DT4A is a very complicated system, this was just a simple tech demo. DT4A is like a real rpg with equiping items, this was just something I threw together to test object oriented jass. Its only meant to store items not to save there bonuses.

DT4A is for equiping and retain bonuses, this is just for plain storage.
01-24-2004, 02:01 AM#4
311
ya I know I could change icon for the "no item" but theres no good icon I could think of. I cant use DT4a because of the icon you use for the items, all my heros in my rpg have 6skills so I dont have room for it. I love the new backpack idea its so easy to use see and do anything with, I just REALLY want it to store +stats. The dt4a 1of each item type and clicking that little icon is just not my style. Well I got to ask will you ever combine them? Or is that to much work? or just not worth your time?
01-24-2004, 02:22 AM#5
weaaddar
Its an addenduem to DT4a, but I doubt they'll work together. They both rely on heavy control and data handling of hero states. (I'm checking basically every item related event you do to do that oh so awesome drag and dropability).


As far as making this have dt4a datatable or use X definations instead of blizzard style defs, never going to happen. They may work together, but I really wouldn't know, so i'll say they might.

This is what DT4a should of been coded with had the method been known but its too late for me just to swap everything to be real OO in DT4a...
01-24-2004, 04:19 AM#6
Narwanza
weaaddar, you are a genius. This is a great tool. BTW, does it have a limit on number of items it can hold?
01-24-2004, 04:31 AM#7
weaaddar
Limit is set by the constant function ItemLimit()

Its modifyable but it must be a number greater then or equal to 4 and divisible by 4, or else it won't work right.

And thank you.
01-24-2004, 05:32 PM#8
renao
Man, your invetory system is great! I'm dying to put it into my campaign, but the WE crashes every time I try to see the triggers you've made.
01-24-2004, 06:41 PM#9
weaaddar
Well I've heard conflicts with certain jass functions if you are using a worldedit no-cd crack or if you are using a custom editor.

I'd suggest avoiding the latter like the plague, But here is a link where you can see the code:
http://kattana.users.whitehat.dk/viewfunc.php?id=223
01-25-2004, 05:41 PM#10
weaaddar
Another updated version see the original link to get it. Should now fully work with targetting items. (good stuff).
01-26-2004, 04:11 AM#11
Modmaker2004
I had a problum with this. I was going to use this is my rpg map im making were halfway through and i copyed the triggers and then it said varibles problums when you save. So i typed all that code out. Same thing. Could it be because of the new patch? (of course i give you credit in map) Also i like the backpack ^_^.
01-26-2004, 02:03 PM#12
weaaddar
did you copy everything in the header section of the map?
you do need the latest version.
01-26-2004, 08:05 PM#13
Modmaker2004
What i did was copy the folder. Then every one after that since it didnt work. I also copy-ed the items and put them on my item list. Do i have to copy the ones on the grounds to work. I also download the top link since i did not seen any latly version links.
01-26-2004, 08:14 PM#14
weaaddar
In the trigger editor tree above the folder you'll see the map (bagdemo.w3x) click that. In there is a bunch of functions you have to copy as well.
Move those to your map as well. that should fix it. You'll need to update the codes to those of your items but I think you can do that.
01-26-2004, 08:17 PM#15
Modmaker2004
Ill try in a sec ill edit this to tell u if works or not.
Edit: Could i make this a new trigger on Instalation?
Saved worked ^_^ now to test
--------------------------------
Im knda new to jag can u tell me where to edit the items?
I know how to make the items into jass but i cant find in the trig where to edit them into the trig so they work. WHAT TRIG!! 0.o