Game Modding | Call of Duty: Black Ops 3 | Scripting
Zombieslayeraj:
I have most of the scripting for my map's easter egg done, however there is one thing I want which is for zombies to have a random chance to drop a hand that is used for another part of the easter egg. So far for testing and such I have left it in the middle of the room, but if someone could possibly help me to figure out how to make a zombie drop the part that would be incredible!
sharpgamers4you:
Hmmm this is really good, but i have no idea bro sorry, but will get back to you when I have something
MyNameIsNobody:
Maybe would be easier/better to spawn in one specific zombie that drops it that can spawn at random during a span of the next 3 rounds after "x" happens in the EE. But i cant script.
Spiki:
I used this:
in main function:
down below:
Zombieslayeraj:
I used this:
in main function:
down below:
quick question, what is a level notify? Also thank you I will check if this works
Zombieslayeraj:
I used this:
in main function:
down below:
So I tried this, and I changed it to my model name right and I got
UNRECOVERABLE ERROR:
^1SCRIPT ERROR: No generated data for 'scripts/zm/zm_test.gsc'
also your model needs to be called in your zone file
Zombieslayeraj:
you need this
also your model needs to be called in your zone file
Thanks KillJoy
Zombieslayeraj:
[USER=64]@Spiki[/USER] , what is the purpose of this part?
hand clientfield::set( "sm64_keyline", 1);
Spiki:
[USER=64]@Spiki[/USER] , what is the purpose of this part?
hand clientfield::set( "sm64_keyline", 1);
nothing to you. i made it visible through walls
Zombieslayeraj:
nothing to you. i made it visible through walls
gotcha thanks!
sharpgamers4you:
so did this worked out?
FrostIceforge:
I noticed a (fairly minor) error in your code, which could cause glitches if someone else used it with different values and didn't notice.
RandomInt(100) makes a number between 0 and 99, not 1 and 100, and you used >, not >=. So with #define CAP_DROP_CHANCE 10, the numbers 0-10 are all not > 10, and all work. The way it is right now, the cap on your map has an 11% chance to spawn, not 10% like you wanted. You might not care, but in fringe cases like percentages below 5 it can feel like a much bigger difference. Hell, if someone set it to be 0% temporarily, it'd actually be 1%. What you'd want is
or
Harry Bo21:
I noticed a (fairly minor) error in your code, which could cause glitches if someone else used it with different values and didn't notice.
RandomInt(100) makes a number between 0 and 99, not 1 and 100, and you used >, not >=. So with #define CAP_DROP_CHANCE 10, the numbers 0-10 are all not > 10, and all work. The way it is right now, the cap on your map has an 11% chance to spawn, not 10% like you wanted. You might not care, but in fringe cases like percentages below 5 it can feel like a much bigger difference. Hell, if someone set it to be 0% temporarily, it'd actually be 1%. What you'd want is
or
randomInt( 100 )
would pick from 0 - 99, so no it wouldnt
FrostIceforge:
randomInt( 100 )
would pick from 0 - 99, so no it wouldnt
Thats exactly what I said. That's where the problem comes from. The code acts like it's 1-100.
FrostIceforge:
Consider the 0% case. if(0>0) returns false. if(1>0) through if(99>0) return true. To be really 0%, it needs to always return true.
Harry Bo21:
Thats exactly what I said. That's where the problem comes from. The code acts like it's 1-100.
That’s only coz you have the =
FrostIceforge:
That’s only coz you have the =
What do you mean? I didn't use an =. The original code as he had it is bugged.
Harry Bo21:
yea i misread
although instead of
RandomInt(100) + 1
could just do
randomIntRange( 1, 100 )
looking back i was wrong earlier anyway
randomInt( 1 )
would return 0 or 1
FrostIceforge:
randomInt( 1 )
would return 0 or 1
But the script docs says the range is 0 to the paramater -1? So shouldn't randomInt(1) always return 0?
Harry Bo21:
But the script docs says the range is 0 to the paramater -1? So shouldn't randomInt(1) always return 0?
Nah it definitely gets 0 / 1
feel free to test, put it in a loop and I print it