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

activating trigger with Time?

broken avatar :(
Created 12 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
2,653 views
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
How do i activate a trigger if all players (in the game) are standing in certain place for 3 mins?
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
you set the trigger to a variable and then have a if statement that says if players[1] players[2] players[3] are touching it then count, else have it stop the countdown time by resetting it and not counting.
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
sorry you to bother you but im a noob at script.

Could you possibly write a script for me?!!?!?!?!?!??!
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
sorry i cant do a timer worth crap. :(
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
thats fine. Do you know any tut which could possibly help me write that script?
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
i dont think anyone has tried scripting something remotely close the this, or at least released it to the public. i guess you could look at tom's time gameplay for a hint to how to do a timer, but the rest is just a simple touchin if statement
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Just something I made really quick. I maybe could of shorten the code but I saw this to be the best way for the code to work.
Code Snippet
Plaintext
//thread Script(); //Maybe level thread

Script()
{
Trig = GetEnt( "ENT", "targetname" );
        CanBreak = undefined;
Play = GetPlayers();
for(;;)
{
if( GetAllPlayersTrig( Trig ) )
{
Time = 0;
for(;;)
{
Time += 1;
if( !GetAllPlayersTrig( Trig ) )
break;
if( Time == 181 )
                                {
                                        CanBreak = true;
                                        break;
                                }
wait 1;
}
}
                if( CanBreak == true )
                       break;
wait .05;
}
        // Code Here
}

GetAllPlayersTrig( Trig )
{
if( IsDefined( GetPlayers()[3] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) && GetPlayers()[2] IsTouching( Trig ) && GetPlayers()[3] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[2] ) && !IsDefined( GetPlayers()[3] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) && GetPlayers()[2] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[1] ) && !IsDefined( GetPlayers()[2] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[0] ) && !IsDefined( GetPlayers()[1] ) )
if( GetPlayers()[0] IsTouching( Trig ) )
return true;
return false;
}
Last Edit: May 23, 2014, 10:10:13 pm by PROxFTW
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Just something I made really quick. I maybe could of shorten the code but I saw this to be the best way for the code to work.
Code Snippet
Plaintext
//thread Script(); //Maybe level thread

Script()
{
Trig = GetEnt( "ENT", "targetname" );
        CanBreak = undefined;
Play = GetPlayers();
for(;;)
{
if( GetAllPlayersTrig( Trig ) )
{
Time = 0;
for(;;)
{
Time += 1;
if( !GetAllPlayersTrig( Trig ) )
break;
if( Time == 181 )
                                {
                                        CanBreak = true;
                                        break;
                                }
wait 1;
}
}
                if( CanBreak == true )
                       break;
wait .05;
}
        // Code Here
}

GetAllPlayersTrig( Trig )
{
if( IsDefined( GetPlayers()[3] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) && GetPlayers()[2] IsTouching( Trig ) && GetPlayers()[3] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[2] ) && !IsDefined( GetPlayers()[3] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) && GetPlayers()[2] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[1] ) && !IsDefined( GetPlayers()[2] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[0] ) && !IsDefined( GetPlayers()[1] ) )
if( GetPlayers()[0] IsTouching( Trig ) )
return true;
return false;
}

ill let you know how it worked ask soon as i put it in my map.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Just something I made really quick. I maybe could of shorten the code but I saw this to be the best way for the code to work.
Code Snippet
Plaintext
//thread Script(); //Maybe level thread

Script()
{
Trig = GetEnt( "ENT", "targetname" );
        CanBreak = undefined;
Play = GetPlayers();
for(;;)
{
if( GetAllPlayersTrig( Trig ) )
{
Time = 0;
for(;;)
{
Time += 1;
if( !GetAllPlayersTrig( Trig ) )
break;
if( Time == 181 )
                                {
                                        CanBreak = true;
                                        break;
                                }
wait 1;
}
}
                if( CanBreak == true )
                       break;
wait .05;
}
        // Code Here
}

GetAllPlayersTrig( Trig )
{
if( IsDefined( GetPlayers()[3] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) && GetPlayers()[2] IsTouching( Trig ) && GetPlayers()[3] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[2] ) && !IsDefined( GetPlayers()[3] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) && GetPlayers()[2] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[1] ) && !IsDefined( GetPlayers()[2] ) )
if( GetPlayers()[0] IsTouching( Trig ) && GetPlayers()[1] IsTouching( Trig ) )
return true;
if( IsDefined( GetPlayers()[0] ) && !IsDefined( GetPlayers()[1] ) )
if( GetPlayers()[0] IsTouching( Trig ) )
return true;
return false;
}

Holy crap man, that second function needs to use a for() loop. So ugly.  :gusta:
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Holy crap man, that second function needs to use a for() loop. So ugly.  :gusta:
Yah I know. However wanted to know because I can't remember if a for loop is used in a if, will the if statements run as 1 big & or multiple if statements.

 
Loading ...