A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Can the possesion of a CTF flag be detected with a script?

Author Topic: Can the possesion of a CTF flag be detected with a script? (3 messages, Page 1 of 1)
Moderators: Dennis

SGWraith
Joined: Apr 15, 2006

[SG] Clan


Posted: Aug 31, 2007 01:56 AM    Msg. 1 of 3       
I'm working on a teleport script for fieldofdeath that will prevent players holding the ctf flag from using it. What I need is a way to detect the flag. I tried this as part of my if statement for player zero:
(and 
(= (volume_test_object redtelebox (list_get (players) 0)) true)
(= (unit_has_weapon (unit (list_get (players) 0)) flag) false)
) ;; End (and


It checks to see if they are in the trigger volume then checks to see if they are holding the flag. The teleport code will only get run if unit_has_weapon statement returns false.

My only problem is this error:
Quote: 08.31.07 00:40:50 [red_tele line 5] this is not a reference to a object_definition tag.: flag) false)


Aparently the flag isn't an object reference despite having a flag.flag tag and a flag.weapon tag in the weapons tag folder...

This should have worked but I'm not sure anymore if the flag even has a valid object_reference name now :/

What are my options here?


Donut
Joined: Sep 30, 2006

I swear I'm not actually dead


Posted: Aug 31, 2007 06:48 PM    Msg. 2 of 3       
AH you need to define the flag weapon. put (= (unit_has_weapon (unit (list_get (players) 0)) "weapons\flag\flag") false)

u might not need the " " around it.


SGWraith
Joined: Apr 15, 2006

[SG] Clan


Posted: Aug 31, 2007 10:45 PM    Msg. 3 of 3       
I actually got it working with Donuts script line change. That global would be nice for shortening the code though.

Thanks guys, this is really cool. Now I can better simulate H2 gametypes and a few other things. :)

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 11:05 AM 110 ms.
A Halo Maps Website