HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Request

01-04-2004, 07:01 PM#1
zotax
This is fairly complex, so Ill give whoever does it 20 points or something...
Anyway heres what I need, its basically a condition, that determines whether the item (a flag), picked up originally belonged to an ally or an enemy or the player that is picking it up.
I think the condition should be a boolean, what I need is a condition to determine whether the item picked up (flag[something]) belonged to someone who is an ally or an enemy of the hero picking up the item. Im guessing youll have to use some sort of function within the flag variables array number and relate it to the player force number of the picking up hero, which is what I tried to do. The flag variable array number is the player number of the original owner, there are 12 players, 4 teams. 1-3 team 1, 4-6 team 2 etc
As you may have guessed Im doing a ctf type thing, where if someone drops a flag, if an enemy picks it up they score a point, but if an ally picks it up it is returned to its original owner.
01-04-2004, 07:21 PM#2
Scarlet-Russian
[code]
FlagGet
Events
Unit - A unit owned by Player 1 (Red) Acquires an item
Unit - A unit owned by Player 2 (Blue) Acquires an item
Unit - A unit owned by Player 3 (Teal) Acquires an item
Unit - A unit owned by Player 4 (Purple) Acquires an item
Unit - A unit owned by Player 5 (Yellow) Acquires an item
Unit - A unit owned by Player 6 (Orange) Acquires an item
Unit - A unit owned by Player 7 (Green) Acquires an item
Unit - A unit owned by Player 8 (Pink) Acquires an item
Unit - A unit owned by Player 9 (Gray) Acquires an item
Conditions
Or - Any (Conditions) are true
Conditions
(Item carried by (Triggering unit) in slot 1) Equal to FLAG
(Item carried by (Triggering unit) in slot 2) Equal to FLAG
(Item carried by (Triggering unit) in slot 3) Equal to FLAG
(Item carried by (Triggering unit) in slot 4) Equal to FLAG
(Item carried by (Triggering unit) in slot 5) Equal to FLAG
(Item carried by (Triggering unit) in slot 6) Equal to FLAG
Actions
If (((Owner of (Triggering unit)) is an ally of FLAG_PREVIOUS_OWNER) Equal to True) then do (-------- <<TAKE AWAY FLAG AND MOVE FLAG TO POSITION OF WHATEVER>> --------) else do (Set FLAG_PREVIOUS_OWNER = (Owner of (Triggering unit)))
[/code
01-06-2004, 05:35 AM#3
zotax
Edit: nvm, solved it just a few moments after posting:

Code:
For each integer from 1 to 12
If then else
-If
Item type being manipulated=Flag[Integer A]
-Then
-If then else
--If Owner of triggering unit is an ally of player index(integer A)
--Then.....

Why didnt I think of that b4? The amazing powers of loops triumph again!