HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

quick question..

02-06-2007, 10:51 PM#1
substance
I'm making a CTF map and right now I have a trigger setup so that if a member of the red team grabs the red flag, he will lose the item and it will be placed where it belongs.

However this is going to cause problems later so my question is, is there any way to make my flag untargetable for players on the red team only?
02-06-2007, 11:26 PM#2
Ammorth
You could make it a unit that whenever another unit walks near it (like in Halo) you can perform the proper actions. Doing this, you can check if the owner of the unit in question belongs to a certain team (hence making it so players on the red team cannot pick it up).
02-06-2007, 11:38 PM#3
substance
Actually I already have a system setup like that. But I want the player to pick up the flag in 2 ways :

-Walking close enough to it
-Right-clicking and grabbing it

Both work now.. but I just dont want the red team to be able to pickup the red flag.

just for the hell of it, here's my code for picking the flag up by getting close to it

Trigger:
Flag Radius Blue
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Set tempug = (Units within 150.00 of (Position of BlueFlagItem))
Collapse Unit Group - Pick every unit in tempug and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Picked unit)) is in RedTeam) Equal to True
((Picked unit) is dead) Equal to False
((Picked unit) has BlueFlagItem) Equal to False
Collapse Then - Actions
Hero - Give BlueFlagItem to (Picked unit)
Collapse Else - Actions
Unit Group - Remove (Picked unit) from tempug
Custom script: call DestroyGroup(udg_tempug)