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

Help with door. Shoot 3 objects to open.

broken avatar :(
Created 11 years ago
by Wild_LD
0 Members and 1 Guest are viewing this topic.
2,141 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 7 January 2015
Last active: 8 years ago
Posts
87
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
---{ AGC's Releases }---
AGC's Black Ops 2 Shader Pack! - http://modme.co/index.php?view=topic&tid=629
AGC's Origins Hud! - http://modme.co/index.php?view=topic&tid=1022

---{ AGC's Tutorials }---
Fix Custom Weapons Not Going Into The Box! - http://modme.co/index.php?view=topic&tid=696
×
Wild_LD's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Hey, so on my map I have an area for PaP but I want to have it so the door can't be bought, instead you shoot 3 objects and it opens. Could anyone tell me how or link me to a tutorial? I was looking for it to be so when you shoot it you would get an audio notification and maybe text on the screen. If anyone could help that would be great. I don't know if i'm just bad at searching but I can't find a tutorial xD
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
The code can be better but it works.
You have to cover every object with a trigger_damage.
And here's the code (you have to thread the first function before).
Code Snippet
Plaintext
WHATEVER_YOU_WANT_TO_NAME_THE_FUNCTION() {
    trig = getEnt( "DOOR_TARGETNAME","target" );
    objects = getEntArray( "TRIGGER_DAMAGE_TARGETNAME","targetname" );
    level.objectsShot = 0;
    trig trigger_off();

    array_thread( objects,::trigWait );

    while( level.objectsShot < objects.size ) {
        wait(0.5);
        continue;
    }
   
    trig trigger_on();
}

Code Snippet
Plaintext
trigWait() {
    self waittill( "trigger" );   
    self playSound( "SOUNDALIAS_YOU_WANT_TO_PLAY","TEXT_YOU_WANT_TO_DISPLAY" );
    iprintln( "TEXT_YOU_WANT_TO_DISPLAY" );
    level.objectsShot++;
}
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
The code can be better but it works.
You have to cover every object with a trigger_damage.
And here's the code (you have to thread the first function before).
Code Snippet
Plaintext
WHATEVER_YOU_WANT_TO_NAME_THE_FUNCTION() {
    trig = getEnt( "DOOR_TARGETNAME","target" );
    objects = getEntArray( "TRIGGER_DAMAGE_TARGETNAME","targetname" );
    level.objectsShot = 0;
    trig trigger_off();

    array_thread( objects,::trigWait );

    while( level.objectsShot < objects.size ) {
        wait(0.5);
        continue;
    }
   
    trig trigger_on();
}

Code Snippet
Plaintext
trigWait() {
    self waittill( "trigger" );   
    self playSound( "SOUNDALIAS_YOU_WANT_TO_PLAY","TEXT_YOU_WANT_TO_DISPLAY" );
    iprintln( "TEXT_YOU_WANT_TO_DISPLAY" );
    level.objectsShot++;
}

It's an interesting method, using trigger_off, I like it, except for the while loop.

Did you test it in a map with multiple doors and see if it still worked without more scripting? I ask cause you use "target" instead of "targetname", but that could be a typo. Then the targetname of the trig would be either zombie_door, which would break the script with more than one door in the map, or you made it a custom targetname, which would require more scripting to connectpaths on the door and move the door after trigger. You could set up the door to be the target of that trig you are using and add another function to complete this, imo.

If he just wants the door to move after shooting these, you won't need the trigger_off stuff of course, but will still need that other connectpaths, and door move code.
Last Edit: September 16, 2015, 03:48:09 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
It's an interesting method, using trigger_off, I like it, except for the while loop.
I tried with flag_wait and with no loop but, I don't know why, the game stopped at this point for a few seconds.
I'm just learning this kind of scripts and I don't know any way to stop the code until the variable has that value lol.

Did you test it in a map with multiple doors and see if it still worked without more scripting? I ask cause you use "target" instead of "targetname", but that could be a typo.
This code is similar to the one I used for my map, so it might work.
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
×
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
I tried with flag_wait and with no loop but, I don't know why, the game stopped at this point for a few seconds.
I'm just learning this kind of scripts and I don't know any way to stop the code until the variable has that value lol.
This code is similar to the one I used for my map, so it might work.

Cool. You don't actually have to stop the code. You can let it run. Remove the check from the fist function. Then in the function that increments the var, put the check there, after that. If they shoot them all, now do this...blah I subtract myself and use <= 0 instead, and I use an level array to store the size of each ee, but your way will work too if you pass the size into the function that you add the if check too.

Last Edit: September 16, 2015, 04:05:08 pm by MakeCents

 
Loading ...