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......
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.
// 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
Code Snippet
Plaintext
// 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
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
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
Code Snippet
Plaintext
"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
Code Snippet
Plaintext
"zw_corner1_door","script_noteworthy"
do the same step for 3 other doors and script origins.
For Machine 2
Code Snippet
Plaintext
"script_noteworthy","corner2_randomVendingLoc
Code Snippet
Plaintext
"zw_corner2_door","script_noteworthy"
For Machine3
Code Snippet
Plaintext
"script_noteworthy","corner3_randomVendingLoc
Code Snippet
Plaintext
"zw_corner3_door","script_noteworthy"
For Machine 4
Code Snippet
Plaintext
"script_noteworthy","corner4_randomVendingLoc
Code Snippet
Plaintext
"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
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.