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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - reckfullies

now its says me "Not Available"

Another reason it might say this is if you initialized another custom script before this and didn't thread it so this script never got initialized.
7 years ago
Very nice, thanks.

I noticed something in the script: Your functions pick1() and pick2() both thread your build() function, so essentially you have 2 of the same build() functions running in parallel, and build() won't break if you only have 1 part, because the first line wait's until the variable level.allParts equals 2.

Does this explain why some custom maps are playing the power up sound twice for players when you hit the power switch?

The way you have it set up is perfect, but instead of threading build() two times in the pick1() and pick2() functions, just thread build() once before pick1() & pick2() are threaded, and it will only execute once after the variable level.allParts= 2. Then of course remove the "thread build()" line from pick1() and pick2().

Maybe i'm reading it wrong or something, but just thought I would give some potentially helpful feedback. Thanks again, this is very useful.

You are correct, from what I see there is also no need to use a while loop inside the build function since waittill only needs to be called once and it will continue to wait.

I believe this was the first script he released so its safe to assume that it might have errors.
7 years ago
i get this error

Code Snippet
Plaintext
^1 trigger waittill
^1----------------^
^1ERR(0) scripts/zm/zm_les_planes.gsc (339,17) in "gettrigger()" : syntax error, unexpected TOKEN_WAITTILL, expecting TOKEN_LEFT_PAREN : trigger waittill

This was a mistake on my part, I forgot to add a semicolon at the end of a line.

Change:
Code Snippet
Plaintext
trigger = GetEnt("triggertargetname", "targetname")
to:
Code Snippet
Plaintext
trigger = GetEnt("triggertargetname", "targetname");
7 years ago
I was not aware there was legal legal aspect to it. thanks!

Just an fyi, it wouldn't be illegal for all games. Any of the call of duty games that have full mod support and give us access to the raw files would be fine(World at War, some of bo3).  The only reason it is illegal is because you are technically stealing assets then using them for yourself without activision giving them out publicly.
7 years ago
I Can't remember all of it, but I know you forgot about the .CSC file, and maybe even the .gsc.i think they're was more.

Are you talking about for perks or something? Nothing was required to be added to csc for my tutorial, mine was just purely for a shootable that can be used for anything not about a shootable giving perks or weapons like yours does.
7 years ago
and where in radiant i have to put it?

You won't be able to do anything special inside radiant. The way all triggers work is they are included inside scripts.

Here is an example:
Code Snippet
Plaintext
function init() // Initialization variable, call this in your mapname.gsc to start the script.
{
// Do whatever you would need to do here, not required for this.
thread GetTrigger(); // Calls the function while threading it so multiple functions can be executed at the same time.
}

function GetTrigger() // Function where all code for what you are currently doing is called.
{
trigger = GetEnt("triggertargetname", "targetname") // Replace "triggertargetname" with whatever you put in the targetname kvp in radiant.

// You would want a while loop here if you want the trigger to be able to be activated more than once.

trigger waittill("trigger", player); // Waits for the trigger to be activated, player isn't needed but is useful.
ModVar("timescale", 0.5); // Sets the timescale to 0.5
}
7 years ago
Yeah, Reck, your tutorial didn't work, you were missing a few parts and had weird spacing characters, so I found a similar thing and modified it.
I tried posting this, but I lost connection do idk if it posted.

Really? I didn't notice that, guess its something ill need to fix. Also, what do you mean by missing a few parts?
7 years ago
Any prefabs of my favorite guns??  Sliquifier!!!  Wanna add it to my maps!!   Or the  Wave gun? Or Winter ??  Why are these Best wonder weapons not available??  ANYONE PLEASE HELP ME WITH THIS??

IDK how to port things and dont have the software to learn how.

Well nobody is going to post the ported weapons since its technically illegal to do that, the only way you could get them unless you have someone who sent them directly would be to do it yourself by buying the game and following a porting tutorial which I guess you can't do currently.
7 years ago
Spoiler: click to open...
In Radient

Set three diferent models as script models with the following targetsnames:
Code Snippet
Plaintext
shootable_model
shootable_model_2
shootable_model_3
Then place a trigger_damage around each of them,
and set the triggers with the following targetnames
Code Snippet
Plaintext
shootable_trig_1
shootable_trig_2
shootable_trig_3

