AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Fire sprite (https://forums.alliedmods.net/showthread.php?t=325048)

MayroN 06-06-2020 13:22

Fire sprite
 
We have the following sprite with such parameters

https://d.radikal.ru/d42/2006/33/c326115f6d46.jpg

And its function
PHP Code:

public fire()
{
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_FIREFIELD );
    
engfuncEngFunc_WriteCoordOriginC4] );
    
engfuncEngFunc_WriteCoordOriginC4] );
    
engfuncEngFunc_WriteCoordOriginC4] += 35.0 );
    
write_short);
    
write_shortg_FireSprites );
    
write_byte);
    
write_byteTEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA );
    
write_byte20 ); 
    
message_end();


Why in the game do I see him on a black background?
I tried to redo the sprite with different formats ... no sense.
Maybe this is due to the number of frames, instead of one? (Delirium)

What is needed or is everything right?
PHP Code:

    write_byteTEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA ); 


Vieni 06-07-2020 09:39

Re: Fire sprite
 
When you edited the sprite, did you rename it to something else? As this the new would be downloaded.

If you did so, I'd suggest to try recreating it as "vp_parallel", if ain't working, set the format to indexalpha, maxbe the black ain't the needed black, so the first pixels will be picked to set the transparency.

If still not working, I'd play with the flags:
HTML Code:

TEFIRE_FLAG_ALLFLOAT        1        // All sprites will drift upwards as they animate
TEFIRE_FLAG_SOMEFLOAT      2        // Some of the sprites will drift upwards. (50% chance)
TEFIRE_FLAG_LOOP            4        // If set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
TEFIRE_FLAG_ALPHA          8        // If set, sprite is rendered alpha blended at 50% else, opaque
TEFIRE_FLAG_PLANAR          16      // If set, all fire sprites have same initial Z instead of randomly filling a cube.


MayroN 06-07-2020 19:54

Re: Fire sprite
 
Quote:

Originally Posted by Vieni (Post 2704429)
When you edited the sprite, did you rename it to something else? As this the new would be downloaded.

If you did so, I'd suggest to try recreating it as "vp_parallel", if ain't working, set the format to indexalpha, maxbe the black ain't the needed black, so the first pixels will be picked to set the transparency.

If still not working, I'd play with the flags:
HTML Code:

TEFIRE_FLAG_ALLFLOAT        1        // All sprites will drift upwards as they animate
TEFIRE_FLAG_SOMEFLOAT      2        // Some of the sprites will drift upwards. (50% chance)
TEFIRE_FLAG_LOOP            4        // If set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
TEFIRE_FLAG_ALPHA          8        // If set, sprite is rendered alpha blended at 50% else, opaque
TEFIRE_FLAG_PLANAR          16      // If set, all fire sprites have same initial Z instead of randomly filling a cube.


It was necessary to change everything

PHP Code:

write_byteTEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA ); 

>>>>
PHP Code:

write_byte50 ); 

Above 50 - black background


All times are GMT -4. The time now is 23:45.

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