Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 06-21-2012, 05:20 AM   #16
zombie@computer
 
Join Date: Aug 2008
Reputation: 416
Posts: 908
still sounds like it doesnt compile right, or at least does not load the dll's you compiled. Try adding code in some existing weapon and see if that runs.
zombie@computer is offline   Reply With Quote
Old 06-21-2012, 08:48 AM   #17
Zombie Killa
 
Join Date: Jul 2007
Reputation: 0
Posts: 127
I see one problem
Quote:
class CWeaponColt1911 : public CHL2MPMachineGun
{
public:
DECLARE_CLASS( CWeaponColt1911, CHL2MPMachineGun );
should be
Quote:
class CWeaponColt1911 : public CBaseHLCombatWeapon
{
public:
DECLARE_CLASS( CWeaponColt1911, CBaseHLCombatWeapon );
That need's to be matched with the one in the stubs file.

Last edited by Zombie Killa: 06-21-2012 at 08:57 AM.
Zombie Killa is offline   Reply With Quote
Old 07-03-2012, 10:26 AM   #18
Codexofwisdom
 
Join Date: Nov 2011
Reputation: 0
Posts: 11
I notice that tutorial is missing the "add the gun to your sdk_shareddefs" files step (it seems every weapon tutorial misses one step or another). Did you do this?
There should be a tutorial in the docs folder of your mod that will walk you through this, as well.
Codexofwisdom is offline   Reply With Quote
Old 07-04-2012, 09:36 AM   #19
ProZak
 
Join Date: Mar 2004
Reputation: 60
Posts: 678
Is your mod based on singleplayer or Half-Life 2 Deathmatch?
ProZak is offline   Reply With Quote
Old 02-04-2014, 09:55 AM   #20
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
I've got the same error so, I'd like to have the answer !

I try to mutate "weapon_pistol" to "weapon_iphone"

I'm about to do some modification to the "weapon_pistol" and we'll see if that change anything...

PS : I made a single player mod
GabRATM is offline   Reply With Quote
Old 02-04-2014, 09:58 AM   #21
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
PS2 : what is the "add the gun to your sdk_shareddefs" files step ?
GabRATM is offline   Reply With Quote
Old 02-04-2014, 10:04 AM   #22
ATWAR
 
Join Date: Aug 2010
Reputation: 1
Posts: 147
Is the weapon_colt1911.cpp in both the client and server?
ATWAR is offline   Reply With Quote
Old 02-04-2014, 10:58 AM   #23
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
In my vuisual studio 2010, all the weapon_"typeOfWeapon" are in
server / source file / HL2 DLL /
GabRATM is offline   Reply With Quote
Old 02-04-2014, 11:22 AM   #24
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
About the original pistol,

1° I changed the code but without effect while playing :

m_bFiresUnderwater = false; //true in the original
(tested on a map with a cube of water)

VectorLerp( VECTOR_CONE_15DEGREES, VECTOR_CONE_20DEGREES, ramp, cone ); // 1 and 6 in the original

2° Later, I also tried
#define PISTOL_FASTEST_REFIRE_TIME 150f // 0.1 original
#define PISTOL_FASTEST_DRY_REFIRE_TIME 400f // 0.2 original

It gave me an error.

I don't understand.

PS : I had the background01_widescreen.vtf error that I partially solved with this :
http://lambdageneration.com/modding/...a-quick-guide/

Last edited by GabRATM: 02-05-2014 at 04:30 PM. Reason: Added numbers 1° and 2° to clarify the explanation
GabRATM is offline   Reply With Quote
Old 02-05-2014, 02:46 AM   #25
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
I've just check what shareddefs.h is. Very interresting but I don't know what I have to do with this.
Do I have to change any value to let "give weapon_iphone" make appear the iphone in the equipment ?

Code:
#define MAX_WEAPON_SLOTS	6	// hud item selection slots
#define MAX_WEAPON_POSITIONS	20	// max number of items within a slot
#define MAX_ITEM_TYPES		6	// hud item selection slots
#define MAX_WEAPONS		48	// Max number of weapons available

#define MAX_ITEMS		5	// hard coded item types
GabRATM is offline   Reply With Quote
Old 02-05-2014, 11:23 AM   #26
ATWAR
 
Join Date: Aug 2010
Reputation: 1
Posts: 147
You said you're working on a single player mod right?
All you have to do is copy the pistol weapon cpp and make a new one and rename everything besides the Animations and the #define at the beginning
then copy the pistol info in the c_weapon__stubs_hl2 and paste it but change the name to the new weapon name
after compile it

Then copy the weapon_pistol text file in the scripts folder and make the new weapon file after that it should work.

If not and there is no error go into your src\game\server\Release_ and your src\game\client\Release_
You should see a dll for each, server.dll and client.dll
If they are there move them to your mods bin folder
After that it should work
ATWAR is offline   Reply With Quote
Old 02-05-2014, 03:52 PM   #27
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
Thanks for the answer ATWAR

I changed every "pistol" to "iphone" except those in ACT and SOUNDENT_VOLUME

It compiled correctly but did'nt work in the game.

So I changed every "pistol" and I obviously had errors :
Code:
1>  weapon_proficiency.cpp
1>  weapon_iphone.cpp
1>weapon_iphone.cpp(134): error C2065: 'ACT_IDLE_IPHONE': identificateur non déclaré // identificator not declared in english
1>weapon_iphone.cpp(135): error C2065: 'ACT_IDLE_ANGRY_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(136): error C2065: 'ACT_RANGE_ATTACK_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(137): error C2065: 'ACT_RELOAD_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(138): error C2065: 'ACT_WALK_AIM_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(139): error C2065: 'ACT_RUN_AIM_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(140): error C2065: 'ACT_GESTURE_RANGE_ATTACK_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(141): error C2065: 'ACT_RELOAD_IPHONE_LOW': identificateur non déclaré
1>weapon_iphone.cpp(142): error C2065: 'ACT_RANGE_ATTACK_IPHONE_LOW': identificateur non déclaré
1>weapon_iphone.cpp(143): error C2065: 'ACT_COVER_IPHONE_LOW': identificateur non déclaré
1>weapon_iphone.cpp(144): error C2065: 'ACT_RANGE_AIM_IPHONE_LOW': identificateur non déclaré
1>weapon_iphone.cpp(145): error C2065: 'ACT_GESTURE_RELOAD_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(146): error C2065: 'ACT_WALK_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(147): error C2065: 'ACT_RUN_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(186): error C2065: 'EVENT_WEAPON_IPHONE_FIRE': identificateur non déclaré
1>weapon_iphone.cpp(186): error C2051: l'expression associée à case n'est pas une constante
1>weapon_iphone.cpp(196): error C2065: 'SOUNDENT_VOLUME_IPHONE': identificateur non déclaré
1>weapon_iphone.cpp(207): warning C4065: l'instruction switch contient 'default' mais aucune étiquette 'case'
1>weapon_iphone.cpp(238): error C2065: 'SOUNDENT_VOLUME_IPHONE': identificateur non déclaré
1>  weight_button.cpp
1>  world.cpp
I've just renamed back the IPHONE above to PISTOL again.

I also made the change in c_weapon__stubs_hl2, but now I try to change the postition of "STUB_WEAPON_CLASS( weapon_iphone, WeaponIphone, C_BaseHLCombatWeapon );" by putting it before the "#ifndef HL2MP" line

Code:
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#include "cbase.h"
#include "c_weapon__stubs.h"
#include "basehlcombatweapon_shared.h"
#include "c_basehlcombatweapon.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

STUB_WEAPON_CLASS( cycler_weapon, WeaponCycler, C_BaseCombatWeapon );

STUB_WEAPON_CLASS( weapon_iphone, WeaponIphone, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_binoculars, WeaponBinoculars, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_bugbait, WeaponBugBait, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_flaregun, Flaregun, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_annabelle, WeaponAnnabelle, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_gauss, WeaponGaussGun, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_cubemap, WeaponCubemap, C_BaseCombatWeapon );
STUB_WEAPON_CLASS( weapon_alyxgun, WeaponAlyxGun, C_HLSelectFireMachineGun );
STUB_WEAPON_CLASS( weapon_citizenpackage, WeaponCitizenPackage, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_citizensuitcase, WeaponCitizenSuitcase, C_WeaponCitizenPackage );

#ifndef HL2MP
STUB_WEAPON_CLASS( weapon_ar2, WeaponAR2, C_HLMachineGun );
STUB_WEAPON_CLASS( weapon_frag, WeaponFrag, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_rpg, WeaponRPG, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_pistol, WeaponPistol, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_shotgun, WeaponShotgun, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_smg1, WeaponSMG1, C_HLSelectFireMachineGun );
STUB_WEAPON_CLASS( weapon_357, Weapon357, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_crossbow, WeaponCrossbow, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_slam, Weapon_SLAM, C_BaseHLCombatWeapon );
STUB_WEAPON_CLASS( weapon_crowbar, WeaponCrowbar, C_BaseHLBludgeonWeapon );
#ifdef HL2_EPISODIC
STUB_WEAPON_CLASS( weapon_hopwire, WeaponHopwire, C_BaseHLCombatWeapon );
//STUB_WEAPON_CLASS( weapon_proto1, WeaponProto1, C_BaseHLCombatWeapon );
#endif
#ifdef HL2_LOSTCOAST
STUB_WEAPON_CLASS( weapon_oldmanharpoon, WeaponOldManHarpoon, C_WeaponCitizenPackage );
#endif
#endif
I compile and I'll give the news...
GabRATM is offline   Reply With Quote
Old 02-05-2014, 04:22 PM   #28
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
I launched the mod without copying manually the client.dll and server.dll
I launched a map and typed "give weapon_iphone"
It said again the error message.
I typed "give weapon_pistol"
The console generously gave me a pistol and bullets

I copied manually the .dlls from game\..\Release_
to \sourcemod\mymod\bin
Restarted steam
Launched the mod, then :
Code:
Attempted to create unknown entity type weapon_iphone
NULL Ent in GiveNamedI
Ironically I typed again, as the console said, but it gave me only the same error again...

Here is my script named "weapon_iphone.txt"

Code:
// Iphone

WeaponData
{
	// Weapon data is loaded by both the Game and Client DLLs.
	"printname"	"#HL2_Iphone"
	"viewmodel"			"models/weapons/v_pistol.mdl"
	"playermodel"		"models/weapons/w_pistol.mdl"
	"anim_prefix"		"pistol"
	"bucket"			"2"
	"bucket_position"	"0"
	"bucket_360"			"0"
	"bucket_position_360"	"0"

	"clip_size"			"18"
	"primary_ammo"		"Pistol"
	"secondary_ammo"	"None"

	"weight"		"2"
	"rumble"		"1"
	"item_flags"		"0"

	// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
	SoundData
	{

		"reload"		"Weapon_Pistol.Reload"
		"reload_npc"	"Weapon_Pistol.NPC_Reload"
		"empty"			"Weapon_Pistol.Empty"
		"single_shot"	"Weapon_Pistol.Single"
		"single_shot_npc"	"Weapon_Pistol.NPC_Single"
		"special1"		"Weapon_Pistol.Special1"
		"special2"		"Weapon_Pistol.Special2"
		"burst"			"Weapon_Pistol.Burst"
	}

	// Weapon Sprite data is loaded by the Client DLL.
	TextureData
	{
		"weapon"
		{
				"font"		"WeaponIcons"
				"character"	"d"
		}
		"weapon_s"
		{	
				"font"		"WeaponIconsSelected"
				"character"	"d"
		}
		"weapon_small"
		{
				"font"		"WeaponIconsSmall"
				"character"	"d"
		}
		"ammo"
		{
				"font"		"WeaponIconsSmall"
				"character"	"p"
		}
		"crosshair"
		{
				"font"		"Crosshairs"
				"character"	"Q"
		}
		"autoaim"
		{
				"file"		"sprites/crosshairs"
				"x"			"0"
				"y"			"48"
				"width"		"24"
				"height"	"24"
		}
	}
}
As I said few posts ago, modifications that I made in the pistol code don't work.
Maybe the problem is somewhere else... ?
GabRATM is offline   Reply With Quote
Old 02-05-2014, 10:31 PM   #29
ExoBacon
 
 
 
Join Date: Apr 2012
Reputation: 9
Posts: 93
Add this to your gameinfo.txt under searchpaths
Code:
gamebin                          |gameinfo_path|bin
This will make sure the games client and server are loading from your game and not hl2s.

Hope that helps,
ExoBacon
ExoBacon is offline   Reply With Quote
Old 02-06-2014, 06:21 AM   #30
GabRATM
 
 
 
Join Date: Apr 2012
Reputation: 10
Posts: 19
Thank you for the new trick !

Unfortunatly I tried and it didn't work in the mod.

I think we are on a good path anyway. Here is my gameinfo.txt :
Code:
"GameInfo"
{
	game 		"uplift"
	title 		"UPLIFT"
	title2		"version de travail"
	icon		"icon"

	type		singleplayer_only

	FileSystem
	{
		SteamAppId				420 		// GCF for Episode 2
		ToolsAppId				211		// Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.
		
		SearchPaths
		{
		gamebin  |gameinfo_path|bin
		game+mod |gameinfo_path|.
		platform |gameinfo_path|.
		game_lv hl2/hl2_lv.vpk
		game+mod ep2/ep2_english.vpk
		game+mod ep2/ep2_pak.vpk
		game |all_source_engine_paths|episodic/ep1_english.vpk
		game |all_source_engine_paths|episodic/ep1_pak.vpk
		game |all_source_engine_paths|hl2/hl2_english.vpk
		game |all_source_engine_paths|hl2/hl2_pak.vpk			// if not included here, console spreads this :
										//	Requesting texture value from var "$hdrbasetexture" which is not a texture value (material: skybox/sky_day01_01rt)
										//	Requesting texture value from var "$hdrbasetexture" which is not a texture value (material: skybox/sky_day01_01bk)
		game |all_source_engine_paths|hl2/hl2_textures.vpk 		// contains the famous background01
		game |all_source_engine_paths|hl2/hl2_sound_vo_english.vpk	// if not included here, game loads with some errors
		game |all_source_engine_paths|hl2/hl2_sound_misc.vpk 		// if not included here, console spreads this :
										//	Failed to load sound "physics\metal\weapon_impact_soft2.wav", file probably missing from disk/repository
										//	Failed to load sound "physics\metal\soda_can_scrape_rough_loop1.wav", file probably missing from disk/repository
										//	Failed to load sound "physics\metal\soda_can_scrape_rough_loop1.wav", file probably missing from disk/repository
										//	Failed to load sound "physics\metal\weapon_impact_soft2.wav", file probably missing from
		game |all_source_engine_paths|hl2/hl2_misc.vpk // game doesn't load if not included here in the game info
		platform |all_source_engine_paths|platform/platform_misc.vpk
		mod+mod_write+default_write_path |gameinfo_path|.
		game+game_write |gameinfo_path|.
		gamebin episodic/bin
		game |all_source_engine_paths|episodic
		game |all_source_engine_paths|hl2
		platform |all_source_engine_paths|platform
		}

	}
}
GabRATM is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


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



All times are GMT -7. The time now is 10:03 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.