In the .gsc and .csc
Place the following at the top of your .gsc and .csc files:
Code Snippet
Plaintext
#using scripts\zm\_zm_perks;
#insert scripts\zm\_zm_perks.gsh;
#using scripts\zm\_zm_perk_electric_cherry;

In the .zone
Place the following at the bottom of the zone file:
Code Snippet
Plaintext
scriptparsetree,scripts/zm/_zm_perk_electric_cherry.gsc
scriptparsetree,scripts/zm/_zm_perk_electric_cherry.csc

In the .gsc
Place the following into the main function:
Code Snippet
Plaintext
thread shootableEasterEggInit();

Place this at the bottom of your file:
Code Snippet
Plaintext
function shootableEasterEggInit()
{
level.shootableEasterEggInit = 0;
level.shootables = 3;

thread shoot1();
thread shoot2();
thread shoot3();
}

function shoot1()
{
shoot_trig1 = GetEnt("shootable_trig_1", "targetname");
shoot_trig1 waittill("trigger", player);
shoot_model1 = GetEnt("shootable_model_1", "targetname");
shoot_model1 delete();
level.shootableEasterEggInit++;
thread finishedEasterEgg();
shoot_trig1 delete();
shoot_model1 delete();
}

function shoot2()
{
shoot_trig2 = GetEnt("shootable_trig_2", "targetname");
shoot_trig2 waittill("trigger", player);
shoot_model2 = GetEnt("shootable_model_2", "targetname");
shoot_model2 delete();
level.shootableEasterEggInit++;
thread finishedEasterEgg();
shoot_trig2 delete();
shoot_model2 delete();
}

function shoot3()
{
shoot_trig3 = GetEnt("shootable_trig_3", "targetname");
shoot_trig3 waittill("trigger", player);
shoot_model3 = GetEnt("shootable_model_3", "targetname");
shoot_model3 delete();
level.shootableEasterEggInit++;
thread finishedEasterEgg();
shoot_trig3 delete();
shoot_model3 delete();
}

function finishedEasterEgg()
{
if(level.shootableEasterEggInit >= level.shootables)
{
IPrintLnBold("You should now have recieved Electric Cherry");

players = GetPlayers();
for (i = 0;i<players.size;i++) {
players[i] zm_perks::give_perk( PERK_ELECTRIC_CHERRY );
}
}
}

In root\share\raw\scripts\zm\_zm_perk_electric_cherry.gsc
Replace the contents of the file with:
Code Snippet
Plaintext
#using scripts\codescripts\struct;

#using scripts\shared\array_shared;
#using scripts\shared\clientfield_shared;
#using scripts\shared\math_shared;
#using scripts\shared\system_shared;
#using scripts\shared\util_shared;
#using scripts\shared\visionset_mgr_shared;

#insert scripts\shared\shared.gsh;
#insert scripts\shared\version.gsh;

#using scripts\shared\ai\zombie_utility;

#using scripts\zm\_util;
#using scripts\zm\_zm;
#using scripts\zm\_zm_net;
#using scripts\zm\_zm_perks;
#using scripts\zm\_zm_pers_upgrades;
#using scripts\zm\_zm_pers_upgrades_functions;
#using scripts\zm\_zm_pers_upgrades_system;
#using scripts\zm\_zm_score;
#using scripts\zm\_zm_stats;
#using scripts\zm\_zm_utility;

#insert scripts\zm\_zm_perks.gsh;
#insert scripts\zm\_zm_utility.gsh;

//TODO update these to proper settings
#define ELECTRIC_CHERRY_PERK_COST 2000
#define ELECTRIC_CHERRY_PERK_BOTTLE_WEAPON "zombie_perk_bottle_cherry"
#define ELECTRIC_CHERRY_SHADER "specialty_blue_electric_cherry_zombies"
#define ELECTRIC_CHERRY_MACHINE_DISABLED_MODEL "p6_zm_vending_electric_cherry_off" //Change this to your OFF xmodel
#define ELECTRIC_CHERRY_MACHINE_ACTIVE_MODEL "p6_zm_vending_electric_cherry_on" //Change this to your ON xmodel
#define ELECTRIC_CHERRY_RADIANT_MACHINE_NAME "vending_electriccherry"
#define ELECTRIC_CHERRY_MACHINE_LIGHT_FX "electric_cherry_light"


