Lighting issue

broken avatar :(
Created 193 days ago
by Joeycx
0 Members and 1 Guest are viewing this topic.
297 views
broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 9 hours ago
Posts
195
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
Personal Quote
bịnh thần kinh
×
Joeycx's Groups
Joeycx's Contact & Social Links
I'm about almost done with my map and i need to do some touch up for my map when i came across the power on lights and BluntStuffy's "Lights controlled by triggers" post with fast strobe lights with a default tutorial with the _lights csc about the power on lights.

I've tried both but none of it works so if anyone can help me, it would help push my map forward and much thanks!

My power light set up * i've tried both elect_light and light_electric but both don't work*


My fast strobe light set up


What my clientscript in my mod folder looks like


My nazi_zombie_mapname.gsc
[noae][noae][noae]
/*

Generated by Script Placer Z © 2013-2015
Created by Jordy Rymenants

For support, visit [url=http://www.codscript.net]www.codscript.net[/url]

*/

// Utilities
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_zone_manager;
#include maps\_music;

// DLC3 Utilities
#include maps\dlc3_code;
#include maps\dlc3_teleporter;

main() {
level.DLC3 = spawnStruct();

level.DLC3.createArt = maps\createart\nazi_zombie_psychosis_art::main;
level.DLC3.createFX = maps\createfx\nazi_zombie_psychosis_fx::main;
level.DLC3.myFX = ::preCacheMyFX;

DLC3_FX();
        level._effect["chair_light_fx"] = loadfx("env/light/fx_glow_hanginglamp");


// Level variables

level.modderHelpText = []; // Variable Containing Helpful Text For Modders -- Don't Remove

// Intro message
level.DLC3.introString0 = "Dislocated";
level.DLC3.introString1 = "3:00 AM";
level.DLC3.introString2 = "";

level.DLC3.weapons = maps\dlc3_code::include_weapons;
level.DLC3.powerUps =  maps\dlc3_code::include_powerups;

level.start_score = 30000;

level.antiCheat = false;

level.DLC3.perk_altMeleeDamage = 1000; // Adjusts how much melee damage a player with the perk will do, needs only be set once. Stock is 1000.
level.DLC3.barrierSearchOverride = 400; // Adjusts barrier search override. Stock is 400.
level.DLC3.powerUpDropMax = 3; // Adjusts power up drop max per round. Stock is 3.
level.DLC3.useCoopHeroes = true; // _loadout Variables
level.DLC3.useBridge = false; // Bridge Feature
level.DLC3.useHellHounds = true; // Hell Hounds
level.DLC3.useMixedRounds = true; // Mixed Rounds

// Magic Boxes -- The Script_Noteworthy Value Names On Purchase Trigger In Radiant
boxArray = [];
boxArray[ boxArray.size ] = "start_chest";
boxArray[ boxArray.size ] = "chest1";
boxArray[ boxArray.size ] = "chest2";
boxArray[ boxArray.size ] = "chest3";
boxArray[ boxArray.size ] = "chest4";
boxArray[ boxArray.size ] = "chest5";
level.DLC3.PandoraBoxes = boxArray;

// Initial Zone(s) -- Zone(s) You Want Activated At Map Start
zones = [];
zones[ zones.size ] = "start_zone";
level.DLC3.initialZones = zones;

// Electricity Switch -- If False Map Will Start With Power On
level.DLC3.useElectricSwitch = true;

// Electric Traps
level.DLC3.useElectricTraps = true;

// _zombiemode_weapons Variables
level.DLC3.usePandoraBoxLight = true;
level.DLC3.useChestPulls = true;
level.DLC3.useChestMoves = true;
level.DLC3.useWeaponSpawn = true;
level.DLC3.useGiveWeapon = true;

// _zombiemode_spawner Varibles
level.DLC3.riserZombiesGoToDoorsFirst = true;
level.DLC3.riserZombiesInActiveZonesOnly = true;
level.DLC3.assureNodes = true;

// _zombiemode_perks Variables
level.DLC3.perksNeedPowerOn = true;

// _zombiemode_devgui Variables
level.DLC3.powerSwitch = true;

// Pre-load
level thread DLC3_threadCalls();
[[level.DLC3.weapons]]();
[[level.DLC3.powerUps]]();

// Initialize zombiemode
maps\ugx_easy_fx::fx_setup();
        maps\bazooka_text::main();
        maps\sophia_text::main();
        maps\_zombiemode::main();
        maps\_blst_light_control::main();
        maps\_mc_debug::init();
        maps\help_text::main();
        maps\power_text::main();
        thread maps\_kinostyle_teleporter::init();
        lamps = getentarray("dyn_lamp","script_noteworthy");
        array_thread(lamps,::dynamic_light);
        maps\nsz_ww_panther::init();
        players = get_players();
        for(i = 0; i < players.size; i++)
        {
        // Places the FX roughly at half of the player's height
        ent = Spawn("script_model", players[i].origin + (0, 0, 36));
        ent SetModel("tag_origin");
        PlayFxOnTag(level._effect["playerlight"], ent, "tag_origin");
        ent LinkTo(players[i]);
        }
        array_thread(players, ::zombie_hug_fix);
        maps\_zombiemode_rotating_door::init();
        thread maps\ugx_easy_fx::fx_start();
        thread maps\nazi_zombie_sumpf_zipline::initZipline();
       
       




// Script Placer Z Function calls
maps\zom_counter::main();

if( level.antiCheat )
level thread anticheat();

// Post-load
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();
        thread weapon_locker_begin();

}

dlc3_zone_init() {
/*
=============
///ScriptDocBegin
"Name: add_adjacent_zone( <zone_1>, <zone_2>, <flag>, <one_way> )"
"Summary: Sets up adjacent zones."
"MandatoryArg: <zone_1>: Name of first Info_Volume"
"MandatoryArg: <zone_2>: Name of second Info_Volume"
"MandatoryArg: <flag>: Flag to be set to initiate zones"
"OptionalArg: <one_way>: Make <zone_1> adjacent to <zone_2>. Defaults to false."
"Example: add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );"
///ScriptDocEnd
=============
*/

add_adjacent_zone( "start_zone", "zone_1", "enter_zone_1", true );
add_adjacent_zone( "start_zone", "start_zone", "enter_start_zone", true );
        add_adjacent_zone( "zone_1", "zone_2", "enter_zone_2", true );
        add_adjacent_zone( "zone_2", "zone_3", "enter_zone_3", true );
        add_adjacent_zone( "zone_3", "zone_4", "enter_zone_4", true );
        add_adjacent_zone( "zone_4", "zone_5", "enter_zone_5", true );
        add_adjacent_zone( "zone_5", "zone_6", "enter_zone_6", true );
        add_adjacent_zone( "zone_6", "zone_7", "enter_zone_7", true);
        add_adjacent_zone( "zone_7", "zone_8", "enter_zone_8" ,true);
        add_adjacent_zone( "zone_5", "zone_10", "enter_zone_10", true );
        add_adjacent_zone( "zone_10", "zone_11", "enter_zone_11", true );
        add_adjacent_zone( "zone_11", "zone_12", "enter_zone_12", true );
        add_adjacent_zone( "zone_12", "zone_8", "enter_zone_8", true);
        add_adjacent_zone( "zone_8", "zone_7", "enter_zone_7", true);
        add_adjacent_zone( "zone_8", "zone_9", "enter_zone_9", true);
        add_adjacent_zone( "zone_2", "zone_9", "enter_zone_9", true);

        //add_adjacent_zone( "start_zone", "start_zone", "enter_start_zone" );
}

preCacheMyFX() {
// Load your custom FX, example below
// level._effect[ "myFx" ] = loadFx( "myFx" );
        // NSZ Stuff
// Effects
level._effect["nsz_ww_landing"] = loadfx( "custom/nsz_ww_landing" );
level._effect["nsz_explode_fx"]          = loadFX("custom/nsz_big_geyser");
PrecacheShader( "vfx_blood_screen_splatter" );
}

antiCheat() {
setDvar( "god", "Not Allowed" );
setDvar( "ufo", "Not Allowed" );
setDvar( "noclip", "Not Allowed" );
setDvar( "give", "Not Allowed" );
setDvar( "demigod", "Not Allowed" );
setDvar( "notarget", "Not Allowed" );
setDvar( "jumptonode", "Not Allowed" );
setDvar( "thereisacow", "Not Allowed" );
setDvar( "player_sprintunlimited", "Not Allowed" );
setDvar( "sf_use_ignoreammo", "Not Allowed" );

meleedamage = getDvar( "player_meleedamagemultiplier" );
res_range = getDvar( "player_revivetriggerRadius" ); 
bleed_out = getDvar( "player_laststandbleedouttime" );
melee_range = getDvar( "player_meleerange" );
clip_size = getDvar( "player_clipsizemultiplier" );
speed = getDvar( "g_speed" );
gravity = getDvar( "g_gravity" );
death_delay = getDvar( "g_deathdelay" );
perk_1 = getDvar( "perk_overheatreduction" );
arcade = getDvar( "arcademode_score_revive" );
ammo = getDvar( "player_sustainammo" );

for(;;) {
if( getDvarInt( "player_meleedamagemultiplier" ) != meleedamage ||
getDvarInt( "player_revivetriggerRadius" ) != res_range ||
getDvarInt( "player_laststandbleedouttime" ) != bleed_out ||
getDvarInt( "player_meleerange" ) != melee_range ||
getDvarInt( "player_clipsizemultiplier" ) != clip_size ||
getDvarInt( "g_speed" ) != speed ||
getDvarInt( "g_gravity" ) != gravity ||
getDvarInt( "g_deathdelay" ) != death_delay ||
getDvarInt( "perk_overheatreduction" ) != perk_1 ||
getDvarInt( "arcademode_score_revive" ) != arcade ||
getDvarInt( "player_sustainammo" ) != ammo ) {
setSavedDvar( "player_meleedamagemultiplier", "0.4" );
setSavedDvar( "player_revivetriggerRadius", "64" );
setSavedDvar( "player_laststandbleedouttime", "30" );
setSavedDvar( "player_meleerange", "64" );
setSavedDvar( "player_clipsizemultiplier", "1" );
setSavedDvar( "g_speed", "190" );
setSavedDvar( "g_gravity", "800" );
setSavedDvar( "g_deathdelay", "4000" );
setSavedDvar( "perk_overheatreduction", "0.7" );
setSavedDvar( "arcademode_score_revive", "100" );
setSavedDvar( "player_sustainammo", "0" );
}
wait 1;
}
}

weapon_locker_begin()
{
players = getplayers();
for(i=0; i<players.size; i++)
{
players[i] thread get_stored_gun();
}
self thread weapon_locker();
}

get_stored_gun()
{
wait 1;
self.stored_gun_ammo = self GetStat(3007);
self.stored_ammo_clip = self GetStat(3008);
self.has_stored_weapon = self GetStat(3009);
keys = GetArrayKeys( level.zombie_weapons );
self.stored_weapon = keys[ self GetStat( 3006 ) ];
}

weapon_locker()
{
wait 2;
weapon_locker = getEnt("weapon_locker", "targetname");
    weapon_locker setHintString( "Press & hold &&1 to store current weapon" );
weapon_locker setCursorHint("HINT_NOICON");
while(1)
{
weapon_locker waittill( "trigger", user );
    if( is_player_valid(user))
{
user.old_gun = user getcurrentweapon();
user.gun_ammo = user GetAmmoCount( user.old_gun );
user.gun_ammo_clip = user GetWeaponAmmoClip(user.old_gun);

// this line is for non valid weapons, such as perk bottles, knuckle crack and the syringe when reviving, this should only need to be changed if adding extra perks etc.
if (!( user.old_gun == "none" || user.old_gun == "syrette" || user.old_gun == "zombie_melee" || user.old_gun == "zombie_perk_bottle_revive" || user.old_gun == "zombie_perk_bottle_doubletap" || user.old_gun == "zombie_perk_bottle_jugg" || user.old_gun == "zombie_perk_bottle_sleight" || user.old_gun == "zombie_perk_bottle_staminup" || user.old_gun == "zombie_perk_bottle_phd" || user.old_gun == "zombie_perk_bottle_mulekick" || user.old_gun == "zombie_perk_bottle_deadshot" || user.old_gun == "zombie_perk_bottle_cherry" || user.old_gun == "zombie_perk_bottle_vulture" || user.old_gun == "zombie_knuckle_crack" || user.old_gun == "stielhandgranate" || user.old_gun == "zombie_cymbal_monkey" || user.old_gun == "zombie_bowie_flourish" ))
{
primaryWeapons = user GetWeaponsListPrimaries();
if( (IsDefined( primaryWeapons ) && primaryWeapons.size == 1 ||  IsDefined( primaryWeapons ) && primaryWeapons.size == 2 && user hasPerk ("specialty_extraammo")) && user.has_stored_weapon == 1)
{
user giveweapon( user.stored_weapon );
user SetWeaponAmmoStock(user.stored_weapon,user.stored_gun_ammo);
user SetWeaponAmmoClip(user.stored_weapon,user.stored_ammo_clip);
user switchtoweapon( user.stored_weapon );
user.has_stored_weapon = 0;
user SetStat(3009,0);
}
else
// the following line is for weapons that you do not want storeable, i added some from my own map and advise customizing for weapons in your own map. zombie colt should be changed to your starting weapon
if ( user.old_gun == "colt" || user.old_gun == "zombie_colt" || user.old_gun == "zombie_colt_upgraded" || user.old_gun == "tesla_gun" || user.old_gun == "tesla_gun_upgraded" || user.old_gun == "thundergun" || user.old_gun == "thundergun_upgraded" || user.old_gun == "ray_gun" || user.old_gun == "ray_gun_upgraded" || user.old_gun == "scavenger" || user.old_gun == "scavenger_upgraded" || user.old_gun == "vorkuta_knife" || user.old_gun == "vorkuta_knife_upgraded"|| user.old_gun == "m2_flamethrower_wet")
{
user iPrintLnBold("^7Cannot store this weapon");
wait 2;
}
else
{
primaryWeapons = user GetWeaponsListPrimaries();
if(!( IsDefined( primaryWeapons ) && primaryWeapons.size == 1 ||  IsDefined( primaryWeapons ) && primaryWeapons.size == 2 && user hasPerk ("specialty_extraammo") ))
user takeweapon( user.old_gun );

    if(user.has_stored_weapon == 1)
{
user giveweapon( user.stored_weapon );
user SetWeaponAmmoStock(user.stored_weapon,user.stored_gun_ammo);
user SetWeaponAmmoClip(user.stored_weapon,user.stored_ammo_clip);
user switchtoweapon( user.stored_weapon );
}
user.switch_weapon = user.stored_weapon;
wait 0.1;
user.stored_weapon = user.old_gun;
user.stored_ammo_clip = user.gun_ammo_clip;
user.stored_gun_ammo = user.gun_ammo - user.stored_ammo_clip;
wait 0.1;

keys = GetArrayKeys( level.zombie_weapons );
for( i = 0; i < keys.size; i ++ )
{
if( keys[i] == user.stored_weapon )
{
user SetStat( 3006, i );
break;
}
}
user SetStat(3007,user.stored_gun_ammo);
user SetStat(3008,user.stored_ammo_clip);
user.has_stored_weapon = 1;
user SetStat(3009,1);

  user playlocalsound("cha_ching");
user.cur_gun = user getcurrentweapon();
primaryWeapons = user GetWeaponsListPrimaries();
if( IsDefined( primaryWeapons ) && primaryWeapons.size > 0 && (!(user.cur_gun == user.switch_weapon)))
{
user SwitchToWeapon( primaryWeapons[0] );
}
wait 2;
}
}
}
}
}
zombie_hug_fix()
{
self endon( "disconnect");
    for( ;; )
    {
    if(getDvarInt("aim_automelee_range") != 64)
    {
    self SetClientDvar("aim_automelee_range", "64");
    }
        zombies = getaiarray( "axis" );
        for(i=0; i < zombies.size; i++)
    {
            if(Distance( self.origin, zombies[i].origin ) <= 96 && self maps\_laststand::player_is_in_laststand())
            {
                zombies[i] PushPlayer( true );
            }
else
{
                zombies[i] PushPlayer( false );
            }
        }
wait 0.1;
}
}
dynamic_light()
{
light = get_array_of_closest(self.origin,getEntArray("dyn_light","targetname"))[0];

if(!isdefined(light))
return;

light linkto(self);

fx = spawn("script_model", self.origin);
fx.angles = (90,0,0);
fx setmodel("tag_origin");
fx linkto(self);
playfxontag(level._effect["chair_light_fx"],fx,"tag_origin");

while(1)
{
self physicslaunch ( self.origin, (randomintrange(-20,20),randomintrange(-20,20),randomintrange(-20,20)) );
wait(randomfloatrange(10,15));
}
}
[/noae][/noae][/noae]

My clientscript nazi_zombie_mapname.csc
[noae][noae][noae]
#include clientscripts\_utility;
#include clientscripts\_music;
#include clientscripts\_fx;

main()
{
level.DLC3_Client = spawnStruct(); // Leave This Line Or Else It Breaks Everything

// Must Change These For Your Map
level.DLC3_Client.createFX = clientscripts\createfx\nazi_zombie_psychosis_fx::main;
level.DLC3_Client.myFX = ::preCacheMyFX;

clientscripts\_load::main();

println("Registering zombify");
clientscripts\_utility::registerSystem("zombify", clientscripts\dlc3_code::zombifyHandler);

clientscripts\dlc3_teleporter::main();

clientscripts\dlc3_code::DLC3_FX();

clientscripts\_zombiemode_tesla::init();
       
        clientscripts\_blst_lights::init();
     
thread clientscripts\_audio::audio_init(0);

        // ======================= DUAL WEILD ===============================================
        thread clientscripts\_dual_wield::init();
        // ======================= DUAL WEILD ===============================================

        // ======================= PERKS ===============================================
        thread clientscripts\_zombiemode_perks::init();
        // ======================= PERKS ===============================================

// Change For Your Map!
thread clientscripts\nazi_zombie_psychosis_amb::main();

level._zombieCBFunc = clientscripts\_zombie_mode::zombie_eyes;

thread waitforclient(0);

println("*** Client : zombie running...or is it chasing? Muhahahaha");

}

preCacheMyFX()
{
// LEVEL SPECIFIC - FEEL FREE TO REMOVE/EDIT

level._effect["snow_thick"] = LoadFx( "env/weather/fx_snow_blizzard_intense" );
}
[/noae][/noae][/noae]

My _lights.csc in my clientscript folder
[noae][noae][noae]
#include clientscripts\_utility;


lerp_radiuslights_overtime( clientNum )
{

assertex(isdefined(self.lights) && isdefined(self.lights[clientNum]), "Light not setup before script thread run on it.");
wait randomFloatRange(1,4);
on_radius = self.lights[clientNum] getLightradius();
off = 50;
curr = on_radius;
//transition_on = .3;
//transition_off = .6;
transition_on = 1;
transition_off = 1;
increment_on = ( on_radius - off ) / ( transition_on / .05 );
increment_off = ( on_radius - off ) / ( transition_off / .05 );

original_position = self.lights[clientNum].origin;
while( 1 )
{
rand0 = randomFloatRange( 25, 50 );

//get small
time = 0;
while ( ( time < transition_off ) )
{
curr -= increment_off;
self.lights[clientNum] setLightradius( curr );
time += .05;
wait( .05 );
}

//get big
wait( .5 );
original_position = self.lights[clientNum].origin + ( 0, 0, rand0 );
self.lights[clientNum] moveto ( original_position, 3 );

//ramp up
time = 0;
while ( time < transition_on )
{
curr += increment_on;
self.lights[clientNum] setLightradius( curr );
time += .05;
wait( .05 );
}
original_position = self.lights[clientNum].origin  - ( 0, 0, rand0 );
self.lights[clientNum] moveto ( original_position, 3 );

wait( .5 );

}
}

movinglights( clientNum )
{
assertex(isdefined(self.lights) && isdefined(self.lights[clientNum]), "Light not setup before script thread run on it.");
wait randomFloatRange(1,4);
original_position = self.lights[clientNum].origin;
while( 1 )
{
rand0 = randomFloatRange( 25,75 );
original_position = self.lights[clientNum].origin + ( 0, 0, rand0 );
self.lights[clientNum] moveto ( original_position, 1 );
self.lights[clientNum] RotateYaw (360, 1);
wait( 1 );
original_position = self.lights[clientNum].origin  - ( 0, 0, rand0 );
self.lights[clientNum] moveto ( original_position, 1 );
self.lights[clientNum] RotateYaw (360, 1);
wait( 1 );
}
}
add_light(clientNum)
{
light = spawn(clientNum, self.origin);
light makelight(self.pl);

if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
{
light setLightIntensity( 0 );
}

return(light);
}

create_lights(clientNum)
{
if(!isdefined(self.lights))
{
self.lights = [];
}

self.lights[clientNum] = self add_light(clientNum);
}

generic_flickering(clientNum)
{

}

generic_pulsing(clientNum)
{
assertex(isdefined(self.lights) && isdefined(self.lights[clientNum]), "Light not setup before script thread run on it.");

//ChrisC wants the lights off when probes are done
if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
{
self.lights[clientNum] setLightIntensity( 0 );
return;
}

on = self.lights[clientNum] getLightIntensity();
off = .05;
curr = on;
transition_on = .3;
transition_off = .6;
increment_on = ( on - off ) / ( transition_on / .05 );
increment_off = ( on - off ) / ( transition_off / .05 );

for ( ;; )
{
//ramp down
time = 0;
while ( ( time < transition_off ) )
{
curr -= increment_off;
self.lights[clientNum] setLightIntensity( curr );
time += .05;
wait( .05 );
}

//off wait time
wait( 1 );

//ramp up
time = 0;
while ( time < transition_on )
{
curr += increment_on;
self.lights[clientNum] setLightIntensity( curr );
time += .05;
wait( .05 );
}

//on wait time
wait( .5 );
}
}

generic_double_strobe(clientNum)
{
assertex(isdefined(self.lights) && isdefined(self.lights[clientNum]), "Light not setup before script thread run on it.");

}

// modified version of _lights::burning_trash_fire()
ber3b_firelight(clientNum)
{

assertex(isdefined(self.lights) && isdefined(self.lights[clientNum]), "Light not setup before script thread run on it.");

full = self.lights[clientNum] GetLightIntensity();

old_intensity = full;

while( 1 )
{
intensity = RandomFloatRange( full * 0.63, full * 1.2 );
// old values = 6, 12
timer = RandomFloatRange( 2, 5 );

for ( i = 0; i < timer; i ++ )
{
new_intensity = intensity * ( i / timer ) + old_intensity * ( ( timer - i ) / timer );

self.lights[clientNum] SetLightIntensity( new_intensity );
wait( 0.05 );
}

old_intensity = intensity;
}
}

fire_flicker(clientNum)
{
assertex(isdefined(self.lights) && isdefined(self.lights[clientNum]), "Light not setup before script thread run on it.");

self endon("stop_flicker"); //self.lights[clientNum] endon("stop_flicker");
/#
if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
{
return;
}
#/

min_delay = 0.1;
max_delay = 0.5;
if( IsDefined( self.script_delay_min ) )
{
min_delay = self.script_delay_min;
}

if( IsDefined( self.script_delay_max ) )
{
max_delay = self.script_delay_max;
}

min_intensity = 0.25;
max_intensity = 1;
if( IsDefined( self.script_intensity_min ) )
{
min_intensity = self.script_intensity_min;
}

if( IsDefined( self.script_intensity_max ) )
{
max_intensity = self.script_intensity_max;
}

intensity = self.lights[clientNum] GetLightIntensity();
curr_intensity = intensity;

for( ;; )
{
temp_intensity = intensity * RandomFloatRange( min_intensity, max_intensity );
time = RandomFloatRange( min_delay, max_delay );
steps = time * 20;
div = ( curr_intensity - temp_intensity ) / steps;

for( i = 0; i < steps; i++ )
{
curr_intensity -= div;

if( curr_intensity < 0 )
{
curr_intensity = 0;
}

self.lights[clientNum] SetLightIntensity( curr_intensity );
wait( 0.05 );
}

curr_intensity = temp_intensity;
}
}

init_lights(clientNum)
{

lights = GetStructArray("light", "classname");

if(isdefined(lights))
{
array_thread(lights, ::create_lights, clientNum);
println("*** Client : Lights " + lights.size);
}
else
{
println("*** Client : No Lights");
}

if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
{
return;
}

flickering_lights = GetStructArray( "generic_flickering", "targetname" );
pulsing_lights = GetStructArray( "generic_pulsing", "targetname" );
double_strobe = GetStructArray( "generic_double_strobe", "targetname" );
fire_flickers = GetStructArray( "fire_flicker", "targetname" );
fire_casters = GetStructArray( "firecaster", "targetname");

//chrisp- added for zombie_Asylum map
asylum_lights = GetStructArray("elect_light","targetname");
asylum_controlroom_light = getstructarray("elect_flicker","script_noteworthy");

movinglights = GetStructArray( "movinglights", "targetname");
if(isdefined(movinglights))


//////////////////////
println("*** Client : " + movinglights.size + " movinglights.");
array_thread( movinglights, ::movinglights, clientNum );
lerp_radiuslights_overtime = GetStructArray( "rotatinglights", "targetname");
if(isdefined(lerp_radiuslights_overtime))
{
println("*** Client : " + lerp_radiuslights_overtime.size + " lerp_radiuslights_overtime.");
array_thread( lerp_radiuslights_overtime, ::lerp_radiuslights_overtime, clientNum );
}
//////////////////////

if(isdefined(flickering_lights))
{
println("*** Client : " + flickering_lights.size + " flickering lights.");
array_thread( flickering_lights, ::generic_flickering, clientNum );
}

if(isdefined(pulsing_lights))
{
println("*** Client : " + pulsing_lights.size + " pulsing_lights.");
array_thread( pulsing_lights, ::generic_pulsing, clientNum );
}

if(isdefined(double_strobe))
{
println("*** Client : " + double_strobe.size + " double_strobe.");
array_thread( double_strobe, ::generic_double_strobe, clientNum );
}

if(isdefined(fire_flickers))
{
println("*** Client : " + fire_flickers.size + " fire_flickers.");
array_thread( fire_flickers, ::fire_flicker, clientNum ); 
}

if(isdefined(fire_casters))
{
println("*** Client : " + fire_casters.size + " fire_casters.");
array_thread( fire_casters, ::ber3b_firelight, clientNum );
}

if(isdefined(asylum_lights))
{
println("*** Client : " + asylum_lights.size + " asylum lights.");
array_thread( asylum_lights, ::asylum_light_think, clientNum );
}

if(isDefined(asylum_controlroom_light))
{
println("*** Client : " + asylum_controlroom_light.size + " control lights.");
array_thread(asylum_controlroom_light,::asylum_controlroom_light_think,clientNum) ;
}

// Adding lights for Factory.  Not sure if there's a better place to do this.
//MarkM- added for nazi_zombie_factory
power_lights = GetStructArray( "light_electric", "targetname" );
if(isDefined(power_lights))
{
println("*** Client : " + power_lights.size + " power lights.");
array_thread(power_lights,::power_lights_think, clientNum);
}

// power_lights_flicker = GetStructArray( "light_electric_flicker", "targetname" );
// if(isDefined(power_lights))
// {
// println("*** Client : " + power_lights_flicker.size + " power lights flicker.");
// array_thread(power_lights_flicker,::power_lights_flicker_think, clientNum);
// }
}

//zombie asylum map stuff
asylum_light_think(clientnum)
{

self.lights[clientNum] setLightIntensity( 0 );
level waittill ("start_lights");
self.lights[clientnum] setLightIntensity( 2 );

}

asylum_controlroom_light_think(clientnum)
{
level waittill ("start_lights");

println("control room client num: " + clientnum);

self notify("stop_flicker"); // self.lights[clientnum] notify("stop_flicker");
self.lights[clientnum] setLightIntensity( 0 );

}


//
// Control light intensity for certain lights connected to the power
power_lights_think( clientNum )
{
// The lights start off
while (1)
{
level waittill( "pl1" ); // power lights on

// Turn the lights on
println("power lights on client num: " + clientnum);
if ( IsDefined( self.script_float ) )
{
self.lights[clientNum] SetLightIntensity( self.script_float );
}
else
{
self.lights[clientNum] SetLightIntensity( 1.5 );
}
level waittill( "lights_off" );

// Turn the lights off
// Turn this into a flicker later
println("power lights off client num: " + clientnum);
self.lights[clientNum] SetLightIntensity( 0.001 );
}
}


//
// Causes light to flicker after power is applied
//
power_lights_flicker_think(clientNum)
{
assertex(isdefined(self.lights) && isdefined(self.lights[clientNum]), "Light not setup before script thread run on it.");

self endon("stop_flicker"); //self.lights[clientNum] endon("stop_flicker");
/#
if ( getdvar( "r_reflectionProbeGenerate" ) == "1" )
{
return;
}
#/

min_delay = 0.1;
max_delay = 0.5;
if( IsDefined( self.script_delay_min ) )
{
min_delay = self.script_delay_min;
}

if( IsDefined( self.script_delay_max ) )
{
max_delay = self.script_delay_max;
}

// Get associated light model entity
if ( IsDefined( self.target ) )
{
self.light_model = GetEnt( clientNum, self.target, "targetname" );
}

min_intensity = 0.25;
max_intensity = 1;
if( IsDefined( self.script_intensity_min ) )
{
min_intensity = self.script_intensity_min;
}

if( IsDefined( self.script_intensity_max ) )
{
max_intensity = self.script_intensity_max;
}

intensity = self.lights[clientNum] GetLightIntensity();
curr_intensity = intensity;
model_swap_1 = intensity + min_intensity + ((max_intensity - min_intensity) / 3);
model_swap_2 = intensity + max_intensity - ((max_intensity - min_intensity) / 3);

// Start the lights at an initial intensity
println("power lights on client num: " + clientnum);
if ( IsDefined( self.script_float ) )
{
self.lights[clientNum] SetLightIntensity( self.script_float );
}
else
{
self.lights[clientNum] SetLightIntensity( 0.001 );
}

level waittill( "pl1" ); // power lights on


model = "";
for( ;; )
{
temp_intensity = intensity * RandomFloatRange( min_intensity, max_intensity );
time = RandomFloatRange( min_delay, max_delay );
steps = time * 20;
div = ( curr_intensity - temp_intensity ) / steps;

for( i = 0; i < steps; i++ )
{
curr_intensity -= div;

if( curr_intensity < 0 )
{
curr_intensity = 0;
}

self.lights[clientNum] SetLightIntensity( curr_intensity );

// Model swap check
println("*** Client : light flicker " + curr_intensity);
if ( IsDefined( self.light_model ) )
{
if ( curr_intensity < model_swap_1 )
{
model = "lights_berlin_subway_hat_0";
println("*** Client : light flicker              hat   0");
}
else if ( curr_intensity > model_swap_2 )
{
model = "lights_berlin_subway_hat_100";
println("*** Client : light flicker              hat  50");
}
else
{
model = "lights_berlin_subway_hat_50";
println("*** Client : light flicker              hat 100");
}

if ( model != self.light_model.model )
{
self.light_model SetModel( model );
}
}
wait( 0.05 );
}

curr_intensity = temp_intensity;
}
}


[/noae][/noae][/noae]

Any help is appreciated!
Last Edit: March 10, 2018, 07:38:27 pm by Joeycx
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 4 hours ago
Posts
473
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
Check maps/dlc3_code.gsc and make sure there is this line
Clientnotify ("pl1");
//
Light targets an info_null
Light has these kvp
targetname light_electric
spawnflags 6
intensity 0.1
exponent 1

 
Loading ...