UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: OptomusPrime22 on January 15, 2017, 01:08:50 am

Title: Starting Power By default
Post by: OptomusPrime22 on January 15, 2017, 01:08:50 am
When I load in I want the power to be on, my map is medieval style and I replaced all the perk machine models with beer kegs.... I don't want to ruin map vibes by turning on the power.
Title: Re: Starting Power By default
Post by: thezombieproject on January 15, 2017, 05:19:41 am
REMOVE SWITCH FROM YOUR MAP.
In your mapname.gsc add this to the bottom
Code Snippet
Plaintext
function CheckForPowerSwitchTZP()
{ level flag::wait_till( "initial_blackscreen_passed" ); wait 5;
Power = GetEntArray( "use_elec_switch", "targetname" );
if(!isdefined(Power) || !Power.size)
{
// level.PowerSwitchExist = false;
level flag::set("power_on");
// turns global power on - tzp
}
}

Also in mapname.gsc  under:  zm_usermap::main();
add this line
Code Snippet
Plaintext
thread CheckForPowerSwitchTZP();

If there is no switch on your map global power will be turned on.
I use this on a test map. Im not sure if there is an easier way ive never looked into it
either way this should work fine.

If you want to keep power switch for pap ect and just want perks only to be powered on at the start
i have a script for that also just let me know.