// Global Attack Variables
#define ELECTRIC_CHERRY_STUN_CYCLES 4
// Last Stand Attack
#define ELECTRIC_CHERRY_DOWNED_ATTACK_RADIUS 500
#define ELECTRIC_CHERRY_DOWNED_ATTACK_DAMAGE 1000
#define ELECTRIC_CHERRY_DOWNED_ATTACK_POINTS 40
// Reload Attack
#define RELOAD_ATTACK_MIN_RADIUS 32
#define RELOAD_ATTACK_MAX_RADIUS 128
#define RELOAD_ATTACK_MIN_DAMAGE 1
#define RELOAD_ATTACK_MAX_DAMAGE 1045 // Max damage = zombie health at round 10
#define RELOAD_ATTACK_POINTS 40
#define RELOAD_ATTACK_COOLDOWN_TIMER 3

#precache( "fx", "_t6/misc/fx_zombie_cola_revive_on" );
#precache( "fx", "dlc1/castle/fx_castle_electric_cherry_down" );

#namespace zm_perk_electric_cherry;

REGISTER_SYSTEM( "zm_perk_electric_cherry", &__init__, undefined )

// ELECTRIC CHERRY ( ELECTRIC CHERRY )

//-----------------------------------------------------------------------------------
// setup
//-----------------------------------------------------------------------------------
function __init__()
{
enable_electric_cherry_perk_for_level();
}

function enable_electric_cherry_perk_for_level()
{
// register ec perk for level
zm_perks::register_perk_basic_info( PERK_ELECTRIC_CHERRY, "electric_cherry", ELECTRIC_CHERRY_PERK_COST, "Hold ^3[{+activate}]^7 for Electric Cherry [Cost: &&1]", GetWeapon( ELECTRIC_CHERRY_PERK_BOTTLE_WEAPON ) );
zm_perks::register_perk_precache_func( PERK_ELECTRIC_CHERRY, &electric_cherry_precache );
zm_perks::register_perk_clientfields( PERK_ELECTRIC_CHERRY, &electric_cherry_register_clientfield, &electric_cherry_set_clientfield );
zm_perks::register_perk_machine( PERK_ELECTRIC_CHERRY, &electric_cherry_perk_machine_setup );
zm_perks::register_perk_host_migration_params( PERK_ELECTRIC_CHERRY, ELECTRIC_CHERRY_RADIANT_MACHINE_NAME, ELECTRIC_CHERRY_MACHINE_LIGHT_FX );

zm_perks::register_perk_threads( PERK_ELECTRIC_CHERRY, &electric_cherry_reload_attack , &electric_cherry_perk_lost  );

if( IS_TRUE( level.custom_electric_cherry_perk_threads ) )
{
level thread [[ level.custom_electric_cherry_perk_threads ]]();
}

init_electric_cherry();
}

function electric_cherry_precache()
{
if( IsDefined(level.electric_cherry_precache_override_func) )
{
[[ level.electric_cherry_precache_override_func ]]();
return;
}

level._effect[ELECTRIC_CHERRY_MACHINE_LIGHT_FX] = "_t6/misc/fx_zombie_cola_revive_on";

level.machine_assets[PERK_ELECTRIC_CHERRY] = SpawnStruct();
level.machine_assets[PERK_ELECTRIC_CHERRY].weapon = GetWeapon( ELECTRIC_CHERRY_PERK_BOTTLE_WEAPON );
level.machine_assets[PERK_ELECTRIC_CHERRY].off_model = ELECTRIC_CHERRY_MACHINE_DISABLED_MODEL;
level.machine_assets[PERK_ELECTRIC_CHERRY].on_model = ELECTRIC_CHERRY_MACHINE_ACTIVE_MODEL;
}

