AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [ANY] HL2 items (1.5.2) (https://forums.alliedmods.net/showthread.php?t=268065)

kadet.89 08-04-2015 08:05

[ANY] HL2 items (1.5.2)
 
9 Attachment(s)
https://forums.alliedmods.net/attach...4&d=1438764611

This extension adds some half life 2 items to the game:

Code:

item_healthcharger                (recharges health)
item_suitcharger                (recharges armor in CSS,but you can charge anything you want)
item_healthkit                        ( +25HP)
item_battery                        ( +10 armor)
item_healthvial                        ( +10HP)
item_antidote                        ( does nothig yet)

Cvars:
sk_healthkit 25 (max amount of hp to restore with item_healthkit )
sk_healthcharger 25 (max amount of hp to restore with item_healthcharger )
sk_suitcharger 25 (max amount of armor to restore with item_suitcharger )
sk_suitcharger_citadel 25
sk_suitcharger_citadel_maxarmor 50

KeyValues (properties) and inputs/outputs work fine. But, as hummer does not support these items, all the properties should be specified manually:

Code:

entity
{
        "id" "276"
        "classname" "item_healthcharger"
        "angles" "0 90 0"
        connections
        {
                "OnPlayerUse" "light,Toggle,,0,-1"
        }
        "origin" "-372 32 89.8277"
}

It works well with my windows server, but, as it's based on the tfdodgeball extension and has got all the necessary signatures and offsets for linux, it should work under linux as well. All the gametype -specific staff has been cut off (except for css armor), the extension should work well with any source engine game

links:
CSS NPC https://forums.alliedmods.net/showthread.php?t=161331 (they are going to close code.google.com!!)
TFDodgeball https://forums.alliedmods.net/showthread.php?t=127034
CEntity https://forums.alliedmods.net/showthread.php?t=87500

TODO:
add item_longjump
add item_item_crate
add *ammo items
add npc_*

Special thanks to asherkin, pRED* and raydan

requirements:
SourceMod 1.7.2

how to use:
1) You can add these entities to your maps directly with the hummer editor
2) If you want to see this entities on the classic maps without recompilation, you may use this extension: https://forums.alliedmods.net/showthread.php?t=39439

A useful video about signing: https://www.youtube.com/watch?v=4T03pckoB5g

You can now add any new entity type to the game (including NPC)
Feel free to ask me any questions in this thread

kadet.89 08-05-2015 11:54

Re: [ANY] HL2 items (1.5.1)
 
The extension is updated. datamaps, inputs, outputs, keyvalues (properties) now work

DJPlaya 07-18-2016 21:18

Re: [ANY] HL2 items (1.5.2)
 
Does it still work?
"based on the tfdodgeball extension" - "TFDodgeball... dose't currently work correctly"

kadet.89 07-23-2016 09:44

Re: [ANY] HL2 items (1.5.2)
 
Yes, it still works under linux/windows

Mayor Gamer 07-26-2016 05:32

Re: [ANY] HL2 items (1.5.2)
 
So this extension adds actually working Half-Life 2 items?
Been so long since I wanted this to be done. Good job! I'll test it when I come back home. It seems great.

kadet.89 09-16-2016 15:10

Re: [ANY] HL2 items (1.5.2)
 
2 Attachment(s)
Mayor Gamer, yes its a full port if the items (with sounds, effects and animations)

Linux build for cs:s.

blacklagoon 09-16-2016 18:30

Re: [ANY] HL2 items (1.5.2)
 
Thanks man!

kadet.89 09-17-2016 03:23

Re: [ANY] HL2 items (1.5.2)
 
A linux instruction is attached. I've also attached my AMBuildScript.7z to the thread. If you build a release version (not debug) remove this: '-Wno-error' from it. There are some bad mistakes in the extension that can't be ignored. This line: -stdlib=libstdc++' forces the compiler to build the extension statically with libstdc, it may not be necessary.
For windows use this:

Start/Пуск -> Settings (Optional)-> Control Panel/Панель управление -> System/Система -> Advanced/Дополнительные параметры системы -> Environment Variables/Параметры среды

ADD:
HL2SDKCSS C:\...\...\hl2sdk-css
MMSOURCE C:\...\...\mmsource
SOURCEMOD C:\...\...\sourcemod-central

Then replace the variables here: msvc10/sdk.vcxproj

And I'm afraid it may be difficult to build the windows version against the recent source sdk

blacklagoon 09-19-2016 17:27

Re: [ANY] HL2 items (1.5.2)
 
Hey, i've got it successfully build for csgo but i can't find where to get these offsets (All i found was in CCSPlayer):
Code:

                        "GetClientEyeAngles" // Only found CBasePlayer::EyeAngles()
                        {
                                "windows"      "129"
                                "linux"        "130"
                        }
                        "GetRadius"
                        {
                                "windows"      "227"
                                "linux"        "228"
                        }
                       
                        "DeflectPlayer"
                        {
                                "windows"      "402"
                                "linux"        "409"
                        }
                        "DispatchKeyValue"
                        {
                                "windows"        "31"
                                "linux"        "30"
                        }
                        "DispatchKeyValueVector"
                        {
                                "windows"        "29"
                                "linux"        "32"
                        }
                        "DispatchKeyValueFloat"
                        {
                                "windows"        "30"
                                "linux"        "31"
                        }


kadet.89 09-20-2016 08:37

Re: [ANY] HL2 items (1.5.2)
 
GetClientEyeAngles:
PHP Code:

int m_angEyeAngles = -1;
QAngle *GetEyeAngles(CBaseEntity *pEntity)
{    
    return (
QAngle *)(((unsigned char *)pEntity) + m_angEyeAngles);    
}
bool Extension::SDK_OnLoad(char *errorsize_t maxlengthbool late)
{
    
gamehelpers->FindSendPropInfo("CCSPlayer""m_angEyeAngles[0]", &info); //uncomment SMEXT_ENABLE_GAMEHELPERS in the smsdk_config.h
    
m_angEyeAngles info.actual_offset;


PHP Code:

#include <itoolentity.h>
IServerTools *servertools NULL;

bool Extension::SDK_OnMetamodLoad(ISmmAPI *ismmchar *errorsize_t maxlenbool late)
{
    
GET_V_IFACE_ANY(GetServerFactoryservertoolsIServerToolsVSERVERTOOLS_INTERFACE_VERSION);


servertools::SetKeyValue is the equal to DispatchKey*

Quote:

// entity query
virtual bool GetKeyValue( CBaseEntity *pEntity, const char *szField, char *szValue, int iMaxLen ) = 0;
virtual bool SetKeyValue( CBaseEntity *pEntity, const char *szField, const char *szValue ) = 0;
virtual bool SetKeyValue( CBaseEntity *pEntity, const char *szField, float flValue ) = 0;
virtual bool SetKeyValue( CBaseEntity *pEntity, const char *szField, const Vector &vecValue ) = 0;
As to the other functions, I'm pretty sure they are member functions, but to find their offsets first we need to know their base classes.


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

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