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 - Rampage_619

I have a bit of a question... why in the get_zw_count function, why do you write:

	if ( IS_TRUE( enemies[i].ignore_enemy_count ) )
{
continue;
}
ARRAY_ADD( level.current_zw_array, enemies[i] );
}

level.current_zw_count = level.current_zw_array.size;
return level.current_zw_count;

instead of:

	if ( IS_TRUE( enemies[i].ignore_enemy_count ) )
{
continue;
}
level.current_zw_count++;
}
return level.current_zw_count;

This way is more efficient because the game doesn't need to handle memory allocation, as well as the counter which in your code is just hidden in the array. This is also more efficient because it doesn't have to handle as many function calls as the currently standing code does.

Dubcraft, why increase it one by one, when you can just take the entire array......
1136 days ago
First of all - Thanks for releasing your script! Second of all, is this script just counting the zombies that have spawned? So it's max number would be that of 24 (the total possible instances of zombies on a map at one time).

Not a true representation of the zombies to go?


I tried replacing your code, but it did not work for me?

this script is to get the total amount of zombies for the round, not the total amount of zombies alive.
1136 days ago
Zombie Counter for BO3 Custom maps






Go to Root>usermaps>zm_yourmapname(open the folder corresponding with your map)

Open zm_yourmapname.gsc

Find the following function
function main()

add the following line inside
zombiesleft_hud();

so it should look like this
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 );
//Zombie Counter
zombiesleft_hud();


// Added to allow On spawned functionality
callback::on_spawned( &on_player_spawned );

// Change this to TRUE if you would like the Weapon Box to spawn in a random location other than _start

level.random_pandora_box_start = false;


}

Now go to the bottom of the file and copy and paste the following code

// Zombie Counter 1.0
function zombiesleft_hud()
{   
//Rampage_619: Beta 1.0
//Rampage_619: play with the x value to move the hud left and right
// Rampage_619: increase the " Remaining.x" if the numbers start to overlay
// Rampage_619: play with the Y value to push the hud up and down

Remaining = create_simple_hud();
  Remaining.horzAlign = "center";
  Remaining.vertAlign = "middle";
    Remaining.alignX = "middle";
    Remaining.alignY = "middle";
    Remaining.y = 230;
    Remaining.x = 5;
    Remaining.foreground = 1;
    Remaining.fontscale = 2.0;
    Remaining.alpha = 1;
    Remaining.color = ( 0.423, 0.004, 0 );


    ZombiesLeft = create_simple_hud();
    ZombiesLeft.horzAlign = "center";
    ZombiesLeft.vertAlign = "middle";
    ZombiesLeft.alignX = "right";
    ZombiesLeft.alignY = "middle";
    ZombiesLeft.y = 230;
    ZombiesLeft.x = -1;
    ZombiesLeft.foreground = 1;
    ZombiesLeft.fontscale = 2.0;
    ZombiesLeft.alpha = 1;
    ZombiesLeft.color = ( 0.423, 0.004, 0 );
    ZombiesLeft SetText("Zombies Left: ");


while(1)
{
//level.zombie_total = get_zombie_count_for_round( level.round_number, level.players.size );
//zw_total = zombie_utility::get_current_actor_count();
remainingZw = get_zw_count();
//= zw_total;
Remaining SetValue(remainingZw);

if(remainingZw ==  0 )
{
Remaining.alpha = 0;
ZombiesLeft.alpha = 0;
while(1)
{
remainingZw = get_zw_count();
//= zw_total;
Remaining SetValue(remainingZw);

if(remainingZw != 0  )
{
Remaining.alpha = 1;
ZombiesLeft.alpha = 1;                     
break;
}
wait 0.05;
}
}
wait 0.5;
}
}

function get_zw_count()
{
enemies = [];
level.current_zw_array = [];
enemies = GetAiSpeciesArray( level.zombie_team, "all" );

for( i = 0; i < enemies.size; i++ )
{
if ( IS_TRUE( enemies[i].ignore_enemy_count ) )
{
continue;
}
ARRAY_ADD( level.current_zw_array, enemies[i] );
}

level.current_zw_count = level.current_zw_array.size;

return level.current_zw_count;
}
function create_simple_hud( client, team )
{
if ( IsDefined( team ) )
{
hud = NewTeamHudElem( team );
hud.team = team;
}
else
{
if( IsDefined( client ) )
{
hud = NewClientHudElem( client );
}
else
{
hud = NewHudElem();
}
}

level.hudelem_count++;

hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;

return hud;
}

Use launcher to select your map and only check the link option and build.

Will be updating this with more color tuts and different designs.

Post comments if any issue persists.

1143 days ago
I was looking for a tut found couple didnt work for me so i made one that wokred for me.