function electric_cherry_register_clientfield()
{
clientfield::register( "clientuimodel", PERK_CLIENTFIELD_ELECTRIC_CHERRY, VERSION_SHIP, 2, "int" );
}

function electric_cherry_set_clientfield( state )
{
self clientfield::set_player_uimodel( PERK_CLIENTFIELD_ELECTRIC_CHERRY, state );
}

function electric_cherry_perk_machine_setup( use_trigger, perk_machine, bump_trigger, collision )
{
use_trigger.script_sound = "mus_perks_ec_jingle";
use_trigger.script_string = "electriccherry_perk";
use_trigger.script_label = "mus_perks_ec_sting";
use_trigger.target = "vending_electriccherry";
perk_machine.script_string = "electriccherry_perk";
perk_machine.targetname = "vending_electriccherry";
if( IsDefined( bump_trigger ) )
{
bump_trigger.script_string = "electriccherry_perk";
}
}

//-----------------------------------------------------------------------------------
// functionality
//-----------------------------------------------------------------------------------
function init_electric_cherry()
{
level._effect[ "electric_cherry_explode" ] = "dlc1/castle/fx_castle_electric_cherry_down";

// Last Stand Attack
level.custom_laststand_func = &electric_cherry_laststand;

zombie_utility::set_zombie_var( "tesla_head_gib_chance", 50 );

// Perk specific Client Fields
clientfield::register( "allplayers", "electric_cherry_reload_fx", VERSION_SHIP, 2, "int" );
clientfield::register( "actor", "tesla_death_fx", VERSION_SHIP, 1, "int" );
clientfield::register( "vehicle", "tesla_death_fx_veh", VERSION_TU10, 1, "int" ); // Leave at VERSION_TU10
clientfield::register( "actor", "tesla_shock_eyes_fx", VERSION_SHIP, 1, "int" );
clientfield::register( "vehicle", "tesla_shock_eyes_fx_veh", VERSION_TU10, 1, "int" ); // Leave at VERSION_TU10
}

function electric_cherry_perk_machine_think()
{
init_electric_cherry();

while ( true )
{
machine = getentarray( "vendingelectric_cherry", "targetname" );
machine_triggers = GetEntArray( "vending_electriccherry", "target" );

// Show "inactive" models
for( i = 0; i < machine.size; i++ )
{
machine[i] SetModel( ELECTRIC_CHERRY_MACHINE_DISABLED_MODEL );
}

level thread zm_perks::do_initial_power_off_callback( machine, "electriccherry" );
array::thread_all( machine_triggers, &zm_perks::set_power_on, false );

level waittill( "electric_cherry_on" );

for( i = 0; i < machine.size; i++ )
{
machine[i] SetModel( ELECTRIC_CHERRY_MACHINE_ACTIVE_MODEL );
machine[i] vibrate( ( 0, -100, 0 ), 0.3, 0.4, 3 );
machine[i] playsound( "zmb_perks_power_on" );
machine[i] thread zm_perks::perk_fx( "electriccherry" );
machine[i] thread zm_perks::play_loop_on_machine();
}

level notify( "specialty_grenadepulldeath_power_on" );

array::thread_all( machine_triggers, &zm_perks::set_power_on, true );

level waittill( "electric_cherry_off" );

array::thread_all( machine_triggers, &zm_perks::turn_perk_off );
}
}

// when host migration occurs, fx don't carry over. If perk machine is on, turn the light back on.
function electric_cherry_host_migration_func()
{
a_electric_cherry_perk_machines = GetEntArray( "vending_electriccherry", "targetname" );

foreach( perk_machine in a_electric_cherry_perk_machines )
{
if( isDefined( perk_machine.model ) && perk_machine.model == ELECTRIC_CHERRY_MACHINE_ACTIVE_MODEL )
{
perk_machine zm_perks::perk_fx( undefined, true );
perk_machine thread zm_perks::perk_fx( "electriccherry" );
}
}
}

//-----------------------------------------------------------------------------------
// downed player releases a boom
//-----------------------------------------------------------------------------------

