Results 1 to 1 of 1

Thread: viewmodelanim idle not working for custom weapon

  1. #1
    Senior Member Ancient Order's Avatar
    Join Date
    Aug 2015
    Location
    Paris, Fr.
    Posts
    256

    Default viewmodelanim idle not working for custom weapon

    hi there!
    i am using the sledgehammer mod from Sorridstroker to try to make players hold a bottle and use it to bash incidentally, ie replace the sledgehammer by the bottle_condiment. In the original mod, the sledgehammer is redifined with classname weapon and weapontype pistol. It all worked fine on our BT server but no way to make it fully work on AA, only problem being the viewmodelanim idle and pullout not playing though i can see the viewmodelanim of the bash anim and all external views look absolutly working
    Code:
    TIKI
    setup
    {
    	scale 0.52			// Set default scale to 16/30.5 since world is in 16 units per foot and model is in cm's
    	path models/miscobj/bottles
    	skelmodel bottle_condiment.skd
    	surface bottle_condiment shader bottle_condiment
    }
    
    init
    {
    	server
    	{
    		classname weapon
    		weapontype pistol
    		name "Sol 330"
    		rank 140 140
    
    
    		//==============================================//
    		// 		Primary fire type info		//
    		//==============================================//
    
    		firetype melee
    		meansofdeath	bash
    		ammotype "Sol 330"//none
    		ammorequired	0
    		semiauto
    		bulletcount	1 //0
    
    		//==============================================//
    		//		WEAPON BEHAVIOR MODELLING 	//
    		//==============================================//
    
    		bulletrange		64
    		bulletdamage		150
    		firedelay 2
    		crosshair 0
    		notdroppable
    		bulletknockback	50
    
    		//==============================================//
    		// 		DM Attributes			//
    		//==============================================//
    
    		dmbulletcount	1 //0
    		dmammorequired	0
    		dmbulletrange		64
    		dmbulletdamage		150
    		dmfiredelay 2
    
    		//==============================================//
    		// 		Secondary fire DM Attributes	//
    		//==============================================//
    
    		secondary firetype			melee
    		secondary ammotype			none
    		secondary dmammorequired	0
    		secondary dmbulletrange		64
    		secondary dmbulletdamage	150
    		secondary bulletknockback	50
    
    
    
    	}
    }
    
    animations
    {
    	idle     bottle_condiment.skc
    }
    
    /*QUAKED interactobject_decor_bottle-condiment (0.0 0.75 0.5) (-8 -8 0) (8 8 16)
    */
    Fire states work good with the right wiewmodel anim:
    Code:
    // Spawn Detection + leb spawn protect
    state STAND
    {
    	states
    	{
    		PLAYER_SPAWNED : NEW_WEAPON
    	}
    }
     
    state PLAYER_SPAWNED
    {
    	movetype legs
     
    	entrycommands
    	{
    		//exec global/showState.txt "PLAYER_SPAWNED"
    		exec global/addBottle.txt 	 // give bottle weapon  	
    		commanddelay 0.05 activatenewweapon
    		exec global/spawnProtect.txt  // execute script on spawned player //nodamage
    		exec global/raiseSilenced.txt 	 // sniper + rocket    	
    		exec global/addKAR.txt 	 // kar for allies    	
    	}
     
    states
    	{
    		NOTDOINGANACTION : default
    	}
    }
    	// ======================================================= //
    	// Action state machine for Mike Powell, the hero of MoH PC //
    	// ======================================================= //
    
    // Authored by Carl glave and Michael Boon, 5-23-2000
    
    // The action state machine takes care of
    // a) all torso-only animations which are layer on top of leg animations
    // b) most full-body animations
    // c) which states are to take their full-body animations from the leg state
    //    machine.
    // The states which control only torso animations have "movetype legs" and 
    // animations under the token "action".  This allows the leg state to continue
    // controlling the leg animations.  The states which control the whole body have
    // movetype not legs and animations under the token "action". This overrides the
    // leg state machine. States such as NOTDOINGANACTION, below, which have "none" specified
    // as the torso animation, take the torso animation from the leg animaiton
    // specified in the legs state machine.
    
    //==============================================================================
    //==============================================================================
    //
    // Stand (really means spawned)
    // Notdoinganaction (really means not doing an action) 
    //==============================================================================
    
    state NOTDOINGANACTION
    {
    
    	movetype legs
    
    	camera behind
    
    	entrycommands
    	{
    		exec global/showState.txt "NOTDOINGANACTION"
    //commanddelay 0.10 viewmodelanim idle
    		viewmodelanim idle
    	}
    	
    	action
    	{
    		none : default // no torso animation
    	}
    
    	states
    	{
    		KILLED					: KILLED
    		PAIN					: PAIN
    
    		VEHICLE_START			: IS_USING_VEHICLE
    		TURRET_START			: IS_USING_TURRET
    
    		// if we're on a ladder, make sure we're climbing the ladder
    		LADDER_IDLE_LEFT		: ON_LADDER
    
    		// Some grab and hang stuff will be implemented in the final game, probably 
    		// not all of this, but it's in here as a placeholder.
    //		CLIMB_LADDER			: ONGROUND +FORWARD !BACKWARD AT_LADDER
    
    //		CLIMB_LADDER_IMPACT		: !ONGROUND FORWARD !BACKWARD AT_LADDER	// For grabbing onto walls when
    													// flying through the air
    	
    		// Using objects is dictated by the object being used.  The three objects 
    		// here are for objects which trigger interactive actions when touched, 
    		// for objects which the player uses (such as doors), and for when the 
    		// player tries to use an object that is not usable.
    //		USE_USEANIM				: ONGROUND TOUCHEDUSEANIM
    //		USE_USEANIM				: ONGROUND USE AT_USEANIM
    		USE_LADDER				: ONGROUND +USE AT_LADDER CHECK_HEIGHT "stand"
    //		USE_LADDER				: ONGROUND AT_LADDER // this is full auto use of ladders
    		// latch onto ladder in mid-air
    		USE_LADDER				: +USE AT_LADDER CHECK_HEIGHT "stand" // can also latch onto a ladder in mid-air
    		// auto use of ladder when at the bottom (AT_LADDER check is last because it does a trace)
    		USE_LADDER				: ONGROUND FORWARD LOOKING_UP "35" !PUTAWAYMAIN !NEW_WEAPON !RELOAD !ATTACK_PRIMARY !ATTACK_SECONDARY AT_LADDER CHECK_HEIGHT "stand"
    		// auto use of ladder when at the top (AT_LADDER check is last because it does a trace)
    		USE_LADDER				: ONGROUND FORWARD !LOOKING_UP "-35" !PUTAWAYMAIN !NEW_WEAPON !RELOAD !ATTACK_PRIMARY !ATTACK_SECONDARY AT_LADDER CHECK_HEIGHT "stand"
    //		GENERIC_USE				: ONGROUND +USE
    
    		// This is not functional for the prototype, but is here as a placeholder for
    		// future functionality.
    		// While the player can only fire weapons with his right hand, he can switch them 
    		// to his left if he wants to use an item with his left.  Gameplay-wise, this should 
    		// be the same as putting the weapon away, but it will create a nice graphical "cool 
    		// factor" which is always good in computer games.
    		// When we have two items out, the game code will flag them both as putaway, and we 
    		// need to put the right one away first, followed by the left.
    		PUTAWAY_MAIN			: PUTAWAYMAIN	// Basic put weapon away move.
    		RAISE_WEAPON			: NEW_WEAPON
    
    		RELOAD_WEAPON			: RELOAD
    
    		DO_BOTTLE		: +ATTACK_PRIMARY IS_WEAPON_ACTIVE "mainhand" "Sol 330"
    		DO_BOTTLE		: +ATTACK_SECONDARY IS_WEAPON_ACTIVE "mainhand" "Sol 330"
    
    	
    		CHECK_PRIMARY_ATTACK_SEMIAUTO	: +ATTACK_PRIMARY IS_WEAPON_SEMIAUTO "mainhand" IS_WEAPON_READY_TO_FIRE "mainhand"
    		CHECK_PRIMARY_ATTACK_FULLAUTO	:  ATTACK_PRIMARY !IS_WEAPON_SEMIAUTO "mainhand" IS_WEAPON_READY_TO_FIRE "mainhand"
    		CHECK_SECONDARY_ATTACK			: +ATTACK_SECONDARY
    	}
    }
    The raise state viewmodelanim doesn't seem to work neither, displays some quick jerky bash anim:
    Code:
    state RAISE_WEAPON
    {
    	movetype legs
    
    	entrycommands
    	{
    		viewmodelanim pullout
    
    		// just to make sure nothing funky's 
    		// attached that shouldn't be.
    		correctweaponattachments
    	}
    
    
    
    	states
    	{
    		RAISE_CONDIMENT		: IS_NEW_WEAPON "mainhand" "Sol 330"
    		RAISE_PISTOL		: IS_NEW_WEAPONCLASS "mainhand" "pistol"
    		RAISE_RIFLE			: IS_NEW_WEAPONCLASS "mainhand" "rifle"
    		RAISE_GRENADE		: IS_NEW_WEAPONCLASS "mainhand" "grenade"
    		RAISE_SMG			: IS_NEW_WEAPONCLASS "mainhand" "smg"
    		RAISE_MP44			: IS_NEW_WEAPON "mainhand" "StG 44"
    		RAISE_BAR			: IS_NEW_WEAPON "mainhand" "BAR"
    //		RAISE_PISTOL		: IS_NEW_WEAPONCLASS "mainhand" "item" // hold all items like a pistol for now
    		RAISE_SHOTGUN			: IS_NEW_WEAPON "mainhand" "Shotgun"
    		RAISE_BAZOOKA			: IS_NEW_WEAPON "mainhand" "Bazooka"
    		RAISE_PANZERSCHRECK		: IS_NEW_WEAPON "mainhand" "Panzerschreck"
    		RAISE_PAPERS		: IS_NEW_WEAPON "mainhand" "Papers"
    		
    //		RAISE_RIFLE			: default
    		RAISE_NOANIM		: default
    	}
    }
    
    state RAISE_CONDIMENT
    {
    
    	entrycommands
    	{
    //commanddelay 0.05 self useweapon models/miscobj/bottle_condiment.tik
    		commanddelay 0.05 activatenewweapon
    		commanddelay 0.05 forcetorsostate "NOTDOINGANACTION"
    		commanddelay 0.25 exec weapons/sledge_angle.scr 
    	}
    }

    All external views look absolutly working.
    I already changed every commanddelay without luck and don't know longer what to do to go on, any clue is welcome![
    Last edited by Ancient Order; November 4th, 2023 at 10:09 PM. Reason: adding mike_torso part

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •