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

Power Puzzle Connection attempt (failing)

HOT
broken avatar :(
Created 12 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
6,243 views
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
ohh copy this 
Code Snippet
Plaintext
power_switch_trig = getEnt("turn_power_on", "targetname");
and paste it above
Code Snippet
Plaintext
power_switch_trig enable_trigger();
sorry forgot that wasnt a varable that carried over
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.
ohh copy this 
Code Snippet
Plaintext
power_switch_trig = getEnt("turn_power_on", "targetname");
and paste it above
Code Snippet
Plaintext
power_switch_trig enable_trigger();
sorry forgot that wasnt a varable that carried over

got another error;

broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
got another error;

(Image removed from quote.)
another thing i forgot to mention... u need to add this to the top of the file
Code Snippet
Plaintext
#include maps\_hud_util;
make sure u have level.connection = 0; cuz i added that in an update a few minutes after i added the code
Last Edit: July 25, 2014, 11:49:31 pm by n123q45
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.
another thing i forgot to mention... u need to add this to the top of the file
Code Snippet
Plaintext
#include maps\_hud_util;
make sure u have level.connection = 0; cuz i added that in an update a few minutes after i added the code



thanks for making the script for me really appreciate it
Last Edit: July 25, 2014, 11:56:11 pm by pashan
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
lol i mispelled the function name. sorry for all the trouble
Last Edit: July 26, 2014, 12:05:43 am by n123q45
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.
lol i mispelled the function name. sorry for all the trouble

????? uh what do i change? i don't see any mispells
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
the 2nd function name is misspelled. change it to power_thinking(){
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.
the 2nd function name is misspelled. change it to power_thinking(){

ahh.. teh script doesn't work.

when i go to the power for teh first time the power gets turned on and and this loading bar comes i teh player get stuck there foreever.

broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
Code Snippet
Plaintext
#include maps\_hud_util;


power_job()
{
power_switch_trig = getEnt("turn_power_on", "targetname");
power_switch_trig disable_trigger();
level.disable_trigger_power = true;

power = getEnt("use_power_switch", "targetname");
power SetCursorHint( "HINT_NOICON" );
start = getEnt("power_notify", "targetname");
start SetCursorHint( "HINT_NOICON" );
con = getEnt("con", "targetname");
con SetCursorHint( "HINT_NOICON" );

thread power_thinking(power, "Press and Hold &&1 To Attempt The Puzzle");
thread power_thinking(start, "Press and Hold &&1 To Attempt The Puzzle");
thread power_thinking(con, "Press and Hold &&1 To Attempt The Puzzle");
}

power_thinking(trigger, hint){
for(;;){
if(level.connection < 4 - 1){ // makes sure itll be 3
if(level.connection == 3 - 1 && level.disable_trigger_power == true){
trigger SetHintString("Press and Hold &&1 To Solve The Puzzle");
} else {
trigger SetHintString(hint);
}
trigger waittill("trigger", player);
player disableWeapons();
player freezeControls(true);
done_time = 4.5;
time = 0;
bar = player createPrimaryProgressBar();
bar updateBar( 0.01, 1 / done_time );
bar.color = ( .5, 1, 1 );
while(player useButtonPressed()){
wait(.5);
time++;
//play_sound_at_pos("", trig);
if ( player maps\_laststand::player_is_in_laststand()){
break;
}
if(time - .5 >= done_time ){
level.connection++;
trigger delete();
bar destroyElem();
break;
}
wait(.5);
}
} else {
level.disable_trigger_power = false;
power_switch_trig = getEnt("turn_power_on", "targetname");
power_switch_trig enable_trigger();
}
}
}
Last Edit: July 26, 2014, 12:48:06 am by n123q45
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.
Hoping this is what you want.
In dlc3_code.gsc find the function
Code Snippet
Plaintext
power_electric_switch() { // Code }
and replace it with
Code Snippet
Plaintext
power_electric_switch()
{
level.Connection = 3; // Amount of triggers. Since you have 3 before power, 3 is set.
trig = getent("use_power_switch","targetname");
master_switch = getent("power_switch","targetname");
master_switch notsolid();
trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");

Connection = GetEntArray( "con", "targetname" ); // Trigger of some sort with the targetname of con
for( i = 0; i < Connection.size; i++ )
Connection[i] thread ConnectionTrigs( trig );

cheat = false;

/#
if( GetDvarInt( "zombie_cheat" ) >= 3 )
{
wait( 5 );
cheat = true;
}
#/

user = undefined;
if ( cheat != true )
{
while( 1 )
{
trig waittill("trigger",user);

if( level.Connection != 0 )
user iprintln( level.Connection + " interuptions in Connection" );
else
break;
                        wait .01;
}
}

master_switch rotateroll(-90,.3);

//TO DO (TUEY) - kick off a 'switch' on client script here that operates similiarly to Berlin2 subway.
master_switch playsound("switch_flip");

power_electric_switch_on();

playfx(level._effect["switch_sparks"] ,getstruct("power_switch_fx","targetname").origin);

trig delete();
}

ConnectionTrigs( Trig )
{
// Use the code commented below if you want user to hit the main switch first
        // Trig waittill( "trigger", user );
        // Use commented code below for a hintstring message
        // self SetHintString( "Connection Interrupted" );
        self SetCursorHint( "HINT_NOICON" );
        self waittill( "trigger", user );
level.Connection--;
user iprintln( level.Connection + " connections left to go" );
        self delete();
}

I am able to build the connections before the player trys to turn on the power for teh first time. so can you implement that in ur script and add teh knuckle crack when the player builds a connection. Thanks
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
Here you go. Should do fine now. Just do the same thing replace the part I told you to add then done.
Code Snippet
Plaintext
power_electric_switch()
{
level.Connection = 3; // Amount of triggers. Since you have 3 before power, 3 is set.
trig = getent("use_power_switch","targetname");
master_switch = getent("power_switch","targetname");
master_switch notsolid();
trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");

Connection = GetEntArray( "con", "targetname" ); // Trigger of some sort with the targetname of con
for( i = 0; i < Connection.size; i++ )
Connection[i] thread ConnectionTrigs();

cheat = false;

/#
if( GetDvarInt( "zombie_cheat" ) >= 3 )
{
wait( 5 );
cheat = true;
}
#/

user = undefined;
if ( cheat != true )
{
while( 1 )
{
trig waittill("trigger",user);

for( i = 0; i < Connection.size; i++ )
if( !isDefined( level.FirstRun ) )
Connection[i] notify( "InitialTrigger" );

level.FirstRun = true;

if( level.Connection != 0 )
user iprintln( level.Connection + " interuptions in Connection" );
else
break;
                        wait .01;
}
}

master_switch rotateroll(-90,.3);

//TO DO (TUEY) - kick off a 'switch' on client script here that operates similiarly to Berlin2 subway.
master_switch playsound("switch_flip");

power_electric_switch_on();

playfx(level._effect["switch_sparks"] ,getstruct("power_switch_fx","targetname").origin);

trig delete();
}

ConnectionTrigs( Trig )
{
        // Use commented code below for a hintstring message
        self SetHintString( "Connection Interrupted" );
        self waittill( "InitialTrigger" );
        self SetCursorHint( "HINT_NOICON" );
        self UseTriggerRequireLookAt();
        self waittill( "trigger", user );
        self thread DoKnuckleCrack( user );
level.Connection--;
user iprintln( level.Connection + " connections left to go" );
        self delete();
}

DoKnuckleCrack( Play )
{
Play DisableOffhandWeapons();
Play DisableWeaponCycling();

Play AllowLean( false );
Play AllowAds( false );
Play AllowSprint( false );
Play AllowProne( false );
Play AllowMelee( false );

if ( Play GetStance() == "prone" )
Play SetStance( "crouch" );

Play GiveWeapon( "zombie_knuckle_crack" );

wait 4;// Maybe less/more of a wait

Play EnableOffhandWeapons();
Play EnableWeaponCycling();

Play AllowLean( true );
Play AllowAds( true );
Play AllowSprint( true );
Play AllowProne( true );
Play AllowMelee( true );

if ( Play maps\_laststand::player_is_in_laststand() )
{
Play TakeWeapon( "zombie_knuckle_crack" );
return;
}

Play TakeWeapon( "zombie_knuckle_crack" );

primaries = Play GetWeaponsListPrimaries();
if( isDefined( primaries ) && primaries.size > 0 )
Play SwitchToWeapon( primaries[0] );
}
Last Edit: July 26, 2014, 01:31:27 am by PROxFTW

 
Loading ...