function electric_cherry_laststand()  //self = player
{
VisionSetLastStand( "zombie_last_stand", 1 );

if ( IsDefined( self ) )
{
PlayFX( level._effect[ "electric_cherry_explode" ], self.origin );
self PlaySound( "zmb_cherry_explode" );
self notify( "electric_cherry_start" );

//time for notify to go out
wait 0.05;

a_zombies = zombie_utility::get_round_enemy_array();
a_zombies = util::get_array_of_closest( self.origin, a_zombies, undefined, undefined, ELECTRIC_CHERRY_DOWNED_ATTACK_RADIUS );

for ( i = 0; i < a_zombies.size; i++ )
{
if ( IsAlive( self ) && IsAlive( a_zombies[ i ] ) )
{
if ( a_zombies[ i ].health <= ELECTRIC_CHERRY_DOWNED_ATTACK_DAMAGE )
{
a_zombies[ i ] thread electric_cherry_death_fx();

//for achievement tracking
if( IsDefined( self.cherry_kills ) )
{
self.cherry_kills++;
}

self zm_score::add_to_player_score( ELECTRIC_CHERRY_DOWNED_ATTACK_POINTS );  //add points only if zombie is killed
}

else
{
a_zombies[ i ] thread electric_cherry_stun();
a_zombies[ i ] thread electric_cherry_shock_fx();
}

wait 0.1;

a_zombies[ i ] DoDamage( ELECTRIC_CHERRY_DOWNED_ATTACK_DAMAGE, self.origin, self, self, "none" );
}
}
self notify( "electric_cherry_end" );
}
}


function electric_cherry_death_fx()  //self = zombie
{
self endon( "death" );

self PlaySound( "zmb_elec_jib_zombie" );

if ( !IS_TRUE( self.head_gibbed ) )
{
if( IsVehicle( self ) )
{
self clientfield::set( "tesla_shock_eyes_fx_veh", 1 );
}
else
{
self clientfield::set( "tesla_shock_eyes_fx", 1 );
}
}
else
{
if( IsVehicle( self ) )
{
self clientfield::set( "tesla_death_fx_veh", 1 );
}
else
{
self clientfield::set( "tesla_death_fx", 1 );
}
}
}


function electric_cherry_shock_fx()  //self = zombie
{
self endon( "death" );

if( IsVehicle( self ) )
{
self clientfield::set( "tesla_shock_eyes_fx_veh", 1 );
}
else
{
self clientfield::set( "tesla_shock_eyes_fx", 1 );
}

self PlaySound( "zmb_elec_jib_zombie" );

self waittill( "stun_fx_end" );

if( IsVehicle( self ) )
{
self clientfield::set( "tesla_shock_eyes_fx_veh", 0 );
}
else
{
self clientfield::set( "tesla_shock_eyes_fx", 0 );
}
}


function electric_cherry_stun()  //self = zombie
{
self endon("death");

self notify( "stun_zombie" );
self endon( "stun_zombie" );

if ( self.health <= 0 )
{
return;
}

//only stun the zombie if they are not in the find_flesh state
if ( self.ai_state !== "zombie_think" )
{
return;
}

// This immobilizes zombies because they're being shocked by electricity
self.zombie_tesla_hit = true;
self.ignoreall = true;

wait ELECTRIC_CHERRY_STUN_CYCLES; // wait time for stun to hold.

if( isdefined( self ) )
{
//set them back on course
self.zombie_tesla_hit = false;
self.ignoreall = false;

self notify( "stun_fx_end" );
}
}

//-----------------------------------------------------------------------------------
// Release an explosion when the player reloads
//-----------------------------------------------------------------------------------

