AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help]Reset func_train (https://forums.alliedmods.net/showthread.php?t=261312)

Hedgehog Fog 04-17-2015 15:41

Re: [Help]Reset func_train
 
I still haven't found a solution...

Arkshine 04-17-2015 16:56

Re: [Help]Reset func_train
 
Assuming calling Restart is not enough, what is your issue exactly? Are you saying HL1 is bugged around func_train?

Hedgehog Fog 04-17-2015 17:41

Re: [Help]Reset func_train
 
I need to reset all func_train values(target, activation, current target etc.), HAM_CS_Restart isn't enough for this.

Arkshine 04-17-2015 17:55

Re: [Help]Reset func_train
 
You don't answer really.

Hedgehog Fog 04-17-2015 18:01

Re: [Help]Reset func_train
 
1 Attachment(s)
PHP Code:


new const Float:g_vecZero[3] = {0.00.00.0};

//const m_flWait = 44;
//const m_toggle_state = 41;

//func_train
const m_pevCurrentTarget 79;
//const m_sounds = 79;
const m_activated 81;
const 
m_pfnThink 4;
const 
m_pfnCallWhenMoveDone 64;
new const 
m_vecFinalDest[3] = {65, ...};
new const 
m_vecFinalAngle[3] = {68, ...};
//const m_hEnemy_serialnumber = 85;
//const m_hTargetEnt = 86;
//const m_hEnemy = 84;

public ent_reset_train(ent)
{
    if(!
get_cvar_num("zi_reset_train"))
        return 
0;
    
    static 
target[32];
    
    for(new 
0entTrainsNumi++)
    {
        if(
entTrainFirstTarget[i][_trainID] == ent)
        {
            
copy(targetcharsmax(target), entTrainFirstTarget[i][_trainFirstTarget]);
            break;
        }
    }
    
    
set_pev(entpev_velocityg_vecZero);
    
set_pev(entpev_targettarget);
    
set_pev(entpev_enemy0);
    
set_pev(entpev_message0);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_TRAIN_WAIT_RETRIGGER);
    
set_pev(entpev_nextthink0);
    
    
set_pdata_int(entm_activated0);
    
set_pdata_int(entm_pevCurrentTarget0);
    
set_pdata_int(entm_pfnCallWhenMoveDone0);
    
    for(new 
03i++)
    {
        
set_pdata_float(entm_vecFinalDest[i], g_vecZero[i]);
        
set_pdata_float(entm_vecFinalAngle[i], g_vecZero[i]);
    }
    
    
set_pdata_int(entm_pfnThink0);
    
    
//dllfunc(DLLFunc_Think, ent);
    
ExecuteHamB(Ham_CS_Restartent);
    
    return 
0;


Quote:

what is your issue exactly?
Train emit sound and moving in the wrong direction after activation.

Quote:

Are you saying HL1 is bugged around func_train?
I think yes.

Here test map:

Hedgehog Fog 04-18-2015 07:09

Re: [Help]Reset func_train
 
I fixed it. I'll write about it later.

safetymoose 07-06-2015 18:33

Re: [Help]Reset func_train
 
so did you get it working?


All times are GMT -4. The time now is 02:48.

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