Raised This Month: $32 Target: $400
 8% 

[L4D & L4D2] Mission and Weapons - Info Editor (1.25) [25-Oct-2023]


Post New Thread Reply   
 
Thread Tools Display Modes
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 01-30-2019 , 22:08   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.0) [10-Sep-2018]
Reply With Quote #11

Quote:
Originally Posted by Surf3rDud3 View Post
[...]
Here's the updated Windows signature for L4D2.
PHP Code:
"CTerrorGameRules::GetMissionInfo"
{
    
"library"        "server"
    "linux"            "@_ZN16CTerrorGameRules14GetMissionInfoEv"
    "windows"        "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x8B\x01\x8B\x50\x28\x56\xFF\xD2\x8B\x10\x8B\xC8\x8B\x42"
    
/* ? ? ? ? ? ? ? ? ? ? 8B 01 8B 50 28 56 FF D2 8B 10 8B C8 8B 42 */


Last edited by cravenge; 01-30-2019 at 22:10.
cravenge is offline
sirphr
Member
Join Date: Jun 2010
Location: Florida, USA
Old 01-30-2019 , 22:36   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.0) [10-Sep-2018]
Reply With Quote #12

Thank you good sir.

Edit: For those who are too lazy.
Attached Files
File Type: txt l4d_info_editor.txt (5.6 KB, 426 views)
__________________

Last edited by sirphr; 01-30-2019 at 22:44.
sirphr is offline
BlackSabbarh
Senior Member
Join Date: Sep 2018
Old 03-22-2019 , 03:36   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.0) [10-Sep-2018]
Reply With Quote #13

I get this error in l4d1?



[SM] Blaming: l4d_info_editor.smx
[SM] Call stack trace:
[SM] [0] SMCParser.GetErrorString
[SM] [1] Line 310, l4d_info_editor.sp:arseConfigFile
[SM] [2] Line 292, l4d_info_editor.sp::LoadConfig
[SM] [3] Line 133, l4d_info_editor.sp::OnPluginStart
[SM] Unable to load plugin "l4d_info_editor.smx": Error detected in plugin startup (see error logs)
BlackSabbarh is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-01-2019 , 18:04   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.1) [01-Jun-2019]
Reply With Quote #14

Finally the update is here, suggest updating to fix previous errors. Provides more functionality.

Quote:
1.1 (01-Jun-2019)
- Fixed reading incorrect data for map specific sections.
- Added support to load map specific weapon and melee data.
- Added commands to display mission and weapon changes applied to the current map.
- Added a command to get and set keyname values from the mission info.
- Added a command to reload the mission and weapons configs. Live changes can be made!
- Added natives to read and write mission and weapon data from third party plugins.
- Added test plugin to demonstrate natives and forwards for developers.
- Gamedata .txt changed.
__________________
Silvers is offline
Xanaguy
Senior Member
Join Date: Jan 2017
Old 06-01-2019 , 23:10   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.1) [01-Jun-2019]
Reply With Quote #15

For some odd reason, dhooks is not cooperating. Any way to remedy this?

Edit: Resolved. Nextmaps must be deleted.

Last edited by Xanaguy; 06-03-2019 at 08:02.
Xanaguy is offline
huwong
Junior Member
Join Date: Mar 2018
Old 07-29-2019 , 06:02   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.1.1) [09-Jun-2019]
Reply With Quote #16

After I use this plugin, my server will crash from time to time.
https://crash.limetech.org/lfqdv2hjv3ct
Quote:
server_srv.so!CTerrorWeaponInfo::Reload() + 0x3f
Setting:
Code:
"weapon_info"
{
	"all"
	{
	// Incapped Weapons
	// Uncomment the following to enable usage of weapons while incapped by changing "WeaponType" to "pistol"
		"weapon_chainsaw"
		{
			"WeaponType"			"pistol"
		}
		"weapon_melee"
		{
			"WeaponType"			"pistol"
		}
		"weapon_pistol"
		{
			"WeaponType"			"pistol"
			"clip_size"				"125"
		}
		"weapon_pistol_magnum"
		{
			"WeaponType"			"pistol"
			"clip_size"				"250"
		}
		"weapon_molotov"
		{
			"WeaponType"			"pistol"
		}
		"weapon_vomitjar"
		{
			"WeaponType"			"pistol"
		}
		"weapon_pipe_bomb"
		{
			"WeaponType"			"pistol"
		}
		"weapon_grenade_launcher"
		{
			"WeaponType"			"pistol"
		}
		"weapon_rifle"
		{
			"WeaponType"			"pistol"
		}
		"weapon_rifle_ak47"
		{
			"WeaponType"			"pistol"
		}
		"weapon_rifle_desert"
		{
			"WeaponType"			"pistol"
		}
		"weapon_rifle_m60"
		{
			"WeaponType"			"pistol"
		}
		"weapon_smg"
		{
			"WeaponType"			"pistol"
		}
		"weapon_smg_mp5"
		{
			"WeaponType"			"pistol"
		}
		"weapon_smg_silenced"
		{
			"WeaponType"			"pistol"
		}
		"weapon_rifle_sg552"
		{
			"WeaponType"			"pistol"
		}
		"weapon_autoshotgun"
		{
			"WeaponType"			"pistol"
		}
		"weapon_shotgun_spas"
		{
			"WeaponType"			"pistol"
		}
		"weapon_hunting_rifle"
		{
			"WeaponType"			"pistol"
		}
		"weapon_sniper_awp"
		{
			"WeaponType"			"pistol"
		}
		"weapon_sniper_military"
		{
			"WeaponType"			"pistol"
		}
		"weapon_sniper_scout"
		{
			"WeaponType"			"pistol"
		}
	}
}

