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

Linking Triggers

broken avatar :(
Created 10 years ago
by RichGaming
0 Members and 1 Guest are viewing this topic.
4,171 views
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 9 November 2013
Last active: 5 years ago
Posts
502
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Custom Zombies Videos: YouTube.com/RichGaming
Signature
YouTube: YouTube.com/RichGaming
Twitter: Twitter.com/RichGaming

×
RichGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
RichGaming's Contact & Social LinksRich_Gamingrichgaming1RichGamingRichGaming1
Hi, I was wondering if there is a way to link triggers to one another within Radiant? I would like one trigger to cause another to be triggered at the same time. If anyone could help that would be awesome! Thanks! :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
Signature
×
liamsa669's Groups
liamsa669's Contact & Social Links
make them have the same targetname and then use this for the script:
Code Snippet
Plaintext
trig = getentarray("TRIGGER_TARGETNAME_HERE","targetname");
for(i=0;i<trig.size;i++)
{
    trig[i] waittill("trigger",player);
    iprintln(player.playername+" has activated trigger "+i); // this is what ever the script is that u want to happen after the trigger is hit
}
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 9 November 2013
Last active: 5 years ago
Posts
502
Respect
Forum Rank
Zombie Enslaver
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Custom Zombies Videos: YouTube.com/RichGaming
×
RichGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
RichGaming's Contact & Social LinksRich_Gamingrichgaming1RichGamingRichGaming1
make them have the same targetname and then use this for the script:
Code Snippet
Plaintext
trig = getentarray("TRIGGER_TARGETNAME_HERE","targetname");
for(i=0;i<trig.size;i++)
{
    trig[i] waittill("trigger",player);
    iprintln(player.playername+" has activated trigger "+i); // this is what ever the script is that u want to happen after the trigger is hit
}

Ok, thanks. Where would I put that script? In what GSC? I want to link my buildable power switch to Harry's perk power switch so my buildable one activated Harry's if you get what I mean?
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
make them have the same targetname and then use this for the script:
Spoiler: click to open...
Code Snippet
Plaintext
trig = getentarray("TRIGGER_TARGETNAME_HERE","targetname");
for(i=0;i<trig.size;i++)
{
    trig[i] waittill("trigger",player);
    iprintln(player.playername+" has activated trigger "+i); // this is what ever the script is that u want to happen after the trigger is hit
}

if im reading it corretly he wants to have multiple triggers that all activate at the same time if one of them gets triggered so that wouldnt be right it would be somthing like this

Code Snippet
Plaintext
// sorry if theres any syntax errors or spacing is off, scripting in the ugx comment box is hard :(

// Initialization
array_thread(GetEntArray("TRIGGER_TARGETNAME", "targetname"), ::trigger_think);

// Trigger think
while(IsDefined(self))
{
      self waittill("trigger", player);
     
      // skip multi notify if was notified from another trigger
      if(IsDefined(self.multi))
      {
            self.multi = undefined;
            continue;
      }

      // normal vaild player checks here / check if we can activate other triggers

      triggers = GetEntArray("TRIGGER_TARGETNAME", "targetname");

      for(i = 0; i < triggers.size; i++)
      {
            if(IsDefined(triggers[i]) && triggers[i] != self && !IsDefined(triggers[i].multi))
            {
                  triggers[i] notify("trigger", player);
                  triggers[i].multi = true;
            }
      }     
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
if im reading it corretly he wants to have multiple triggers that all activate at the same time if one of them gets triggered so that wouldnt be right it would be somthing like this

Code Snippet
Plaintext
// sorry if theres any syntax errors or spacing is off, scripting in the ugx comment box is hard :(

// Initialization
array_thread(GetEntArray("TRIGGER_TARGETNAME", "targetname"), ::trigger_think);

// Trigger think
while(IsDefined(self))
{
      self waittill("trigger", player);
     
      // skip multi notify if was notified from another trigger
      if(IsDefined(self.multi))
      {
            self.multi = undefined;
            continue;
      }

      // normal vaild player checks here / check if we can activate other triggers

      triggers = GetEntArray("TRIGGER_TARGETNAME", "targetname");

      for(i = 0; i < triggers.size; i++)
      {
            if(IsDefined(triggers[i]) && triggers[i] != self && !IsDefined(triggers[i].multi))
            {
                  triggers[i] notify("trigger", player);
                  triggers[i].multi = true;
            }
      }     
}
I know what he ment, but I was assuming he had some knowledge in scripting to know to put another loop to disable the rest of the triggers. I only gave him what he needed
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
What about something like this, to support multiple scenarios?

Code Snippet
Plaintext
//thread MultiTriggers("value", "targetname");
//thread MultiTriggers("other_value", "script_noteworthy");
//etc...
MultiTriggers(value,key){
trigs = GetEntArray( value, key );
array_thread( trigs,::Triggered, value );
}
Triggered(mynotify){
self thread OtherTriggered(mynotify);
self waittill("trigger", player);
self delete();
level notify(mynotify+"triggered");
}
OtherTriggered(mynotify){
level waittill(mynotify + "triggered");
if(IsDefined( self) ) self notify("trigger", level);
}

Not tested, just a theory.
Last Edit: December 14, 2015, 01:20:24 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Well, you need to modify Harrys scripts directly then rather than just adding new code like in above suggestions
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
Well, you need to modify Harrys scripts directly then rather than just adding new code like in above suggestions
spoonfeeding will never teach anyone. we have given him what he needs to make it
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
spoonfeeding will never teach anyone. we have given him what he needs to make it

Did I say 100% what to do? No. And Harrys script probably already has line somewhere to make his thing work. And besides, Rich doesnt know anything about scripting, so based on that much info is going to take him 2 years  :derp:
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Did I say 100% what to do? No. And Harrys script probably already has line somewhere to make his thing work. And besides, Rich doesnt know anything about scripting, so based on that much info is going to take him 2 years  :derp:
Agreed
Spoiler: click to open...
This is like SirJammy all over again :troll:

 
Loading ...