AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Adding a glowing efect (https://forums.alliedmods.net/showthread.php?t=105688)

StormZone 10-07-2009 07:14

Adding a glowing efect
 
Heloo again.
So this is a part of an ultimate form uwc3,wath i want to do is to make the one ho uses this to glow as long as the ultimate is active.
The glowing should be yelow or gold.
Y tried some methods but not glowing.Y would realy apreciate if someone should show me how to make this.

PHP Code:

/* VooDoo */
public Ult_VooDoo id )
{

    if ( !
Ult_Can_Use idSKILLIDX_VOODOO) )
    {
        return 
PLUGIN_HANDLED;
    }

    if ( !
ultimateused[id] )
    {
        new 
parm[2];
        
parm[0] = id;
        
parm[1] = 3;

        
godshealth[id] = get_user_health id );
        
hasgodmode[id] = true;

        
set_user_health_log idget_user_health id ) + 2048 );

        new 
Float:fTime 5.0;
        new 
iByte 4;

        if ( 
USE_ENH && ( p_attribs[id][ATTRIBIDX_INT] >= INT_MASTER_LEVEL ) )
        {
            
iByte 4;
            
fTime 5.0;
        }
        else
        {
            
fTime 3.0;
            
iByte 2;
        }

        
set_task fTime"Task_Reset_Godmode"TASK_RESET_GODMODE idparm);

        if( 
Util_Should_Msg_Client(id) )
        {
            
message_begin MSG_ONE108, { 00}, id );

            
// Bar ( thanks to bad-at-this )
            // duration
            
write_byte iByte );

            
// duration
            
write_byte );

            
message_end ( );
        }

        if( 
Util_Should_Msg_Client_Aliveid ) )
        {
            if ( 
file_exists "sound/warcraft3/divineshield.wav" ) == )
            {
                
emit_sound idCHAN_STATIC"warcraft3/divineshield.wav"1.0ATTN_NORM0PITCH_NORM );
            }
        }

        
ultimateused[id] = true;
        
icon_controller id );
    }

    return 
PLUGIN_HANDLED;




tolsty 10-07-2009 08:38

Re: Adding a glowing efect
 
post full plugin sourcecode

StormZone 10-07-2009 12:55

Re: Adding a glowing efect
 
There are more files.
It uwc3 1.7.55
wich ones do you want?

Arkshine 10-07-2009 13:02

Re: Adding a glowing efect
 
What did you try?

StormZone 10-07-2009 16:06

Re: Adding a glowing efect
 
This is a part of the Shadow Hunter from war3ft(has the voodoo ultimate) and in this version it glous.
PHP Code:

// ****************************************
// Shadow Hunter's Big Bad Voodoo
// ****************************************

public SH_Ult_BigBadVoodooid )
{
    if ( !
p_data_b[id][PB_ISCONNECTED] )
    {
        return;
    }

    
p_data_b[id][PB_GODMODE] = true;

    
p_data_b[id][PB_CAN_RENDER] = false;

    
ULT_ResetCooldownidget_pcvar_numCVAR_wc3_ult_cooldown ) + SH_BIGBADVOODOO_DURATIONfalse );

    
ULT_IconidICON_FLASH );
    
    if ( 
g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
    {
        
Create_BarTimeidSH_BIGBADVOODOO_DURATION);
    }
        
    
emit_soundidCHAN_STATICg_szSounds[SOUND_VOODOO], 1.0ATTN_NORM0PITCH_NORM );

    
set_user_renderingidkRenderFxGlowShell25524550kRenderNormal16 );

    new 
vOrigin[3];
    
get_user_originidvOrigin );
    
vOrigin[2] += 75;

    
Create_TE_ELIGHTidvOrigin100255245200SH_BIGBADVOODOO_DURATION);

    
set_taskfloatSH_BIGBADVOODOO_DURATION ), "SH_Ult_Remove"TASK_RESETGOD id );

    return;


it think this is the glowing task but dont know how to make it for uwc3 mode.

PHP Code:

   Create_TE_ELIGHTidvOrigin100255245200SH_BIGBADVOODOO_DURATION);

    
set_taskfloatSH_BIGBADVOODOO_DURATION ), "SH_Ult_Remove"TASK_RESETGOD id ); 


tolsty 10-07-2009 17:42

Re: Adding a glowing efect
 
1)this is to set glow:
set_user_rendering( id, kRenderFxGlowShell, 255, 245, 50, kRenderNormal, 16 );
2)this to remove it:
set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 16 );

Set the glow in the ultimate function after emit_sound, and find a function like Task_Reset_Godmode or whatever, this is the line how to recognize where the ultimate is removed
set_task ( fTime,"Task_Reset_Godmode", TASK_RESET_GODMODE + id, parm, 2 );

and in that function remove the glow.

StormZone 10-07-2009 21:00

Re: Adding a glowing efect
 
Here is how y did it?
PHP Code:

/* VooDoo */
public Ult_VooDoo id )
{

    if ( !
Ult_Can_Use idSKILLIDX_VOODOO) )
    {
        return 
PLUGIN_HANDLED;
    }

    if ( !
ultimateused[id] )
    {
        new 
parm[2];
        
parm[0] = id;
        
parm[1] = 3;

        
godshealth[id] = get_user_health id );
        
hasgodmode[id] = true;

        
set_user_health_log idget_user_health id ) + 2048 );

        new 
Float:fTime 5.0;
        new 