function electric_cherry_reload_attack() // self = player
{
self endon( "death" );
self endon( "disconnect" );
self endon( PERK_ELECTRIC_CHERRY + "_stop" );

self.wait_on_reload = [];
self.consecutive_electric_cherry_attacks = 0;

while( true )
{
// Wait for the player to reload
self waittill("reload_start");

current_weapon = self GetCurrentWeapon();

// Don't use the perk if the weapon is waiting to be reloaded
if( IsInArray( self.wait_on_reload, current_weapon ) )
{
continue;
}

// Add this weapon to the list so we know it needs to be reloaded before the perk can be used for again
self.wait_on_reload[self.wait_on_reload.size] = current_weapon;

self.consecutive_electric_cherry_attacks++;

// Get the percentage of bullets left in the clip at the time the weapon is reloaded
// n_clip_current = self GetWeaponAmmoClip( str_current_weapon );
// n_clip_max = WeaponClipSize( str_current_weapon );
n_clip_current = 1;
n_clip_max = 10;
n_fraction = n_clip_current/n_clip_max;

perk_radius = math::linear_map( n_fraction, 1.0, 0.0, RELOAD_ATTACK_MIN_RADIUS, RELOAD_ATTACK_MAX_RADIUS );
perk_dmg = math::linear_map( n_fraction, 1.0, 0.0, RELOAD_ATTACK_MIN_DAMAGE, RELOAD_ATTACK_MAX_DAMAGE );

// Kick off a thread that will tell us when the weapon has been reloaded.
self thread check_for_reload_complete( current_weapon );

// Do the Electric Cherry Perk attack.  Logic should be the same as the "Laststand" attack.
if ( IsDefined( self ) )
{
// If the attack is being spammed, limit the number of zombies the attack can affect
switch( self.consecutive_electric_cherry_attacks )
{
case 0:
case 1:
n_zombie_limit = undefined;
break;

case 2:
n_zombie_limit = 8;
break;

case 3:
n_zombie_limit = 4;
break;

case 4:
n_zombie_limit = 2;
break;

default:
n_zombie_limit = 0;
}

// Start the Cooldown Timer
self thread electric_cherry_cooldown_timer( current_weapon );

if( IsDefined(n_zombie_limit) && (n_zombie_limit == 0) )
{
// The player has spammed the attack too much
// So don't actually perform the attack
// This prevents us from seeing/hearing the attack when it won't affect any zombies
continue;
}

self thread electric_cherry_reload_fx( n_fraction );
self notify( "electric_cherry_start" );
self PlaySound( "zmb_cherry_explode" );

a_zombies = zombie_utility::get_round_enemy_array();
a_zombies = util::get_array_of_closest( self.origin, a_zombies, undefined, undefined, perk_radius );

n_zombies_hit = 0;

for ( i = 0; i < a_zombies.size; i++ )
{
if ( IsAlive( self ) && IsAlive( a_zombies[ i ] ) )
{
// If the limit of zombies is undefined, keep going and hit all zombies we can
if( IsDefined( n_zombie_limit ) )
{
// If the we're under the limit, increment the count of zombies
if( n_zombies_hit < n_zombie_limit )
{
n_zombies_hit++;
}
else
{
// If we're at the limit of zombies, don't kill any more zombies
break;
}
}

if ( a_zombies[ i ].health <= perk_dmg )
{
a_zombies[ i ] thread electric_cherry_death_fx();

//for achievement tracking
if( IsDefined( self.cherry_kills ) )
{
self.cherry_kills++;
}

self zm_score::add_to_player_score( RELOAD_ATTACK_POINTS );  //add points only if zombie is killed
}
else
{
if( !IsDefined(a_zombies[ i ].is_brutus) )
{
a_zombies[ i ] thread electric_cherry_stun();
}
a_zombies[ i ] thread electric_cherry_shock_fx();
}

wait 0.1;

if( isdefined( a_zombies[ i ] ) && IsAlive( a_zombies[ i ] ) ) // need to check again since we're post-wait
{
a_zombies[ i ] DoDamage( perk_dmg, self.origin, self, self, "none" );
}
}
}

self notify( "electric_cherry_end" );
}
}
}

function electric_cherry_cooldown_timer( current_weapon ) // self = player
{
self notify( "electric_cherry_cooldown_started" );
self endon( "electric_cherry_cooldown_started" );
self endon( "death" );
self endon( "disconnect" );

// Start the timer when the player reloads (when electric cherry attack starts)
// Cooldown time is equal to the weapon's reload time plus the global cooldown
//n_reload_time = WeaponReloadTime( current_weapon ); // TODO
n_reload_time = 0.25;
if( self HasPerk( "specialty_fastreload" ) )
{
n_reload_time *= GetDvarFloat( "perk_weapReloadMultiplier" );
}

n_cooldown_time = (n_reload_time + RELOAD_ATTACK_COOLDOWN_TIMER);

wait n_cooldown_time;

self.consecutive_electric_cherry_attacks = 0;
}

