HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item question

07-05-2006, 09:10 AM#1
Azhag
I know this is probably a basic question.
But how do I make it so when my peasant kills a destructible, it will have a "Bundle of lumber" added to its inventory, which is only one space. But I want it to be global. So if anyones peasant attacks it, it will add the lumber to thier inventory as well. All players will be able to have peasants.

Also what will happen if the one space is full, and the peasant kills another destructible? Will it just not add it, or just place it on the ground, or have an error?
07-05-2006, 09:45 AM#2
aquilla
I'm not sure if this will work as there might not be a triggering unit, so you'll have to try it >:)
Trigger:
Untitled Trigger 001
Collapse Events
Destructible - A destructible within (Playable map area) dies
Collapse Conditions
(Destructible-type of (Dying destructible)) Equal to Summer Tree Wall
Collapse Actions
Hero - Create Bundle of Lumber and give it to (Triggering unit)
If the peasant has only one slot and it is occupied, nothing will happen. Unless the Bundle of Lumber is used when acquired...
07-05-2006, 09:49 AM#3
Azhag
Sorry, I've tried that, it doesn't work.

There is no target unit in the event of that trigger. It is a genertic event, saying a destructible has died, not was targeted by a unit.
07-05-2006, 04:53 PM#4
dvdgstwrt
Quote:
Originally Posted by Azhag
Sorry, I've tried that, it doesn't work.

There is no target unit in the event of that trigger. It is a genertic event, saying a destructible has died, not was targeted by a unit.

Add
Conditions
(Unit-type of (Killing unit)) Equal to Peasant

Um for ease of finding it is a 'unit type comparasion'.

The Target in your conditions: Summer Tree Wall.

If you have more than one kind of tree, then you will need to use the OR condition (Most likely multiple conditions)

Trigger:
Conditions
(Unit-type of (Killing unit)) Equal to Peasant
Collapse Or - Any (Conditions) are true
Conditions
(Destructible-type of (Dying destructible)) Equal to Summer Tree Wall
(Destructible-type of (Dying destructible)) Equal to Ashenvale Tree Wall

Since I do not know what kind of trees you have used - click on "Summer Tree Wall" At the bottom of the pop-up you will have Value followed by a string for the tile set (Ashenvale, Barrens, blah) followed by the destructable type from that tile set.

Unless you have other units that can destroy/kill trees you might not need the condition "Unit type/peasant" (or how ever it is worded exactly.
07-05-2006, 05:02 PM#5
Undead_Lives
Or you could do it the non-trigger way.
Select all of the trees you want to do this (most likely every single one) and then double click. In the window under "Items Dropped" just select Bundle of Lumber, and that's how your peasants can pick it up.
Also note that your peasants actually need to have slots. They don't start out by being able to pick up items.
07-05-2006, 05:38 PM#6
Alevice
Quote:
Originally Posted by Undead_Lives
Or you could do it the non-trigger way.
Select all of the trees you want to do this (most likely every single one) and then double click. In the window under "Items Dropped" just select Bundle of Lumber, and that's how your peasants can pick it up.
Also note that your peasants actually need to have slots. They don't start out by being able to pick up items.

You'lll need to modify bundle of lumber to not be autocasted when it is picked up.
07-05-2006, 06:30 PM#7
aquilla
Quote:
Originally Posted by Undead_Lives
Or you could do it the non-trigger way.
Select all of the trees you want to do this (most likely every single one) and then double click. In the window under "Items Dropped" just select Bundle of Lumber, and that's how your peasants can pick it up.
or you could create it where the destructable has died, but he wanted it to be given to the unit
07-05-2006, 06:33 PM#8
Undead_Lives
Quote:
Originally Posted by aquilla
or you could create it where the destructable has died
That's what he's asking for, and that's what my way does.
And bundles of lumber are automatically used, the can't exactly be given to someone. They are like a rune. You never have them in your inventory.
07-05-2006, 07:23 PM#9
Azhag
Undead_Lives, Sorry for the lack of explanation on my part.

First thing, the tree gets ressurected after it has been killed, so it can be attacked again.

Second thing, the bundle of lumber I said, was just for the icon look. The actualy item will do absolutly nothing. So I want it to be put into the units inventory. So again, I want it to be put into the peasants inventory after he has killed the tree.

I also have a another question, how do you make a destructible invulerable, without the use of triggers?

Sorry if I have so many questions.
07-06-2006, 09:12 PM#10
Azhag
bump.
07-06-2006, 09:43 PM#11
MercyfulJester
I myself once tried to achieve this, but the "Destructible Dies" -event counts only 64 first destructibles in a region, so you'd have to create a huge load of regions and triggers to pull this off.
07-06-2006, 09:48 PM#12
Azhag
There is only 4 Tree's that activate this trigger.
07-07-2006, 12:30 AM#13
Anopob
I got it.

Trigger:
Tree
Collapse Events
Destructible - Summer Tree Wall 0000 <gen> dies
Conditions
Collapse Actions
Item - Create Ironwood Branch at (Position of (Dying destructible))
Hero - Give (Last created item) to (Random unit from (Units within 200.00 of (Position of (Dying destructible)) matching ((Unit-type of (Matching unit)) Equal to Peasant)))

Make sure that the peasant has an inventory. Oh and since you said "4" trees activate this trigger, the event should be a specific destructible. And Ironwood Branch because you said it doesn't "do" anything.
07-07-2006, 05:56 AM#14
TaintedReality
There seems to be no easy way to find the Peasant who killed the tree. Killing Unit and Triggering Unit return nothing. So, the best I could see is just giving it to the closest peasant, or leaving it on the ground. Or, if you wanted it to be perfect, you could get a whole system going where you check when a Peasant attacks a tree (can you even detect that?), and just store a handle variable to the tree of which Peasant harvested it last.