UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: worstgabena on April 28, 2017, 03:16:16 am

Title: Two triggers in one
Post by: worstgabena on April 28, 2017, 03:16:16 am
Is there a way to have one trigger that has two different target names. Or maybe have like a "targetname_2" or something as a key that would function like a regular "targetname"
Title: Re: Two triggers in one
Post by: BluntStuffy on April 28, 2017, 04:06:49 pm
You could use the script_noteworthy KVP for example ( and WaW also has script_string, so BO3 prob as well.. )

Code Snippet
Plaintext
targetname             -    vending_trigger
script_noteworthy    -    perk_quickrevive
Title: Re: Two triggers in one
Post by: worstgabena on April 28, 2017, 04:22:41 pm
Would I get an ent through the same method as a target name?
Code Snippet
Plaintext
trig = getent("name", "script_noteworthy")
Title: Re: Two triggers in one
Post by: BluntStuffy on April 28, 2017, 04:37:01 pm
Yes, you can simply get an ent by it's script_noteworthy. Or get the array of the targetnames and 'filter' them out: (whatever works best for your situation )

Code Snippet
Plaintext
all_triggers = getentarray( "vending_trigger", "targetname" );
for( i=0 ; i<all_triggers.size ; i++ )
{
    if( all_triggers[i].script_noteworthy == "trigger1" )
    {
         // do stuff
    }
    else if( all_triggers[i].script_noteworthy == "trigger2" )
    {
         // do other stuff
    }

    else
    {
          // more stuff
    }
}
Title: Re: Two triggers in one
Post by: worstgabena on April 28, 2017, 04:39:10 pm
Cool, thanks :)