AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to increase the number if gibs from the grenade explosion? (https://forums.alliedmods.net/showthread.php?t=335577)

GlobalPlague 12-15-2021 10:42

How to increase the number if gibs from the grenade explosion?
 
Hello. The following code makes the infection grenade's explosion to relase gibs (by default, the infection grenade has only rings, but this code makes it to release gibs, too):

Code:

        // Infection grenade gibs
        message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
        write_byte( TE_SPRITETRAIL ) // Throws a shower of sprites or models
        engfunc(EngFunc_WriteCoord, originF[ 0 ]) // start pos
        engfunc(EngFunc_WriteCoord, originF[ 1 ])
        engfunc(EngFunc_WriteCoord, originF[ 2 ] + 200.0)
        engfunc(EngFunc_WriteCoord, originF[ 0 ]) // velocity
        engfunc(EngFunc_WriteCoord, originF[ 1 ])
        engfunc(EngFunc_WriteCoord, originF[ 2 ] + 30.0)
        write_short(g_infect_gibs) // spr
        write_byte(60) // (count)
        write_byte(random_num(27,30)) // (life in 0.1's)
        write_byte(10) // byte (scale in 0.1's)
        write_byte(50) // (velocity along vector in 10's)
        write_byte(10) // (randomness of velocity in 10's)
        message_end()

This line:

Code:

write_byte(60) // (count)
Is responsible for the count of the gibs. The gibs are produced by a single .spr file, and then the content of the file is multiplied after the explosion of the infection grenade. In my case, it's a green biohazard symbol.
However, the number of biohazard symbols (gibs) is lower than 60. Also, when i increase the number from 60 to 500, for example, the number of gibs remains low, and doesn't increase nor to 60 nor to 500.
It seems the number of gibs can't be increased, but only decreased. In other words, the server will show any number of gibs, if the number is lower than 16-19, and even if you increase the number of gibs to 500, it will still show only 16-19. I decreased the number of gibs to 5, and the explosion produced 5 gibs. I increased the number of gibs to 10, and the explosion produced 10 gibs. So, the code works correctly and doesn't have bugs that prevent you from changing the number of gibs, but there is something that prevents the production of a number of gibs that is higher than 16-19.

NOTE: I don't know what is the exact number of gibs released after the explosion. I believe the number is around 16-19, just by seeing and observing the gibs, without counting them accurately, one by one.

So, I suspect there is a variable that is responsible for the allowed number of gibs, and I need to increase the value of the variable if I want more gibs to be allowed.

By the way, every time the gibs fall on the same place. It doesn't matter where on the map the infection grenade explodes, the gibs will always fall in the same order. Could it be that the number of gibs is actually 500, but since all gibs fall on several same points that never change, all the 500 gibs fall on the same 16-19 points, which creates the illusion there are 16-19 gibs when there are actually 500, but they remain unseen, because they fall on the same 16-19 points, which makes the 481 gibs to perfectly fit into the 19 gibs? For example, if 500 gibs fall on the exact same place, it will look like there is only one gib, when there are actually 500.

Here is the default code of ZPA: https://pastebin.com/Pmy5NmM0

Can someone, who knows better than me, check which variables' values should be increased in order for more gibs to be allowed?

When you open the link I gave you, you can use Ctrl+F to open the search box. Then type "vars", so you can find code segments that contain variables. "Vars" is the shortened name of "variables" in the code I gave you.

If you didn't understand what I said and you need more explanation so you can understand better what I want, just ask, and I will explain to you in more details.

Thanks.


All times are GMT -4. The time now is 11:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.