Wed Jan 12, 2022 10:17 am
TNT1 A 0 A_FireBullets(14, 8, 40, randompick(5, 10, 10, 15), "NewBulletPuff", FBF_NORANDOM);
Wed Jan 12, 2022 10:40 am
TNT1 A 0 {
for(int ii = 0; ii < 40; ii++) {
A_FireBullets(14, 8, 1, randompick(5, 10, 10, 15), "NewBulletPuff", FBF_NORANDOM);
}
}
Wed Jan 12, 2022 10:43 am
RandomPick
is only called once in this case, and sending its value to the A_FireBullets
damage calculation. Or put another way, you can't send a function into another function, only a value. RandomPick
is selecting a random value to pass as the damage parameter into A_FireBullets
.randompick(5, 10, 10, 15) * 1 bullet
randompick(5, 10, 10, 15) * 1 bullet
randompick(5, 10, 10, 15) * 1 bullet
randompick(5, 10, 10, 15) * 1 bullet
...
A_FireBullets(14, 8, 40, randompick(5, 10, 10, 15), "NewBulletPuff", FBF_NORANDOM);
// becomes |
A_FireBullets(14, 8, 40, 5 , "NewBulletPuff", FBF_NORANDOM);
5 * 1 bullet
5 * 1 bullet
5 * 1 bullet
5 * 1 bullet
...
Wed Jan 12, 2022 11:05 am
Wed Jan 12, 2022 1:15 pm
Like sooooo or by screaming TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAetc at your code if you like that.
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_FireBullets(random(-14, 14), random(-8, 8), 1, randompick(5, 10, 10, 15), "NewBulletPuff", FBF_NORANDOM);
Wed Jan 12, 2022 1:31 pm
Wiki wrote:If numbullets is 1 and this is the first bullet fired in the Fire (not Hold) sequence, the bullet is fired with perfect accuracy, ignoring the specified spread
Wed Jan 12, 2022 1:34 pm