Raised This Month: $51 Target: $400
 12% 

[HL2DM] Customguns


Post New Thread Reply   
 
Thread Tools Display Modes
ChoclatePancake
Junior Member
Join Date: Sep 2009
Old 01-14-2017 , 16:10   Re: [HL2DM] Customguns
Reply With Quote #31

Quote:
Originally Posted by Alienmario View Post
although a definite breaker would be if synergy lacked the weapon_cubemap entity.
If you want to try you'll need synergy's linux server file to get the offsets, convert either with this dumper or manually
Thanks man ill look into this

Quote:
Originally Posted by Alienmario View Post
Btw does synergy have any built-in support for custom weapons?
Well the models materials and script files can be sent to and downloaded by clients
but i tried giving myself the weapon_hands that was used in this plugin and even though i have the weapon_hands.txt in the server's scripts folder (where there are already stock weapons like weapon_slam) it didnt turn up as a vaild entity
so perhaps theres a step i dont know of where you actually register that weapon_hands.txt as an entity
if so id love to find out how to do that!

also as a side note id love to find out how to create new npcs because i
have custom models and sounds for some of the default entities and so i've been working on a plugin that onEntitySpawned if its a certain npc class it's model gets replaced however in game the only class that seems to be getting its model updated is npc_combine_s and i have no idea what im missing or doing wrong, i think perhaps the hook gets called before the npc actually gets its model (even though npc_combine_s gets his damn model) idk for sure heres the code
PHP Code:
public OnEntityCreated(entity, const String:classname[])
{
    
//PrintToServer("[SM] v%s: %d entity spawned.", PLUGIN_VERSION, classname);
    // decl String:playerSlotName[64];
    // GetEntityClassname( entity, playerSlotName, sizeof( playerSlotName ));
    // if ( StrEqual( playerSlotName, "npc_metropolice", false ))
    // {
    //     PrintToServer("[SM] Metropolice found at %s", classname);
    // }
    
SDKHook(entitySDKHook_SpawnOnEntitySpawned);
}

public 
OnEntitySpawned(entity)
{
    
decl String:cheese[128];
    
GetEntityClassnameentitycheesesizeofcheese ));
    if ( 
StrEqualcheese"npc_barney"false ))
    {
        
PrintToServer("[SM] Barney found at %s"cheese);
        
        
decl String:ModelName[256];
        
GetEntPropString(entityProp_Data"m_ModelName"ModelNamesizeof(ModelName));
        if (
StrEqual(ModelName"models/barney.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/barneyhelmet_faceplate.mdl");
            
PrecacheModel("models/ChoclatePancake/barneyhelmet.mdl");
            
PrecacheModel("models/ChoclatePancake/barney.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/barney.mdl");
        }
    }
    if ( 
StrEqualcheese"npc_combine_s"false ))
    {
        
PrintToServer("[SM] %s Given New Model"cheese);
        
// PrecacheModel("models/alyx.mdl");
        // SetEntityModel(entity, "models/alyx.mdl");
        
        
decl String:ModelName[256];
        
GetEntPropString(entityProp_Data"m_ModelName"ModelNamesizeof(ModelName));
        if (
StrEqual(ModelName"models/combine_soldier.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/combine_soldier.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/combine_soldier.mdl");
        }
        if (
StrEqual(ModelName"models/combine_soldier_prisonguard.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/combine_soldier_prisonguard.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/combine_soldier_prisonguard.mdl");
        }
        if (
StrEqual(ModelName"models/combine_super_soldier.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/combine_super_soldier.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/combine_super_soldier.mdl");
        }
    }
    if ( 
StrEqualcheese"npc_metropolice"false ))
    {
        
decl String:MpodelName[256];
        
GetEntPropString(entityProp_Data"m_ModelName"MpodelNamesizeof(MpodelName));
        if (
StrEqual(MpodelName"models/police.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/police.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/police.mdl");
        }
        
PrintToServer("[SM] Metropolice found at %s"cheese);
    }
    if ( 
StrEqualcheese"npc_manhack"false ))
    {
        
PrintToServer("[SM] Manhack found at %s"cheese);
        
PrecacheModel("models/manhacker.mdl");
        
PrecacheSound("sound/npc/manhacker/gib.wav");
        
PrecacheSound("sound/npc/manhacker/mh_engine_loop1.wav");
        
PrecacheSound("sound/npc/manhacker/mh_engine_loop2.wav");
        
SetEntityModel(entity"models/manhacker.mdl");
    }
    
// Just incase those pesky metrocops slip past classname identification!
    
new String:lamaname[128];
    
GetEntPropString(entityProp_Data"m_ModelName"lamaname128);
    if (
StrEqual(lamaname"models/police.mdl"))
    {
        
PrecacheModel("models/ChoclatePancake/police.mdl");
        
SetEntityModel(entity"models/ChoclatePancake/police.mdl");
    }
    else if (
StrEqual(lamaname"models/police_ss.mdl"))
    {
        
PrecacheModel("models/ChoclatePancake/police.mdl");
        
SetEntityModel(entity"models/ChoclatePancake/police.mdl");
    }
    

so if that is the case than im thinking maybe id have to create a new entity like npc_manhacker instead of npc_manhack that gets spawned inplace of that npc_manhack but that might be too complicated for something that i feel like could be done simply

Last edited by ChoclatePancake; 01-14-2017 at 16:13.
ChoclatePancake is offline
ChoclatePancake
Junior Member
Join Date: Sep 2009
Old 01-14-2017 , 16:48   Re: [HL2DM] Customguns
Reply With Quote #32

