What I want, is a door, that needs power, and shows the "you must turn power on first!" hintstring, but after the power turns on, becomes a normal buyable door.
Closest ive come is using script_noteworthy electric_door, which results in it opening on power being turned on.
you can disable its trigger and put another trigger there that says you need to turn on the power to open it. and put a flag_wait for electricy_on (i may be wrong about it's name since i haven't touched waw since may), delete that trigger and enable the door's actual trigger.
In your _zombiemode_blockers_new.gsc find the door_think function, and add to the else another if statement:
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 { self waittill( "trigger", who ); if( !who UseButtonPressed() ) { continue; }
Make it look like this:
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" && !isDefined(self.zombie_cost)) { 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; }
Then you can use electric and zombie_cost on the same door.
Last Edit: September 19, 2015, 01:48:45 am by MakeCents
In your _zombiemode_blockers_new.gsc find the door_think function, and add to the else another if statement:
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 { self waittill( "trigger", who ); if( !who UseButtonPressed() ) { continue; }
Make it look like this:
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" && !isDefined(self.zombie_cost)) { 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; }
Then you can use electric and zombie_cost on the same door.
Ya, that seems better than my way. Use this instead
Used zombiekillers way before seeing MakeCents way, it worked fine. Thank you both anyway
Oh, I thought you wanted it to be a door trigger after electric was on. Wait till purchased, connect paths, move the door, enable the zone, stuff like that.
Door says needs power, I turn power on, it becomes buy for 1000, and buying it activates zone/spawners etc
I'm glad you got it working, but all that script does is hide a trig, and show the trig after electric, deleting a trig. You'll need more scripting for the rest. You should post the rest of the script for those that come to this post later, or not. Up to you.
Spoiler: click to open...
Two issues that way, adding an extra ent that isn't needed (closer to gspawn), and adding another hintstring towards the limit. You should use the perks one so it doesn't.NO_FLAMES something or other
Last Edit: September 19, 2015, 12:30:10 pm by MakeCents
If G-spawn risk is increased, then I will go for your method.
But the rest of the script? The only changes I made were what was posted at the bottom of mapname
Only by one. I'm not trying to convince you other wise. Use what you have working. I just wouldn't do toys for 20 doors. And I didn't see how that was all the script. That trig must be involved some other way.
Last Edit: September 19, 2015, 01:22:51 pm by MakeCents