function check_for_reload_complete( weapon ) // self = player
{
self endon( "death" );
self endon( "disconnect" );
//self endon( "weapon_change_complete" );
self endon( "player_lost_weapon_" + weapon.name );

// Thread to watch for the case where this weapon gets replaced
self thread weapon_replaced_monitor( weapon );

while( 1 )
{
// Wait for the player to complete a reload
self waittill( "reload" );

// If the weapon that just got reloaded is the same as the one that was used for the electric cherry perk
// Kill off this thread and remove this weapon's name from the player's wait_on_reload list
// This allows the player to use the Electric Cherry Reload Attack with this weapon again!
current_weapon = self GetCurrentWeapon();
if( current_weapon == weapon )
{
ArrayRemoveValue( self.wait_on_reload, weapon );
self notify( "weapon_reload_complete_" + weapon.name );
break;
}
}
}

function weapon_replaced_monitor( weapon ) // self = player
{
self endon( "death" );
self endon( "disconnect" );
self endon( "weapon_reload_complete_" + weapon.name );

while( 1 )
{
// Wait for the player to change weapons (swap weapon, wall buy, magic box, etc.)
self waittill( "weapon_change" );

// If the weapon that we previously used for the Electric Cherry Reload Attack is no longer equipped
// Kill off this thread and remove this weapon's name from the player's wait_on_reload list
// This handles the case when a player cancels a reload, then replaces this weapon
// Ensures that when the player re-aquires the weapon, he has a fresh start and can use the Electric Cherry perk immediately.
primaryWeapons = self GetWeaponsListPrimaries();
if( !IsInArray( primaryWeapons, weapon ) )
{
self notify( "player_lost_weapon_" + weapon.name );
ArrayRemoveValue( self.wait_on_reload, weapon );
break;
}
}
}

function electric_cherry_reload_fx( n_fraction )
{
if( n_fraction >= 0.67 )
{
CodeSetClientField( self, "electric_cherry_reload_fx", 1 );
}
else if( (n_fraction >= 0.33) && (n_fraction < 0.67) )
{
CodeSetClientField( self, "electric_cherry_reload_fx", 2 );
}
else
{
CodeSetClientField( self, "electric_cherry_reload_fx", 3 );
}

wait ( 1.0 );

CodeSetClientField( self, "electric_cherry_reload_fx", 0 );
}

//////////////////////////////////////////////////////////////
//Perk lost func
//////////////////////////////////////////////////////////////
function electric_cherry_perk_lost( b_pause, str_perk, str_result )
{
self notify( PERK_ELECTRIC_CHERRY + "_stop" );
}


Is this really required? Its basically the exact same(Like really) as the script I already posted on here lol.
7 years ago
Hey, I would like to know how to create a shadow with something like a brush, if someone knows please help me.
Thanks.

That depends, do you want the brush to be visible? I would assume so since all the visible brushes already create shadows.

Just use shadow caulk texture or the texture called shadow.
7 years ago
someone help me with this error on mod tools please
i had everything working in my map, i change the scripts for teleporters etc before a update then after a mod tools update it just stopped working, so if i make a map i cant edit the scripts to add anything. please help me if you can and if possible add my steam Lukeglaptop thanks.
LINK TOO ERROR

(Image removed from quote.)

You must have messed something up when doing #using for a script either in mapname.gsc or mapname.csc

A common mistake is when adding perks like widows wine and electric cherry, make sure to add them to mapname.gsc AND mapname.csc

If it isn't either of those, I believe everyone was having this error a while back because the update had overwritten some of the files people edited. Make sure everything is where it should be in all of your scripts.
7 years ago
hi

i would ask if there a way to put a console comand like "/timescale 0.5" into a value of a trigger, somethink like this
"Press and hold F to change the timescale to 0.5"

Use the trigger like normal then once the trigger is activated use this:
Code Snippet
Plaintext
ModVar( "timescale", 0.5 );

