I don't know if this is an actual limitation that the doom engine has, or its just my big noobish when it comes to coding stuff, but here we go.
How can someone use decimals for monsters/weapons replacement chances (e.g. complex doom). I mean, when trying to code something really OP to spawn, I can't see to make a spawn chance lower than 1% possible. Tried using 0.01 and 0,01 and even 1/100, but none of them seen to work for me.
Is it even possible to use decimals for such a thing, and how could I make it work properly? If it's not possible, then what is problem with implementing such an apperrent trivial thing?
On a side note, I wonder why does zandronum doesn't have a last weapon used option for when configurating the controls, and if it's possible to code it (would be better to have it as a standart option in the menu).
Decimals (percentage lower than 1%) and last weapon used function
RE: Decimals (percentage lower than 1%) and last weapon used function
It depends how you're spawning the actors in question. If you're using the DropItem property of a RandomSpawner then just increase the "weight" of all the other actors listed in that spawner.
If it's decorate you can do something like this:
TNT1 AA 0 A_Jump(255, "NotPowerfulMonster")
TNT1 A 0 A_spawnitemex(powerful monster here)
That means that in order to make it to that SpawnItemEx call, you have a 1/65536 chance of making it past the A_jump calls because they are both 255/256 chances of jumping away from the super-OP-monster-spawning state and there's 2 of them in a row. Pretty simple.
Edit: math mistake
If it's decorate you can do something like this:
TNT1 AA 0 A_Jump(255, "NotPowerfulMonster")
TNT1 A 0 A_spawnitemex(powerful monster here)
That means that in order to make it to that SpawnItemEx call, you have a 1/65536 chance of making it past the A_jump calls because they are both 255/256 chances of jumping away from the super-OP-monster-spawning state and there's 2 of them in a row. Pretty simple.
Edit: math mistake
Last edited by Ænima on Sat Sep 19, 2015 9:47 pm, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

RE: Decimals (percentage lower than 1%) and last weapon used function
That actually has 1/256 · 1/256 = 1 / 256² = 1/65536 ≈ 0.0015% to spawn. You can't just sum denominators together, go learn some math.
Last edited by Dusk on Sat Sep 19, 2015 11:26 am, edited 1 time in total.
RE: Decimals (percentage lower than 1%) and last weapon used function
Psycho wrote: I don't know if this is an actual limitation that the doom engine has, or its just my big noobish when it comes to coding stuff, but here we go.
How can someone use decimals for monsters/weapons replacement chances (e.g. complex doom). I mean, when trying to code something really OP to spawn, I can't see to make a spawn chance lower than 1% possible. Tried using 0.01 and 0,01 and even 1/100, but none of them seen to work for me.
Is it even possible to use decimals for such a thing, and how could I make it work properly? If it's not possible, then what is problem with implementing such an apperrent trivial thing?
On a side note, I wonder why does zandronum doesn't have a last weapon used option for when configurating the controls, and if it's possible to code it (would be better to have it as a standart option in the menu).
Ouch, denominator sum op.Dusk wrote: That actually has 1/256 · 1/256 = 1 / 256² = 1/65536 ≈ 0.0015% to spawn. You can't just sum denominators together, go learn some math.
Anyway, I'd rather use Randomspawners as Decorate jump statement blocks (notice, not just one jump involved if you have more than 2 monsters) can lead to some weird chances of spawning. With randomspawner, you have the option to give it a weight, which is effectively the chance to spawn in this case. See this:
Code: Select all
Actor MySpawner : Randomspawner {
DropItem "HellKnight", 255, 16
DropItem "BaronofHell", 255, 16
DropItem "Cyberdemon", 255, 1
}
Altenratively you can use ACS to handle all your spawning. That way you can have more power through some if statements to check if your random value is in the desired range.
Last edited by Ivan on Sat Sep 19, 2015 1:50 pm, edited 1 time in total.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
RE: Decimals (percentage lower than 1%) and last weapon used function
Easy bro, easy. I know, math was never my strong suit. I had a feeling it was actually squared and not just doubled because hitting 1/256 twice in a row should be like super rare but oh well. The method I was trying to tell him is still valid advice, though.Dusk wrote: That actually has 1/256 · 1/256 = 1 / 256² = 1/65536 ≈ 0.0015% to spawn. You can't just sum denominators together, go learn some math.
Last edited by Ænima on Sat Sep 19, 2015 2:50 pm, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

RE: Decimals (percentage lower than 1%) and last weapon used function
Well, if you want a completely even distribution between barons and hellknights, then you can use the number 2 for the cyberdemon and fit the other numbers. 0.1% = 2/2000.
Cyberdemon: 2
Baron: 999
Hellknight: 999
That way they are easily distributed with the same chance to spawn the cyberdemon.
Not a big deal, but whatever.
Cyberdemon: 2
Baron: 999
Hellknight: 999
That way they are easily distributed with the same chance to spawn the cyberdemon.
Not a big deal, but whatever.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there