HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

ideas for scripting an equip system

04-29-2006, 06:20 PM#1
Linera
I am hoping some people can help come up with ideas for a 20 slot equip system.

what i mean by this is a system that has 20 slots to be able to equip 20 different things like Head, neck, chest, etc.
04-29-2006, 06:29 PM#2
Captain Griffen
If all of the effects the items could do were done via triggers (such as using abilities in disabled spellbooks, abilities in a non-disabled spellbook that you disable/enable when the item is picked up for non-passives, etc.), then you could make a system like that using an item array to store them when they pick them up and add the effects, then remove those effects when they find some other armour and add the effects for that. You could display the items carried in a multiboard, or something (maybe in a spellbook?).
04-29-2006, 06:35 PM#3
Linera
I'm already using a multiboard to display hero stats and resistance and stuff.
04-29-2006, 07:26 PM#4
paidan_fain
Well, I am currently working on an equip system that might solve your problem. Considering I have Finals and AP Exams coming up, it won't be released until after graduation. Though you should be able to do it with no trouble yourself:

I use a filter to create a Gui around the hero icons to the left. The 5 there are for head, arm, body, leg, and attachment. The very top one is for the actual hero and is outside of the GUI. To change a part, the user would click on it and a series of buttons on the command card appear. The buttons are based off of channel and any items the user picks up a put into the approaite item slot. Then the user just clicks an ability and poof, it is "activated'.
04-29-2006, 08:43 PM#5
Linera
well for my map I need about 18 different slots:
  • Head
  • Neck
  • Chest
  • Back
  • Feet
  • Wrist
  • Waist
  • Legs
  • Shoulder
  • Hands
  • 2 Trinkets
  • 2 Rings
  • Main Hand
  • Off Hand
  • Range Weapon
  • Ammo

Optional :
  • Tabard
  • Shirt
04-29-2006, 09:33 PM#6
FatalError
This might help. :)
04-30-2006, 02:52 AM#7
Linera
I'll give this a shot.

If this works you'll get rep.

Post 2:

Well that one by Vex is not gonna work for me. its hard to use in game.

Edited by Blade.dk. Reason: Double post...
04-30-2006, 08:41 AM#8
Captain Griffen
You could do what I suggested, and display it using additional heroes (put the abilities in the inventory spaces of the heroes). 3 of them would give you 18 slots, and then you can give the attribute increases to the hero with abilities.
04-30-2006, 10:36 AM#9
karukef
Ignoring the question how you think an 18-slot inventory system is going to make any kind of war3 map better, here is one the approach I am using.

First, I implemented all possible item bonuses as a global set of abilities. (Example, if a user equips an item that adds 10 armor, I will set the levels of 4 +armor abilities to reflect the updated amount of armor for the player).

Second, I implemented a system of assigning stats to any kind of ability. I do this by having a list of semi-colon delimited strings in the abilities' AoE effect field, such as "armor;10", "movespeed;30". Then I made a parser and a global system for adding all such stats when an ability is added to/removed from units. (Actually, my system is even more advanced with datasets and multiple values and levels for each stat).

Thirdly, whenever an item is equipped, I put it into a spellbook. A spellbook has 11 possible spaces, so you can have that many items. Or 22 if you use two spellbooks. I found 6 to cover my needs for head, amulet, left arm, right arm, body and feet. Putting icons like this into spellbooks is extremely difficult, and requires for example that you, during the initialization of the map, make sure that every single item-ability is loaded in the exact order in which they should appear in the spellbook, and also loading "empty" icon-abilities in the correct order in-between. Each item needs a total of 3 objects: The item you buy, the dummy-ability which shows the icon in a spellbook, and an individual spellbook that adds the dummy-ability to the main spellbook.

Having all this in place, good luck figuring out how to sell the items. I can base all my dummy-abilities on autocastable spells and sell the item on a detected right-click. There are however only 8 no-target autocastable spells that doesn't share base-order id, so then you'd have to start using autocastable spells that can be targeted, meaning if someone clicks an item they will get a "target" cursor even if that item does nothing.

So there you have it, only a few simple steps to create an item system that integrates into the normal war3 interface. It took me a month to make, but since you are so ambitious that you want to make a 20-slot system I bet you are a really amazing mapper and can do it in a week. ;)

Or, maybe you could realize that having large inventories in war3 is like riding around on a dog; it can be done.. but.. :)
04-30-2006, 05:39 PM#10
FatalError
That was...uh...long :D
That would be a good system, but it would take forever to write (not really, but let's pretend we don't have much time), and I don't think it's worth it.

How about not even using items? Just make the items into dummy items, and when you pick them up, you get the bonus. Then, like karukef said, maybe add the icons into a spell-book so you know what items you have. It wouldn't be that hard, and you wouldn't really have any limits (besides those set by spellbooks).
04-30-2006, 10:21 PM#11
Linera
one problem with using a spell book to show equipped items in that you have to add every possible equipable item to the spell book before hand in the editor as there is no way to add a spell to a spellbook ingame. and my game will have more items then i can count.
04-30-2006, 10:25 PM#12
Blade.dk
You're wrong. http://www.wc3campaigns.net/showthread.php?t=80186.