• 🏆 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!

[JASS] ItemPool tied to trigger created units.

Status
Not open for further replies.
Level 13
Joined
Jul 26, 2008
Messages
1,009
Hi I'm making an ORPG. For my spawn system I'm using JohnNy's in the spell section. Anyways, I'm trying to use the Itempool and tie them to the units spawned by this.

However, I can't figure it out since the example map I found uses units and the spawn system uses integers. I'm sure itempools can be tied to spawned units, just not sure how. My JASS and triggering is still rusty.

Could someone point me to a tutorial or tell me how this is done?
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
I know this is a really simple question to answer, but how do I make sure that the right item is created for that dying unit.

Right now the only example I can find shows me how to make items drop on unit death with no differentation between what unit is dying. If a Naga Siren drops, I want it to drop Naga scales, and if a Wolf dies I want it to drop Wolf pelts.

This is normally done using arrays on global variables, but I feel it'd be a lot simpler to use ItemPools. However, I can't find squat for a detailed itempool example and how to properly utelize it for an RPG. :(
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Experiment with them until you get a feeling of their functionality. That is the only real way as "book learning" will only take you so far.

A little hint I found was to break the problem down into different areas and think of the code needed to solve each are.

For example you will need multiple itempools for each drop class, so a system to handle that would be a good idea (itempool array global).

Next you want that from a unit type, you can recall a specific item pool. as unit types are integers, a hashtable may be good for this as you could then ave a reference to an itempool to a unit type.

Thus finally you write your death action trigger than on death, from the unit type gets the itempool and then orders an item to be made from it at the dieing position.

Its all in planning a solution to a problem and not trying to put code which fits the solution as you go.
 
Status
Not open for further replies.
Top