UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

trigger help

broken avatar :(
Created 11 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
1,883 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
ok so i'm wondering if it is possible to use a trigger_radius or a trigger_multiple to activate a zone.



on each of the 4 corners is a player spawn and it is boxed in. now the problem is that each of the four corners has its own zone. there are no spawners inside of these zones. the zones act as a stop gap for the top of the box. when you buy the debris on the floor you enter a zone that is not adjacent to the initial zone and so zombies don't spawn up there. but since the zone that you spawn in isn't attached to a debris. it isn't activating and the zombies just stand there. now i know it works when you don't start in the initial zone because i set it up so that you bought a debris at the start. and that activated the zone. but that didn't seem very professional looking and was kind of pointless. so now i need a way to activate the zone at the very start of the map without the use of a pointless debris in the middle of the box. and any other ways to this without my way are completely open.

Double Post Merge: July 09, 2015, 11:42:06 pm
http://imgur.com/yEYGQO9
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 5 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
if you set up your adjacent zones like you did when you had the debris activating the zone, and then instead of making a debris in radiant just have a script that says
Code Snippet
Plaintext
                 flag_set("whatever_your_flag_is"); 
and that will activate the zone just like buying a debris but without actually having a debris in radiant

if you want to do it by if a player is touching a certain trigger_multiple then you can do this
Code Snippet
Plaintext
        players = get_players();
        trig = getEnt("trig_name","targetname");
        for(i = 0; i < players.size; i++)
        {
                  if(players[i] isTouching(trig))
                  {
                           flag_set("whatever_your_flag_is");
                           trig delete(); //the trigger has been touched no need to keep it anymore
                           return; //since someone is touching it no need to continue
                   }
          }

i hope that helps :)
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
where would i put these scripts

Double Post Merge: July 10, 2015, 12:44:17 am
i hope that helps :)
would i add this to my mapname.gsc and if so where. or do i make a new .gsc
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 5 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
where would i put these scripts

Double Post Merge: July 10, 2015, 12:44:17 am
would i add this to my mapname.gsc and if so where. or do i make a new .gsc

put all of this in your mapname.gsc

put this before zombiemode::main(); call
Code Snippet
Plaintext
        thread intro_trig();
 

and then put this at the bottom of your mapname.gsc

Code Snippet
Plaintext
intro_trig()
{
           flag_init("whatever_your_flag_is");
           flag_wait("all_players_connected");
           trig = getEntArray("trig_name","targetname");
           players = get_players();
           while(1)
           {
                   for(i = 0; i < players.size; i++)
                   {
                         for(k = 0; k < trig.size; k++)
                         {
                               if(players[i] isTouching(trig[k]))
                              {
                                     flag_set("whatever_your_flag_is");
                                     trig delete(); //the trigger has been touched no need to keep it anymore
                                     return; //since someone is touching it no need to continue
                              }
                         }
                   }
           }
}

you could also do it by using a using a trigger_touch instead of a trigger_multiple

 
Loading ...