the following steps worked for me you can try it if your box isn't moving and keep re-spawning in the same spot

Lets get started

Radiant Setup

Open up radiant and place the chests as according from start_chest being the starting box and so on untill chest 6,
 you will notice chest 5 is missing, dont worry about the chest 5
YOU CAN DOWNLOAD THE PREFABS FROM THE END OF THIS POST

[info]Make sure you add all the Chests[/info]

Scripting

for most people the gsc is not fixed to make the box move.

open your MAP_Name_HERE.gsc and find the box code which looks like this

// 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";
level.DLC3.PandoraBoxes = boxArray;

add this line to the code
BoxArray[ boxArray.size] = "chest5";

so the code will look like this
// 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;

now you are all setup save the file and save your map.
[okay]Run around looking for the box before you run out of ammo![/okay]

Credits:
Rampage_619

3021 days ago
if you were having trouble with your zombies not rising out of ground try this fix.

Open the gsc file _zombiemode_spawners

find the codeblock
if( ( level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") && 
IsDefined( level.zombie_rise_spawners ) )
{
spots = level.zombie_rise_spawners;
}
else
{
spots = GetStructArray("zombie_rise", "targetname");
}

if( spots.size < 1 )
{
self unlink();
self.anchor delete();
return;
}
else
spot = random(spots);

replace with
if ( IsDefined( level.zombie_rise_spawners ) )
{
spots = level.zombie_rise_spawners;
}
else
{
spots = GetStructArray("spawners_rise", "targetname");
}

if( spots.size < 1 )
{
self unlink();
self.anchor delete();
return;
}
else
spot = random(spots);

the kvp for the struct is
"zone_name_spawners_rise", "targetname"

Credit:
=ZCT= Wo0
Rampage_619
3021 days ago
Results May Vary

Download the linked file and open it using Winrar and follow the steps.

Updated Link
http://www.mediafire.com/?ceq2o98mejc6owo

Radiant Setup

Set up all the perk machines as usual. make sure the perk machines are in front of a door so that when a player opens the door the perk machine effects will be really cool to watch.

create a script_origin and give it these kvp's
"script_noteworthy","corner1_randomVendingLoc

place this script right under the machine. ( doesnt really mater which machine )
get the door which is infront of the origin "corner1_randomVendingLoc"

select the trigger on the door and give it this kvp's
"zw_corner1_door","script_noteworthy"

do the same step for 3 other doors and script origins.

For Machine 2
"script_noteworthy","corner2_randomVendingLoc
"zw_corner2_door","script_noteworthy"

For Machine3
"script_noteworthy","corner3_randomVendingLoc
"zw_corner3_door","script_noteworthy"

For Machine 4
"script_noteworthy","corner4_randomVendingLoc
"zw_corner4_door","script_noteworthy"

Models for the machines must be changed too. select the perk machine model and change the kvp's of model to the respective machine
      "zombie_vending_jugg_on_price"     
        "zombie_vending_doubletap_price"
        "zombie_vending_revive_on_price"   
        "zombie_vending_sleight_on_price"

thats it for the radiant set up.

Scripting Setup
place the 3 files from the download in your mods folder.

open your mapname.gsc file and add this line before maps\_zombiemode::main
maps\zw_rando_zone::main();

so the code looks like this
 maps\zw_rando_zone::main();
maps\_zombiemode::main();

add these lines to your mapname.csv
xmodel,zombie_vending_jugg_on_price
xmodel,zombie_vending_doubletap_price
xmodel,zombie_vending_revive_on_price
xmodel,zombie_monkey_bomber
xmodel,zombie_vending_sleight_on_price
fx,misc/fx_zombie_perk_lottery_4
fx,misc/fx_zombie_perk_lottery
fx,misc/fx_zombie_perk_lottery_flash
fx,misc/fx_zombie_perk_lottery_end
rawfile,maps/zw_randomperks.gsc
rawfile,maps/zw_rando_zone.gsc

i have added  a copy of  _zombiemode_perks.gsc. find these lines in this file and comment it
level thread turn_jugger_on();
level thread turn_doubletap_on();
level thread turn_sleight_on();
level thread turn_revive_on();

comment it like this
//level thread turn_jugger_on();
//level thread turn_doubletap_on();
//level thread turn_sleight_on();
//level thread turn_revive_on();

Note:
the angles of the machine is take from the original script_origin , so place all the script_origin in the same angles, or you will be having trouble with machines which has a different angles.
Edit the roof on top of the machines so that when taller machines are spawned, they don't intersect with roof.

Video:
http://www.xfire.com/video/4be89f/

if any problem, post it here, ill be updating this thread frequently with fixes.

Credit: Rampage_619
3021 days ago

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 Twitch
Loading ...