Page 1 of 1

Strange problem with a weapon script (only is used the half)

Posted: Thu Jun 02, 2011 4:30 pm
by MaestraFénix
Well, i dont know why this happen. I thought at first that maybe the problem was caused by the models, but even after use the default, it still giving me problems.

The problems:
  • "Flickening" of the v_model in the "fire" animation ("fixed", but continues happening randomly).
  • Name and sprites specified in the script doesnt used (it loads the default).
The sound is the same that uses the default weapon, so its not necessary define it (isn´t the cause of the problems).


The script isnt have "advanced settings" because is used as a custom script in Hammer with weapon_gauss.

Code: Select all

// Gauss

WeaponData
{
	// Weapon data is loaded by both the Game and Client DLLs.
	"printname"		"HL:S Tau Cannon"
	"viewmodel"		"models\weapons\v_gausshls.mdl"
	"playermodel"		"models\weapons\w_gausshls.mdl"
	"anim_prefix"		"gauss"
	"bucket"		"3"
	"bucket_position"	"1"

	"clip_size"		"-1"
	"default_clip"		"150"
	"primary_ammo"		"GaussEnergy"
	"secondary_ammo"	"None"

	"weight"		"20"
	"item_flags"		"0"
	"ITEM_FLAG_NOAUTOSWITCHEMPTY"	"1"
	
	"BuiltRightHanded" 		"1"
	"AllowFlipping" 		"1"

	"csviewmodel"			"1"

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

	// Weapon Sprite data is loaded by the Client DLL.
	TextureData
	{
		"weapon"
		{
			"file"		"sprites/640hud2"
			"x"			"0"
			"y"			"90"
			"width"		"170"
			"height"	"45"
		}
		"weapon_s"
		{
			"file"		"sprites/640hud5"
			"x"			"0"
			"y"			"90"
			"width"		"170"
			"height"	"45"
		}
		"ammo"
		{
			"file"		"sprites/640hud7"
			"x"			"0"
			"y"			"96"
			"width"		"24"
			"height"	"24"
		}
		"crosshair"
		{
			"file"		"sprites/crosshairs"
			"x"			"48"
			"y"			"48"
			"width"		"24"
			"height"	"24"
		}
	}
}

This method work perfectly in other weapons, for example in the rpg:
► Show Spoiler
I rewritten the script dozens of times, with different values and commands, and nothing.


Maybe directly the TAU Cannon dont allow use this method? (that would be ridiculous).






If you realized that the codes make allusions to HL:S, and that this will assumed a future HL:S weapons, you have a prize.

Re: Strange problem with a weapon script (only is used the h

Posted: Thu Jun 02, 2011 4:38 pm
by TESLA-X4
About what I said earlier about the server and client disagreeing on the model to use, I meant to check if the client's script was updated (I know I posted 'server', but I was referring to the client. Brainfarts, aaaa >.< ). The part about the "Name and sprites specified in the script aren't used" further confirms my hunch about this problem. Also, you'd probably need to restart the game for changes to the weapon script to take effect (I managed to get away with it by spawning another instance of the weapon, but that was for the server so YMMV).

Also, I don't remember "ITEM_FLAG_NOAUTOSWITCHEMPTY" being a valid key. I think it should be "item_flags" "4".

Code: Select all

From shareddefs.h:
#define ITEM_FLAG_SELECTONEMPTY		(1<<0)
#define ITEM_FLAG_NOAUTORELOAD		(1<<1)
#define ITEM_FLAG_NOAUTOSWITCHEMPTY	(1<<2)
#define ITEM_FLAG_LIMITINWORLD		(1<<3)
#define ITEM_FLAG_EXHAUSTIBLE		(1<<4)	// A player can totally exhaust their ammo supply and lose this weapon
#define ITEM_FLAG_DOHITLOCATIONDMG	(1<<5)	// This weapon take hit location into account when applying damage
#define ITEM_FLAG_NOAMMOPICKUPS		(1<<6)	// Don't draw ammo pickup sprites/sounds when ammo is received
#define ITEM_FLAG_NOITEMPICKUP		(1<<7)	// Don't draw weapon pickup when this weapon is picked up by the player

Re: Strange problem with a weapon script (only is used the h

Posted: Thu Jun 02, 2011 5:07 pm
by MaestraFénix
TESLA-X4 wrote:About what I said earlier about the server and client disagreeing on the model to use, I meant to check if the client's script was updated (I know I posted 'server', but I was referring to the client. Brainfarts, aaaa >.< ). The part about the "Name and sprites specified in the script aren't used" further confirms my hunch about this problem. Also, you'd probably need to restart the game for changes to the weapon script to take effect (I managed to get away with it by spawning another instance of the weapon, but that was for the server so YMMV).

Also, I don't remember "ITEM_FLAG_NOAUTOSWITCHEMPTY" being a valid key. I think it should be "item_flags" "4".

Code: Select all

From shareddefs.h:
#define ITEM_FLAG_SELECTONEMPTY		(1<<0)
#define ITEM_FLAG_NOAUTORELOAD		(1<<1)
#define ITEM_FLAG_NOAUTOSWITCHEMPTY	(1<<2)
#define ITEM_FLAG_LIMITINWORLD		(1<<3)
#define ITEM_FLAG_EXHAUSTIBLE		(1<<4)	// A player can totally exhaust their ammo supply and lose this weapon
#define ITEM_FLAG_DOHITLOCATIONDMG	(1<<5)	// This weapon take hit location into account when applying damage
#define ITEM_FLAG_NOAMMOPICKUPS		(1<<6)	// Don't draw ammo pickup sprites/sounds when ammo is received
#define ITEM_FLAG_NOITEMPICKUP		(1<<7)	// Don't draw weapon pickup when this weapon is picked up by the player
I´ll start looking about how to update it for get rid of that lines in the console at every respawn.

And the "ITEM_Flag" commands works (RPG uses it). Thanks to put all these.


EDIT: Can be this?: http://obsidianconflict.net/forums/view ... =29&t=4283

Re: Strange problem with a weapon script (only is used the h

Posted: Sun Jun 19, 2011 11:59 am
by MaestraFénix
After a few tests, i found that the script works. Is the weapon_gauss itself that gives the error. Maybe because their code is from the beta???

Continue working on the weapons.