"mission_info"
{
	// The "all" section must be above map specific sections. Any partial matching map names will overwrite duplicate data from the "all" section.
	"all"
	{
		// Allowed melee weapons for the map - Replaces: [EXTENSION] [L4D2] Melee Spawn Control https://forums.alliedmods.net/showthread.php?t=222535
		// WORKS
		"meleeweapons"								"fireaxe;frying_pan;machete;baseball_bat;crowbar;cricket_bat;tonfa;katana;electric_guitar;knife;golfclub"

		// Can't have female Boomers because there's no audio support
		// WORKS
		"no_female_boomers"
	}
}
huwong is offline
moekai
Member
Join Date: Jul 2019
Old 08-21-2019 , 18:52   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.1.1) [09-Jun-2019]
Reply With Quote #17

This is awesome. Thank you so much for this. Do you think you can add a command to get and set keyname values for the weapon info too?
moekai is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 08-21-2019 , 19:07   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.1.1) [09-Jun-2019]
Reply With Quote #18

Quote:
Originally Posted by moekai View Post
This is awesome. Thank you so much for this. Do you think you can add a command to get and set keyname values for the weapon info too?
Not possible, once the data is read its saved somewhere else and the addresses become invalid. I tried.
__________________
Silvers is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 08-23-2019 , 01:10   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.1.1) [09-Jun-2019]
Reply With Quote #19

Can you add the ability to read the data as well, at least for weapons. I know it is possible, because Downtown extension has that feature.
__________________
Spirit_12 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 08-23-2019 , 02:20   Re: [L4D & L4D2] Mission and Weapons - Info Editor (1.1.1) [09-Jun-2019]
Reply With Quote #20

As above, its not possible the way this plugin works.

Use the natives to write a plugin which reads the data. Use the sm_info_reload command to force it to reload and read the data when you want.


Example to get and set value via natives/forwards:

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <l4d_info_editor>

#define MAX_STRING_LENGTH        4096

public void OnPluginStart()
{
    
RegAdminCmd("sm_info_weapon",    CmdInfoWeaponADMFLAG_ROOT"Get or set a weapon keyname value. Usage: sm_info_weapon <weapon classname> <keyname> [value]");
    
RegAdminCmd("sm_iw",             CmdInfoWeaponTestADMFLAG_ROOT"Tests: sm_info_weapon weapon_rifle clip_size");
}

bool g_bDone;
char g_sClass[MAX_STRING_LENGTH];
char g_sKey[MAX_STRING_LENGTH];
char g_sSet[MAX_STRING_LENGTH];

public 
Action CmdInfoWeaponTest(int clientint args)
{
    
ServerCommand("sm_info_weapon weapon_rifle clip_size");
    
// ServerCommand("sm_info_weapon weapon_rifle clip_size 25"); // Set value of 25.
}

public 
Action CmdInfoWeapon(int clientint args)
{
    if( 
args )
    {
        
ReplyToCommand(client"Usage: sm_info_weapon <weapon classname> <key>");
        return 
Plugin_Handled;
    }

    
GetCmdArg(1g_sClasssizeof g_sClass);
    
GetCmdArg(2g_sKeysizeof g_sKey);

    if( 
args == )
        
GetCmdArg(3g_sSetsizeof g_sSet);
    else
        
g_sSet[0] = '\x0';

    
g_bDone false;
    
ServerCommand("sm_info_reload");

    return 
Plugin_Handled;
}

public 
void OnGetWeaponsInfo(int pThis, const char[] classname)
{
    if( !
g_bDone )
    {
        if( 
strcmp(classnameg_sClass) == )
        {
            if( 
strlen(g_sSet) > )
            {
                
InfoEditor_SetString(pThisg_sKeyg_sSet);
                
PrintToServer("Info_Weapon: Set: %s/%s == %s"g_sClassg_sKeyg_sSet);
            }

            
char sResult[MAX_STRING_LENGTH];
            
InfoEditor_GetString(pThisg_sKeysResultsizeof sResult);
            
PrintToServer("Info_Weapon: %s/%s == %s"g_sClassg_sKeysResult);

            
g_bDone true;
        }
    }

__________________

Last edited by Silvers; 08-23-2019 at 03:13.
Silvers is offline
Reply


Thread Tools
Display Modes

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 18:35.


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