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

Making a debris not openable until power is on?

broken avatar :(
Created 9 years ago
by pcmodder
0 Members and 1 Guest are viewing this topic.
1,653 views
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 4 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linkspcmodderugxken5hir0
Can anyone tell me a way to have a debris that can only be opened when the power is on.

Thanks
Marked as best answer by pcmodder 9 years ago
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
Code Snippet
Plaintext
trig setHintString("power mustbe on");
flag_wait( "electricity_on" );
trig setHintString("press and blabla to open");
trig waittill("trigger", player);
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 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
But this lets you buy the door with the electricity off.
I have a similar script in my map. I use two triggers, one for the hint and other for the door.
My code is something like:
Code Snippet
Plaintext
trig = getEnt( "DOOR_TARGETNAME","target" );
hint = getEnt( "TRIGGER_TARGETNAME","targetname" );
trig trigger_off();
hint setHintString( "POWER STUFF" );
flag_wait( "electricity_on" );
trig trigger_on();
hint trigger_off();
This works well, but I'm sure there are better ways to do it.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
But this lets you buy the door with the electricity off.
I have a similar script in my map. I use two triggers, one for the hint and other for the door.
My code is something like:
Code Snippet
Plaintext
trig = getEnt( "DOOR_TARGETNAME","target" );
hint = getEnt( "TRIGGER_TARGETNAME","targetname" );
trig trigger_off();
hint setHintString( "POWER STUFF" );
flag_wait( "electricity_on" );
trig trigger_on();
hint trigger_off();
This works well, but I'm sure there are better ways to do it.

Quote
flag_wait( "electricity_on" ); // WILL FREEZE HERE TILL POWER ON
trig setHintString("press and blabla to open");
trig waittill("trigger", player); // SO COULDNT POSSIBLY DO THIS

No the method he posted first is fine
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 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
Ahms. Ok. My fault.
I tested it making a debris (with the targetname - zombie_debris) KVPs and it let me buy the door. But without this targetname it should work then.
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 4 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linkspcmodderugxken5hir0
Thanks all
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
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
If you do it this way, and set the hintstring twice, you should use the hintstring from the perks so your not adding another hintstring towards the limit.
Code Snippet
Plaintext
SetHintString( &"ZOMBIE_FLAMES_UNAVAILABLE" );

You could also edit your zombiemode_blockers_new.gsc where your debris is handled.
Modifying the debris_init() like this should work:

Code Snippet
Plaintext
debris_init()
{
cost = 1000;
if( IsDefined( self.zombie_cost ) )
{
cost = self.zombie_cost;
}
self SetCursorHint( "HINT_NOICON" );
if( isdefined (self.script_flag)  && !IsDefined( level.flag[self.script_flag] ) )
{
flag_init( self.script_flag );
}
if(isDefined(self.script_noteworthy) && self.script_noteworthy == "electric_door")
{
self set_door_unusable()
flag_wait( "electricity_on" );
}
self set_hint_string( self, "default_buy_debris_" + cost );
self thread debris_think();
}

Of course this would require you made a kvp script_noteworthy = "electric_door" on the trigger
Last Edit: September 05, 2015, 01:11:05 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
If you do it this way, and set the hintstring twice, you should use the hintstring from the perks so your not adding another hintstring towards the limit.
Code Snippet
Plaintext
SetHintString( &"ZOMBIE_FLAMES_UNAVAILABLE" );

You could also edit your zombiemode_blockers_new.gsc where your debris is handled.
Modifying the debris_init() like this should work:

Code Snippet
Plaintext
debris_init()
{
cost = 1000;
if( IsDefined( self.zombie_cost ) )
{
cost = self.zombie_cost;
}
self SetCursorHint( "HINT_NOICON" );
if( isdefined (self.script_flag)  && !IsDefined( level.flag[self.script_flag] ) )
{
flag_init( self.script_flag );
}
if(isDefined(self.script_noteworthy) && self.script_noteworthy == "electric_door")
{
self set_door_unusable()
flag_wait( "electricity_on" );
}
self set_hint_string( self, "default_buy_debris_" + cost );
self thread debris_think();
}

Of course this would require you made a kvp script_noteworthy = "electric_door" on the trigger

I sense another incoming tutorial ;)

 
Loading ...