Raised This Month: $ Target: $400
 0% 

[Help] func_door lip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 11-30-2009 , 16:28   [Help] func_door lip
Reply With Quote #1

Is it possible to modify a func_door entity's lip value?
__________________
- blupi blupi
ujjl is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2009 , 16:38   Re: [Help] func_door lip
Reply With Quote #2

If you find its offset, then it's possible.
What does lip exactly do ?
Do you have a default map example with a door ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 11-30-2009 , 16:43   Re: [Help] func_door lip
Reply With Quote #3

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

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)
Attached Files
File Type: rar liptest.rar (5.6 KB, 115 views)
__________________
- blupi blupi

Last edited by ujjl; 11-30-2009 at 16:55.
ujjl is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-30-2009 , 16:54   Re: [Help] func_door lip
Reply With Quote #4

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 )
__________________

Last edited by Arkshine; 11-30-2009 at 16:56.
Arkshine is offline
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 11-30-2009 , 16:57   Re: [Help] func_door lip
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
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 ;)
__________________
- blupi blupi
ujjl is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2009 , 17:00   Re: [Help] func_door lip
Reply With Quote #6

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.
};
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-30-2009 at 17:19.
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-30-2009 , 17:01   Re: [Help] func_door lip
Reply With Quote #7

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 ?
__________________
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-30-2009 , 17:18   Re: [Help] func_door lip
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
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.
__________________
Arkshine is offline
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 11-30-2009 , 17:11   Re: [Help] func_door lip
Reply With Quote #9

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 , 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
__________________
- blupi blupi
ujjl is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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