AlliedModders

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

ujjl 11-30-2009 16:28

[Help] func_door lip
 
Is it possible to modify a func_door entity's lip value?

ConnorMcLeod 11-30-2009 16:38

Re: [Help] func_door lip
 
If you find its offset, then it's possible.
What does lip exactly do ?
Do you have a default map example with a door ?

ujjl 11-30-2009 16:43

Re: [Help] func_door lip
 
1 Attachment(s)
when you got a 100 wide door, and you open it with lip=0, then it will slide to the left (or right) with 100 (eg it opens fully). If you set lip to 50, it will only slide 100-50=50 to the left, and it will open just half, or if you set it -100 then the door will go away :D

Example map with one door in it (and a light, and player_start) the door's lip is set to 50 (you can see, its not opens fully) wait (delay before close), is set to 2, and speed (moving speed) is 100 (only for half-life i think)

Arkshine 11-30-2009 16:54

Re: [Help] func_door lip
 
Since the m_flLip seems to be used at spawn only for func_door entities, I guess you can simply alter/add the keyvalue "lip" with the value you want at map start when the entities are spawned. ( using pnf_keyvalue() for FM_KeyValue forward I guess )

ujjl 11-30-2009 16:57

Re: [Help] func_door lip
 
Quote:

Originally Posted by Arkshine (Post 1003389)
Since the m_flLip seems to be used at spawn only for func_door entities, I guess you can simply alter/add the keyvalue "lip" with the value you want at map start when the entities are spawned. ( pnf_keyvalue() for FM_KeyValue forward I guess )

Is it possible to alter this value ingame? (I want an admins only door ;)

ConnorMcLeod 11-30-2009 17:00

Re: [Help] func_door lip
 
And it only affect m_vecPosition2, may be you could just alter that last one for your needs.

What you mean "admin doors", how it is related to lip value ?

-Edit-
m_flLip is 32 (on windows), linux diff could be 4 or 5 i dunno.
You can alter it before the ent spawn, or directly in spawn (pre-hook) using set_pdata_float(iDoor, m_flLip, FloatValue, LinuxDiff)

If you want to find linux diff, run this on linux server and look at server console at map start :

PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("Door Lip Offset"VERSION"ConnorMcLeod")

    
Create_Door()
}

public 
plugin_precache()
{
    new 
iEnt create_entity("func_door")
    if( 
iEnt )
    {
        
DispatchSpawn(iEnt)
        
remove_entity(iEnt)
    }
}

Create_Door()
{
    new 
iEnt create_entity("func_door")
    if( 
iEnt )
    {
        
DispatchKeyValue(iEnt"lip""0.1337")
        
DispatchSpawn(iEnt)
        if( 
pev_valid(iEnt) == )
        {
            for(new 
i=1i<100i++)
            {
                if( 
get_pdata_float(iEnti0) == 0.1337 )
                {
                    
server_print("Offset %d could be m_flLip"i)
                }
            }
        }
        else
        {
            
server_print("Not valid ent %d"iEnt)
        }
    }


From HLSDK, doors offsets should be :

Code:

const m_toggle_state = 28
const m_flActivateFinished = 29//like attack_finished, but for doors
const m_flMoveDistance = 30// how far a door should slide or rotate
const m_flWait = 31
const m_flLip = 32
const m_flTWidth = 33// for plats
const m_flTLength = 34// for plats

const m_vecPosition1_x = 35;
const m_vecPosition1_y = 36
const m_vecPosition1_z = 37
/*
        Vector                                m_vecPosition2; 38 39 40
        Vector                                m_vecAngle1; 41 42 43
        Vector                                m_vecAngle2; 44 45 46
*/
const m_cTriggersLeft = 47;                // trigger_counter only, # of activations remaining
const m_flHeight = 48;
const m_hActivator = 49
//        void (CBaseToggle::*m_pfnCallWhenMoveDone)(void); // 50 ?
/*        Vector                                m_vecFinalDest; //51 52 53 ?
        Vector                                m_vecFinalAngle; // 54 55 56

        int                                        m_bitsDamageInflict; // 57 ? */

Code:

class CBaseToggle : public CBaseAnimating
{
public:
        void                                KeyValue( KeyValueData *pkvd );

        TOGGLE_STATE                m_toggle_state;
        float                                m_flActivateFinished;//like attack_finished, but for doors
        float                                m_flMoveDistance;// how far a door should slide or rotate
        float                                m_flWait;
        float                                m_flLip;
        float                                m_flTWidth;// for plats
        float                                m_flTLength;// for plats

        Vector                                m_vecPosition1;
        Vector                                m_vecPosition2;
        Vector                                m_vecAngle1;
        Vector                                m_vecAngle2;

        int                                        m_cTriggersLeft;                // trigger_counter only, # of activations remaining
        float                                m_flHeight;
        EHANDLE                                m_hActivator;
        void (CBaseToggle::*m_pfnCallWhenMoveDone)(void);
        Vector                                m_vecFinalDest;
        Vector                                m_vecFinalAngle;

        int                                        m_bitsDamageInflict;        // DMG_ damage type that the door or tigger does

        virtual int                Save( CSave &save );
        virtual int                Restore( CRestore &restore );

        static        TYPEDESCRIPTION m_SaveData[];

        virtual int                GetToggleState( void ) { return m_toggle_state; }
        virtual float        GetDelay( void ) { return m_flWait; }

        // common member functions
        void LinearMove( Vector        vecDest, float flSpeed );
        void EXPORT LinearMoveDone( void );
        void AngularMove( Vector vecDestAngle, float flSpeed );
        void EXPORT AngularMoveDone( void );
        BOOL IsLockedByMaster( void );

        static float                AxisValue( int flags, const Vector &angles );
        static void                        AxisDir( entvars_t *pev );
        static float                AxisDelta( int flags, const Vector &angle1, const Vector &angle2 );

        string_t m_sMaster;                // If this button has a master switch, this is the targetname.
                                                        // A master switch must be of the multisource type. If all
                                                        // of the switches in the multisource have been triggered, then
                                                        // the button will be allowed to operate. Otherwise, it will be
                                                        // deactivated.
};


Arkshine 11-30-2009 17:01

Re: [Help] func_door lip
 
I don't understand "(I want an admins only door ;)

In-game ; you could try to find the entity index, then altering the keyvalue "lip" (DispathKeyValue) and respawning it. (DispatchSpawn)

What are you trying to do exactly ?

ujjl 11-30-2009 17:11

Re: [Help] func_door lip
 
I have a map where is a room with lots of cool stuff in it (ammo, health, etc) But for joke, the map maker set the room's door's lip high, so the door not opens, just a bit (like it is broken), so me (and other admins) want to go inside :D, but i dont want to leave that door open, because then everyone get there in, and then it will be no more fun to go inside. So i want an admin command "door_open" and "door_close" what sets the lip to 0 and back to 100

Arkshine 11-30-2009 17:18

Re: [Help] func_door lip
 
Quote:

Originally Posted by Arkshine (Post 1003397)
In-game ; you could try to find the entity index, then altering the keyvalue "lip" (DispathKeyValue) and respawning it. (DispatchSpawn)

The most simple way would be something that. Give a try.


All times are GMT -4. The time now is 13:41.

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