iByte 4;

        if ( 
USE_ENH && ( p_attribs[id][ATTRIBIDX_INT] >= INT_MASTER_LEVEL ) )
        {
            
iByte 4;
            
fTime 5.0;
        }
        else
        {
            
fTime 3.0;
            
iByte 2;
        }

        
set_task fTime"Task_Reset_Godmode"TASK_RESET_GODMODE idparm);
        
set_user_renderingidkRenderFxGlowShell000kRenderNormal16 );

        if( 
Util_Should_Msg_Client(id) )
        {
            
message_begin MSG_ONE108, { 00}, id );

            
// Bar ( thanks to bad-at-this )
            // duration
            
write_byte iByte );

            
// duration
            
write_byte );

            
message_end ( );
        }

        if( 
Util_Should_Msg_Client_Aliveid ) )
        {
            if ( 
file_exists "sound/warcraft3/divineshield.wav" ) == )
            {
                
emit_sound idCHAN_STATIC"warcraft3/divineshield.wav"1.0ATTN_NORM0PITCH_NORM );
                
set_user_renderingidkRenderFxGlowShell25524550kRenderNormal16 );
            }
        }

        
ultimateused[id] = true;
        
icon_controller id );
    }

    return 
PLUGIN_HANDLED;



The glowing works but the problem is that is not desepearing on the ultimate time over and when you shot or switch weapon.Did y placed the set_.. rong?

tolsty 10-08-2009 02:33

Re: Adding a glowing efect
 
you dont have to set the glow 2 times in a function

in this case remove
PHP Code:

 if( Util_Should_Msg_Client_Aliveid ) )
        {
            if ( 
file_exists "sound/warcraft3/divineshield.wav" ) == )
            {
                
emit_sound idCHAN_STATIC"warcraft3/divineshield.wav"1.0ATTN_NORM0PITCH_NORM );
                
// remove me !set_user_rendering( id, kRenderFxGlowShell, 255, 245, 50, kRenderNormal, 16 );
            
}
        } 

its already is set here
PHP Code:

        }

        
set_task fTime"Task_Reset_Godmode"TASK_RESET_GODMODE idparm);
        
set_user_renderingidkRenderFxGlowShell000kRenderNormal16 );

        if( 
Util_Should_Msg_Client(id) )
        { 

and find somewhere in the code "public Task_Reset_Godmode(playerid)"
in this funtion remove the glow, to remove it add this line
set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 16 );

and search for lines like:
remove_task(TASK_RESET_GODMODE + id)
TASK_RESET_GODMODE( id )
, before those remove the glow


StormZone 10-08-2009 04:17

Re: Adding a glowing efect
 
So here it how y did it.
This is the code from ultimates.inl (the file where the ultimates functions are stored)

PHP Code:

/* VooDoo */
public Ult_VooDoo id )
{

    if ( !
Ult_Can_Use idSKILLIDX_VOODOO) )
    {
        return 
PLUGIN_HANDLED;
    }

    if ( !
ultimateused[id] )
    {
        new 
parm[2];
        
parm[0] = id;
        
parm[1] = 3;

        
godshealth[id] = get_user_health id );
        
hasgodmode[id] = true;

        
set_user_health_log idget_user_health id ) + 2048 );

        new 
Float:fTime 5.0;
        new 
iByte 4;

        if ( 
USE_ENH && ( p_attribs[id][ATTRIBIDX_INT] >= INT_MASTER_LEVEL ) )
        {
            
iByte 4;
            
fTime 5.0;
        }
        else
        {
            
fTime 3.0;
            
iByte 2;
        }

        
set_task fTime"Task_Reset_Godmode"TASK_RESET_GODMODE idparm);

        if( 
Util_Should_Msg_Client(id) )
        {
            
message_begin MSG_ONE108, { 00}, id );

            
// Bar ( thanks to bad-at-this )
            // duration
            
write_byte iByte );

            
// duration
            
write_byte );

            
message_end ( );
        }

        if( 
Util_Should_Msg_Client_Aliveid ) )
        {
            if ( 
file_exists "sound/warcraft3/divineshield.wav" ) == )
            {
                
emit_sound idCHAN_STATIC"warcraft3/divineshield.wav"1.0ATTN_NORM0PITCH_NORM );
                
set_user_renderingidkRenderFxGlowShell25524550kRenderNormal16 );
            }
        }

        
ultimateused[id] = true;
        
icon_controller id );
    }

    return 
PLUGIN_HANDLED;



and this to task.inl (where the tasks are stored)
PHP Code:

/* voodoo */
public Task_Reset_Godmode parm[] )
{
    new 
id parm[0];

    new 
name[32];
    
get_user_name idname31 );

    if ( 
godshealth[id] < )
    {
        
set_user_health_log id30 );
    }
    else
    {
        
set_user_health_log idgodshealth[id] );
    }

    
hasgodmode[id] = false;

    
set_task CVAR_VOODOO_COOLDOWN"cooldown"TASK_COOLDOWN_RESET idparm);
    
set_user_renderingidkRenderFxGlowShell000kRenderNormal16 );

    if( 
Util_Should_Msg_Client(id) )
    {
        
set_hudmessage 010000.050.7520.0210.00.010.1);
        
show_hudmessage id"Your Voodoo has expired" );
    }

    
icon_controller id );

    return 
PLUGIN_CONTINUE;


Now it works.The glowing apears and disapears after the voodoo is gone but when in voodoo mode if y shot or switch weapon or enithing else besides moving and jumping it disapears.
Why?

StormZone 10-08-2009 11:21

Re: Adding a glowing efect
 
Some help plese.It almost done but how do y fix that?


All times are GMT -4. The time now is 22:39.

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