Alright so with the updated version of customguns i can actually get into my server for a second before it crashes (i havent gotten synergy's gamedata decompiled yet) but i think weapon_cubemap is supported because
http://i.imgur.com/2sRUXjc.jpg

Last edited by ChoclatePancake; 01-14-2017 at 16:51.
ChoclatePancake is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 01-14-2017 , 17:15   Re: [HL2DM] Customguns
Reply With Quote #33

Quote:
Originally Posted by ChoclatePancake View Post
Well the models materials and script files can be sent to and downloaded by clients
The script files don't need to be sent to clients, they're just used on the server.
Quote:
Originally Posted by ChoclatePancake View Post
but i tried giving myself the weapon_hands that was used in this plugin and even though i have the weapon_hands.txt in the server's scripts folder (where there are already stock weapons like weapon_slam) it didnt turn up as a vaild entity
so perhaps theres a step i dont know of where you actually register that weapon_hands.txt as an entity
if so id love to find out how to do that!
This doesn't register custom entities, which is not even possible currently.
You'll have to use the sm_customguns command to spawn new weapons. This is beacause it first creates the weapon_cubemap entity, then immediately sets the classname to the new weapon, tricking the game to load that weapon instead.
Quote:
Originally Posted by ChoclatePancake View Post
also as a side note id love to find out how to create new npcs because i
have custom models and sounds for some of the default entities and so i've been working on a plugin that onEntitySpawned if its a certain npc class it's model gets replaced however in game the only class that seems to be getting its model updated is npc_combine_s and i have no idea what im missing or doing wrong, i think perhaps the hook gets called before the npc actually gets its model (even though npc_combine_s gets his damn model)
Try applying it without the model-name checking first. If that doesn't work try setting the modelIndex datamap property of the npc to the return value of the precache function (also put the precache in OnConfigsExecuted).
I've only used the method you're using on antlions, combines and scanners, but I was spawning them too, not hooking.
Alienmario is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 05-19-2017 , 10:22   Re: [HL2DM] Customguns
Reply With Quote #34

New update includes the ability to modify the wheel menu style and lets players pick whatever style they like.
Previous updates not posted here improved the stability and added more features (like static wheel menu and ordering)

If you were holding on installing, this might be the best time to do so
Alienmario is offline
phoenix valhalla
New Member
Join Date: Dec 2021
Old 12-23-2021 , 04:25   Re: [HL2DM] Customguns
Reply With Quote #35

i have a problem, is not working on my server Hl2 DM
phoenix valhalla is offline
Knock Knock
New Member
Join Date: Feb 2022
Old 02-07-2022 , 05:34   Re: [HL2DM] Customguns
Reply With Quote #36

The plugin works well, except for one issue I am unable to resolve.

Any custom gun always shows a ‘skull & crossbones’, instead of a weapon, when killing an opponent.
In addition, the crosshair is changed from my current default system set crosshair.

It appears that a custom gun does not use the ‘TextureData’ config, as used in default valve weapons, to change or display the preferred icons from a ‘character font’. Therefore it defaults to a font I cannot identify and does not have the ‘character gun’ or Choosable character icon.

Can you let me know if this can be resolved please?

In addition when on server, what would be the skill multiplier for a custom gun, often used for calculating points gained when a kill is done.?
Knock Knock is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 02-07-2022 , 15:01   Re: [HL2DM] Customguns
Reply With Quote #37

This is server side modification only. Crosshair, icons, positions etc are all clientside. You may be able to do something by copying the weapon script to your client, although I haven't tried it.
Alienmario is offline
Knock Knock
New Member
Join Date: Feb 2022
Old 02-09-2022 , 07:51   Re: [HL2DM] Customguns
Reply With Quote #38

Many Thanks for your very prompt reply.

I appreciate your comments and have tried the possible suggested fix. Unfortunately it did not work.

I had made the assumption that your ‘scripts/myweapon.txt’ files were following the valve format where the “texturedata” field lets you specify the font, icons and crosshair for the weapon, which is reflected on the weapon when played.

Bit of an Ask, I know, but would it be possible to add the same feature to your plugin?.

On a side note, i cannot compile any of the existing Sp files supplied in the download, probably because I’m using later versions of sourcemod. Eg:-
“scripting\include\customguns\stocks.inc (329) : error 101: fixed dimensions must be after the array name, not on the type”

------------------------------------------------------------------------------------

*update -- Found that the "Weapon_cubemap.txt" is where the models inherit there icons and crosshairs from. So now i'm ok with the crosshair. The icons may be a bit more of an issue, if there is more than one custom weapon.

Last edited by Knock Knock; 02-09-2022 at 10:12. Reason: New info
Knock Knock is offline
ObsidianPLG
New Member
Join Date: Mar 2022
Old 03-25-2022 , 18:20   Re: [HL2DM] Customguns
Reply With Quote #39

Any way to set shotgun spread? Or is that a plugin thing?
ObsidianPLG is offline
Yaser2007
Junior Member
Join Date: May 2022
Location: Iran
Old 11-01-2022 , 06:59   Re: [HL2DM] Customguns
Reply With Quote #40

Minigun for customguns plugin
Attached Files
File Type: zip weapon_minigun.zip (1.07 MB, 54 views)
File Type: txt game_sounds_weapons_custom.txt (1.6 KB, 47 views)

Last edited by Yaser2007; 11-04-2022 at 10:22.
Yaser2007 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 19:58.


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