It looks like you have a custom script since you are using teleporter_door? If so, then simply put this, after you set the cursor to noicon:
Code Snippet
Plaintext
flag_wait("electricity_on");
before the door move part and the sethintstring("whatever it says"); part.
The door will not move or show anything until the electric is on.
no i am not using any custom scripts ive just called the door teleport_door because it is the door to enter the teleport room I just wanted to place a door like in der rise that opens on power_on
Last Edit: February 08, 2016, 03:31:16 pm by IperBreach86
no i am not using any custom scripts ive just called the door teleport_door because it is the door to enter the teleport room I just wanted to place a door like in der rise that opens on power_on
Well, then what blunt said should have worked. You said that it failed to load. What do you mean exactly? The map failed to load? Are you getting an error. Did you type developer 1 in console and then start the map to see any more info. It's okay if you have several triggers with that targetname. The door and clip should be the targets of the trigger though. So make sure only your triggers have targetname zombie_door, and make the clip and door the target of the trigger, and then on the clip, add script_noteworthy clip
Well, then what blunt said should have worked. You said that it failed to load. What do you mean exactly? The map failed to load? Are you getting an error. Did you type developer 1 in console and then start the map to see any more info. It's okay if you have several triggers with that targetname. The door and clip should be the targets of the trigger though. So make sure only your triggers have targetname zombie_door, and make the clip and door the target of the trigger, and then on the clip, add script_noteworthy clip
with developer 1 the game would give me a script error located in _zombiemode_blockers.gsc removing the door fixed it. Now that i think about it i didnt palced a trogger because i tought that it wasnt needed since i didnt nedeed to buy the door.
with developer 1 the game would give me a script error located in _zombiemode_blockers.gsc removing the door fixed it. Now that i think about it i didnt palced a trogger because i tought that it wasnt needed since i didnt nedeed to buy the door.
Well, my scripts are slightly modified, but here is the jist of it. This here is the door_init function that will handle your door setup, in your _zombiemode_blockers_new.gsc
Code Snippet
Plaintext
door_init() { self.type = undefined;
// Figure out what kind of door we are targets = GetEntArray( self.target, "targetname" );
//CHRIS_P - added script_flag support for doors as well if( isDefined(self.script_flag) && !IsDefined( level.flag[self.script_flag] ) ) { flag_init( self.script_flag ); }
//MM Consolidate type code for(i=0;i<targets.size;i++) { targets[i] disconnectpaths(); if ( IsDefined(targets[i].script_noteworthy) && targets[i].script_noteworthy == "clip" ) { self.clip = targets[i]; self.script_string = "clip"; } else if( !IsDefined( targets[i].script_string ) ) { if( IsDefined( targets[i].script_angles ) ) { targets[i].script_string = "rotate"; } else if( IsDefined( targets[i].script_vector ) ) { targets[i].script_string = "move"; } } else { if ( targets[i].script_string == "anim" ) { AssertEx( IsDefined( targets[i].script_animname ), "Blocker_init: You must specify a script_animname for "+targets[i].targetname ); AssertEx( IsDefined( level.scr_anim[ targets[i].script_animname ] ), "Blocker_init: You must define a level.scr_anim for script_anim -> "+targets[i].script_animname ); AssertEx( IsDefined( level.blocker_anim_func ), "Blocker_init: You must define a level.blocker_anim_func" ); } } } self.doors = targets;
//AssertEx( IsDefined( self.type ), "You must determine how this door opens. Specify script_angles, script_vector, or a script_noteworthy... Door at: " + self.origin );
// MM - Added support for electric doors. Don't have to add them to level scripts if ( IsDefined( self.script_noteworthy ) && self.script_noteworthy == "electric_door" ) { self set_door_unusable(); if( isDefined( level.door_dialog_function ) ) { self thread [[ level.door_dialog_function ]](); } } }
self in this function is the trigger that has the kvp targetname zombie_door thread from a previous function like this:
for( i = 0; i < zombie_doors.size; i++ ) { zombie_doors[i] thread door_init(); }
Next we have the door_think function which mine is slightly modified so it might not match yours, but it then checks for that script_noteworthy, and waits for the electricity to be on. (My whole blockers script found here)
Code Snippet
Plaintext
door_think() { // maybe the door the should just bust open instead of slowly opening. // maybe just destroy the door, could be two players from opposite sides.. // breaking into chunks seems best. // or I cuold just give it no collision while( 1 ) { if(isDefined(self.script_noteworthy) && self.script_noteworthy == "electric_door") { flag_wait( "electricity_on" ); } else { if(isDefined(self.script_noteworthy) && self.script_noteworthy == "electric_door"){ flag_wait( "electricity_on" ); cost = 1000; if( IsDefined( self.zombie_cost ) ) cost = self.zombie_cost; self set_hint_string( self, "default_buy_door_" + cost ); } self waittill( "trigger", who ); if( !who UseButtonPressed() ) { continue; }
if( who in_revive_trigger() ) { continue; }
if( is_player_valid( who ) ) { if( who.score >= self.zombie_cost ) { // set the score who maps\_zombiemode_score::minus_to_player_score( self.zombie_cost ); if( isDefined( level.achievement_notify_func ) ) { level [[ level.achievement_notify_func ]]( "DLC3_ZOMBIE_ALL_DOORS" ); } bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type door", who.playername, who.score, level.round_number, self.zombie_cost, self.target, self.origin ); } else // Not enough money { play_sound_at_pos( "no_purchase", self.doors[0].origin ); // who thread maps\_zombiemode_perks::play_no_money_perk_dialog(); continue; } } }
// Door has been activated, make it do its thing for(i=0;i<self.doors.size;i++) { self.doors[i] NotSolid(); self.doors[i] connectpaths();
// Prevent multiple triggers from making doors move more than once if ( IsDefined(self.doors[i].door_moving) ) { continue; } self.doors[i].door_moving = 1;
time = 1; if( IsDefined( self.doors[i].script_transition_time ) ) { time = self.doors[i].script_transition_time; }
// MM - each door can now have a different opening style instead of // needing to be all the same switch( self.doors[i].script_string ) { case "rotate": if(isDefined(self.doors[i].script_angles)) { self.doors[i] RotateTo( self.doors[i].script_angles, time, 0, 0 ); self.doors[i] thread door_solid_thread(); } wait(randomfloat(.15)); break; case "move": case "slide_apart": if(isDefined(self.doors[i].script_vector)) { self.doors[i] MoveTo( self.doors[i].origin + self.doors[i].script_vector, time, time * 0.25, time * 0.25 ); self.doors[i] thread door_solid_thread(); } wait(randomfloat(.15)); break;
// Just play purchase sound on the first door if( i == 0 ) { play_sound_at_pos( "purchase", self.doors[i].origin ); }
//Chris_P - just in case spawners are targeted if( isDefined( self.doors[i].target ) ) { // door needs to target new spawners which will become part // of the level enemy array self.doors[i] add_new_zombie_spawners(); } }
// get all trigs, we might want a trigger on both sides // of some junk sometimes all_trigs = getentarray( self.target, "target" ); for( i = 0; i < all_trigs.size; i++ ) { all_trigs[i] trigger_off(); } break; } }
You can however simply make a new custom function for this that doesn't need a trigger. Simply get the door, and get a clip if needed. I suggest using auto targets with the use the the w. Then have a flag_wait("electricity_on"); just like in the door functions above, and move it when electric comes on, or delete it.
Last Edit: February 08, 2016, 04:04:56 pm by MakeCents
Well, my scripts are slightly modified, but here is the jist of it. This here is the door_init function that will handle your door setup, in your _zombiemode_blockers_new.gsc
Code Snippet
Plaintext
door_init() { self.type = undefined;
// Figure out what kind of door we are targets = GetEntArray( self.target, "targetname" );
//CHRIS_P - added script_flag support for doors as well if( isDefined(self.script_flag) && !IsDefined( level.flag[self.script_flag] ) ) { flag_init( self.script_flag ); }
//MM Consolidate type code for(i=0;i<targets.size;i++) { targets[i] disconnectpaths(); if ( IsDefined(targets[i].script_noteworthy) && targets[i].script_noteworthy == "clip" ) { self.clip = targets[i]; self.script_string = "clip"; } else if( !IsDefined( targets[i].script_string ) ) { if( IsDefined( targets[i].script_angles ) ) { targets[i].script_string = "rotate"; } else if( IsDefined( targets[i].script_vector ) ) { targets[i].script_string = "move"; } } else { if ( targets[i].script_string == "anim" ) { AssertEx( IsDefined( targets[i].script_animname ), "Blocker_init: You must specify a script_animname for "+targets[i].targetname ); AssertEx( IsDefined( level.scr_anim[ targets[i].script_animname ] ), "Blocker_init: You must define a level.scr_anim for script_anim -> "+targets[i].script_animname ); AssertEx( IsDefined( level.blocker_anim_func ), "Blocker_init: You must define a level.blocker_anim_func" ); } } } self.doors = targets;
//AssertEx( IsDefined( self.type ), "You must determine how this door opens. Specify script_angles, script_vector, or a script_noteworthy... Door at: " + self.origin );
// MM - Added support for electric doors. Don't have to add them to level scripts if ( IsDefined( self.script_noteworthy ) && self.script_noteworthy == "electric_door" ) { self set_door_unusable(); if( isDefined( level.door_dialog_function ) ) { self thread [[ level.door_dialog_function ]](); } } }
self in this function is the trigger that has the kvp targetname zombie_door thread from a previous function like this:
for( i = 0; i < zombie_doors.size; i++ ) { zombie_doors[i] thread door_init(); }
Next we have the door_think function which mine is slightly modified so it might not match yours, but it then checks for that script_noteworthy, and waits for the electricity to be on. (My whole blockers script found here)
Code Snippet
Plaintext
door_think() { // maybe the door the should just bust open instead of slowly opening. // maybe just destroy the door, could be two players from opposite sides.. // breaking into chunks seems best. // or I cuold just give it no collision while( 1 ) { if(isDefined(self.script_noteworthy) && self.script_noteworthy == "electric_door") { flag_wait( "electricity_on" ); } else { if(isDefined(self.script_noteworthy) && self.script_noteworthy == "electric_door"){ flag_wait( "electricity_on" ); cost = 1000; if( IsDefined( self.zombie_cost ) ) cost = self.zombie_cost; self set_hint_string( self, "default_buy_door_" + cost ); } self waittill( "trigger", who ); if( !who UseButtonPressed() ) { continue; }
if( who in_revive_trigger() ) { continue; }
if( is_player_valid( who ) ) { if( who.score >= self.zombie_cost ) { // set the score who maps\_zombiemode_score::minus_to_player_score( self.zombie_cost ); if( isDefined( level.achievement_notify_func ) ) { level [[ level.achievement_notify_func ]]( "DLC3_ZOMBIE_ALL_DOORS" ); } bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type door", who.playername, who.score, level.round_number, self.zombie_cost, self.target, self.origin ); } else // Not enough money { play_sound_at_pos( "no_purchase", self.doors[0].origin ); // who thread maps\_zombiemode_perks::play_no_money_perk_dialog(); continue; } } }
// Door has been activated, make it do its thing for(i=0;i<self.doors.size;i++) { self.doors[i] NotSolid(); self.doors[i] connectpaths();
// Prevent multiple triggers from making doors move more than once if ( IsDefined(self.doors[i].door_moving) ) { continue; } self.doors[i].door_moving = 1;
time = 1; if( IsDefined( self.doors[i].script_transition_time ) ) { time = self.doors[i].script_transition_time; }
// MM - each door can now have a different opening style instead of // needing to be all the same switch( self.doors[i].script_string ) { case "rotate": if(isDefined(self.doors[i].script_angles)) { self.doors[i] RotateTo( self.doors[i].script_angles, time, 0, 0 ); self.doors[i] thread door_solid_thread(); } wait(randomfloat(.15)); break; case "move": case "slide_apart": if(isDefined(self.doors[i].script_vector)) { self.doors[i] MoveTo( self.doors[i].origin + self.doors[i].script_vector, time, time * 0.25, time * 0.25 ); self.doors[i] thread door_solid_thread(); } wait(randomfloat(.15)); break;
// Just play purchase sound on the first door if( i == 0 ) { play_sound_at_pos( "purchase", self.doors[i].origin ); }
//Chris_P - just in case spawners are targeted if( isDefined( self.doors[i].target ) ) { // door needs to target new spawners which will become part // of the level enemy array self.doors[i] add_new_zombie_spawners(); } }
// get all trigs, we might want a trigger on both sides // of some junk sometimes all_trigs = getentarray( self.target, "target" ); for( i = 0; i < all_trigs.size; i++ ) { all_trigs[i] trigger_off(); } break; } }
You can however simply make a new custom function for this that doesn't need a trigger. Simply get the door, and get a clip if needed. I suggest using auto targets with the use the the w. Then have a flag_wait("electricity_on"); just like in the door functions above, and move it when electric comes on, or delete it.
Ive tried understanding something but....lets say i am not into scripting Anyway i am not using any special scripts nor trying to change something in the code I just wanted to set up a door that opens on power on... Maybe its me that doesnt understand anything
Understood. That was just an explanation of how it works. Some people want to know why it works, and others just turn the switch on, I get it.
Step 1: Set up a door the right way, like it would be a normal door.
Step 2: Add script_noteworthy electric_door to the trigger
Just like said here:
oh Ok, well ill let you know... anyway, i am going one tiem or another to learn to script and before replying ive actually tried to understand how it works, then i couldnt and asked for more help.