Haven't actually used this but it seems its something people use for their anti-cheat to disable cheats like god by setting them to 0.
7 years ago
Okay, step 2...
"Go into root/usermaps/zm_mapname/scripts/zm/zm_mapname.gsc and add this into the #using section:
Code: [Select]"

There is nothing in root/usermaps for me... Would this be the same as if I went into mods/mymap/maps/mymapname.gsc?

Keep in mind I used UGX script placer so all the scripts were already generated. Also, at the top on mymap.gsc is #include not #using. 

drifter

This tutorial is for Black Ops 3 not World At War. You are looking at the wrong section.

Unless for some reason a ugx script placer exists for bo3 which I doubt it.
7 years ago
Hey guys, here is a simple script to add ways to teleport zombies in your map. So lets say you have a map with multiple zones and those zones are spaced apart, normally you would need to have a way for the zombies to get to the other like a hidden tunnel or something, this script is a good replacement for that. Here's a quick vid of it:
(Content removed from quote.)

Spoiler: click to open...
Radiant
The setup for this is very simple. The zombies need to be able to path to the area they are teleporting too. This can be done in a bunch of different creative ways such as using player clips or setting walls to non-colliding.
 - First create a trigger_multiple and give it this KVP "teleport_zombies" -  targetname.
 - Now create a script origin and place it halfway into the ground. Open the KVP's and set it to server. Now deselect everything, select the trigger first, then select the script_origin and hit W. What this will do is set the script_origin's targetname to an auto generated name so it can be copied without sharing targetnames.
 - Now you should see a line connecting the trigger to the origin. Double check to make sure its the trigger_multiple targeting script_origin and your good to go.
 - To add multiple teleporters just select the trigger and the origin and hit space. Check the kvp's to make sure the targetname on the origin is different from the targetname on the other origin and your done with radiant.

Here is an example of how i have mine setup, the clip is a clip_ai and not a player clip so only the zombies can cross that path.

Scripting
The scripting is extremely simple. Just open your mapname.gsc and copy this code.
Spoiler: click to open...
Code Snippet
Plaintext
/*
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
*/
function teleport_zombies_init()
{
teleport_trig = GetEntArray( "teleport_zombies", "targetname" );
for (i = 0; i < teleport_trig.size; i++)
{
teleport_trig[i] thread teleport_zombies();
}
}

function teleport_zombies()
{
teleport_destination = GetEnt( self.target, "targetname" );
while(1)
{
zombs = getaispeciesarray("axis","all");
for(k=0;k<zombs.size;k++)
{
if( zombs[k] IsTouching( self ) )
{
zombs[k] ForceTeleport( teleport_destination.origin );
}
}
wait(0.01);
}
}

 - Paste that code into the bottom of your mapname.gsc.
 - Now at the bottom of the main function paste this
Code Snippet
Plaintext
thread teleport_zombies_init();
- It should look something like this:
Code Snippet
Plaintext
function main()
{
zm_usermap::main();

level._zombie_custom_add_weapons =&custom_add_weapons;

//Setup the levels Zombie Zone Volumes
level.zones = [];
level.zone_manager_init_func =&usermap_test_zone_init;
init_zones[0] = "start_zone";
level thread zm_zonemgr::manage_zones( init_zones );

level.pathdist_type = PATHDIST_ORIGINAL;

thread teleport_zombies_init();
}

Now your done! Make sure when setting this up that the zombies are able to path to the destination otherwise they wont go into the portals. Also make sure to space the origin away from the portal a bit to avoid an infinite loop.

Let me know if you guys would like more simple scripting tutorial's like this.

Nice tutorial, this could be used in all sorts of ways. A cool thing anyone using this could also do is just add some fx to them when they teleport to make it seem like they aren't just appearing.
7 years ago
Hello, someone could tell me what some volumes do? Here are what I need to know:
Umbra volume, Fpstool 60 or die, Sky, Sun volume
Thanks  :D

I'm pretty sure umbra is just like the portal volume from waw but automatic, it doesn't let the game render areas that you can't see. Fpstool is probably just as it says, an fps tool to give your map better performance. Sky is the area where your skybox will appear. Sun is where you setup all of your sun settings and your sun ssi.
7 years ago
Loading ...