HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Checking Region for unit

06-21-2004, 11:14 PM#1
DisabledJew
Ok, I am trying to make it so that if you own a certain unit in a region, it creates a certain item on the hero. The first trigger I used for this didn't require the unit, the unit in the region is a symbol that it needs to upgrade the item given to the unit spawned

Events
Time - Elapsed game time is 0.10 seconds
Conditions
(Unit-type of (Triggering unit)) Equal to Marine
(Item carried by (Last created unit) in slot 1) Not equal to (Matching item)
Actions
Hero - Create Automatic Pistol and give it to (Last created unit)

Now, I also have a problem with this, I need it to make sure that the Unit is not already carrying the item, I tried this with the 2nd condition but not sure if it will work.

Back to the first thing, You can buy an upgrade at a shop, which creates a certain box at the region, the box signals which weapon your supposed to spawn with. I got this down, The upgrade is chargeable, so when Unit uses Item Upgrade 1, create box level 1 in region. Now I need the trigger that checks if the box is there, and if it is, then disable the first trigger, and give him the level 2 weapon.

If you need more explanation just ask.

Thanks for any help
06-22-2004, 02:27 PM#2
FrostCyrus
Just use two if/then/else actions for your second problem.
One to check if he does have the item (then do other actions)
The Second to check if he doesn't have the item (Then do other actions)

As for the other stuff, try locking on to the unit you want to mess around with. You know, instead of 'last created unit', set the unit to a variable or use triggering unit or whatever to make sure you're messing with the unit you wanna mess with.
06-22-2004, 03:06 PM#3
th15
Your event is a time-based event.

Your condition checks for triggering player. There is no triggering player. Trigger conditions (not if-else conditions) ALWAYS need to refer to the event. That is why all the references (such as "triggering player") are all called Event response- ... They MUST refer to the correct thing in the event.

The end result is that your trigger NEVER actually runs because its conditions can NEVER be true.
06-23-2004, 06:32 AM#4
ChaosWolfs
Quote:
Originally Posted by AnusLazer
Ok, I am trying to make it so that if you own a certain unit in a region, it creates a certain item on the hero. The first trigger I used for this didn't require the unit, the unit in the region is a symbol that it needs to upgrade the item given to the unit spawned

Events
Unit - Unit Enters region PistolRegion
Conditions
(Unit-type of (Entering Unit)) Equal to Marine
(Item carried by (Entering Unit) in slot 1) Not equal to (Matching item)
Boolean - UnitGotPistol(Owner of Entering Unit) equal to false
Actions
Hero - Create Automatic Pistol and give it to (Entering Unit)
Set UnitGotPistol(owner of entering unit) = true

Now, I also have a problem with this, I need it to make sure that the Unit is not already carrying the item, I tried this with the 2nd condition but not sure if it will work.

Back to the first thing, You can buy an upgrade at a shop, which creates a certain box at the region, the box signals which weapon your supposed to spawn with. I got this down, The upgrade is chargeable, so when Unit uses Item Upgrade 1, create box level 1 in region. Now I need the trigger that checks if the box is there, and if it is, then disable the first trigger, and give him the level 2 weapon.

If you need more explanation just ask.

Thanks for any help
fixed......