HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

problem with Item Drop Trigger

06-01-2011, 01:50 AM#1
zugzug
Hey all, I have not been able to find the answer to this in the tutorials:

I want to make a random item drop for a unit that does not appear in the game until 20 min. has elapsed.

I have the action: Item-Create (Random Level 7 Artifact) at (position of (triggering unit))

But I cannot do a specific unit event because the unit is not yet on the map to select.

Can I do a generic unit event (a unit dies) and then specify the unit via conditions?

Specifically: How can I specify the triggering unit when it is not being placed in the editor.

Many thanks in advance.
06-01-2011, 07:17 AM#2
Bribe
When the unit is placed on the map, set it to a variable. In the trigger's conditions, simply use a boolean comparison with that unit variable.
06-01-2011, 06:24 PM#3
Anopob
Quote:
Originally Posted by zugzug
Can I do a generic unit event (a unit dies) and then specify the unit via conditions?
You can do it as Bribe suggested, but this method also works. When a generic unit dies if your specific item-dropping unit is only used for that time you can use a unit-type comparison to check if it's that unit. If it is, create the item.
06-02-2011, 12:35 AM#4
Fledermaus
Option one:
Trigger:
Random Item Drop
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Triggering unit) Equal to SomeUnit
Collapse Actions
Set TempPoint = (Position of SomeUnit)
Item - Create (Random level 7 Artifact item-type) at TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
and in whatever trigger you create the unit, you need to do this:
Trigger:
Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Set SomeUnit = (Last created unit)

Then there's option two (which only works if the unit you want to drop the item is the only unit of that type in the game ever):
Trigger:
Random Item Drop
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Footman
Collapse Actions
Set TempPoint = (Position of (Triggering unit))
Item - Create (Random level 7 Artifact item-type) at TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
06-02-2011, 05:11 PM#5
zugzug
Anopob, thanks the unit-type comparison worked beautifully. I am a bit embarassed that I could not find that myself.

Bribe, I may not have been clear: the unit wasnt to be placed on the map but to be created after lapsed time with triggers.

Thx for the quick replies everyone.