I have a bit of a question... why in the get_zw_count function, why do you write:
instead of:
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.
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
add this line to the code
so the code will look like this
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]
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
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
do the same step for 3 other doors and script origins.
For Machine 2
For Machine3
For Machine 4
Models for the machines must be changed too. select the perk machine model and change the kvp's of model to the respective machine
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
so the code looks like this
add these lines to your mapname.csv
i have added a copy of _zombiemode_perks.gsc. find these lines in this file and comment it
comment it like this
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.