Jump to content


Photo

Archers Firing while moving


  • Please log in to reply
47 replies to this topic

#41 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 03 January 2008 - 11:19 PM

Did you tinker with their actual weapon?

If it were just a problem with the anims, I'd suggest you play with DependencySharedModelFlags in the Horde code, but they shoot straight at the ground?! that's something I've never seen before ...

I'm afraid I really can't be of much help there if you've really tried to tinker with both the weapon and the AIUpdate ...


I seem to recall coding it for RA and posting the code back in the old forums, but they're gone now ...
Software is like sex; it's better when it's free ~Linus Torvald

#42 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 04 January 2008 - 02:04 AM

I seem to recall coding it for RA and posting the code back in the old forums, but they're gone now ...

So you actually got it to work for a horde? At least I know it is possible.

Ok, here's the code that I have so far:

Model Condition Unit
ExtraPublicBone		 = FIREAROWTIP;Turret01		
; bow
		DefaultModelConditionState
			Model			= rurhrmarchHD
			WeaponLaunchBone	= PRIMARY FIREAROWTIP
			Turret			  = FIREAROWTIP;B_SPINE1;BAT_SPINE2
		End
Weapon Unit
Weapon RohanRohirrimBowMovingHD	; BALANCE Archer Weapon
	  AttackRange			 = ROHAN_HORSEBOW_RANGE;350
  
	RangeBonusMinHeight	= 10
	RangeBonus		= 1
	RangeBonusPerFoot	= 1;;#MULTIPLY( ROHAN_HORSEBOW_RANGE .01 )
	
  WeaponSpeed			   = 321	; dist/sec 
  MinWeaponSpeed			= 241
  MaxWeaponSpeed			= 481	; dist/sec Upper limit on scaling, when attacking past nominal "max" range
  FireFX					= FX_RohanArcherBowWeapon
  ScaleWeaponSpeed		  = Yes; Used for lob weapons, scales speed proportional to range
  HitPercentage			 = 45;When this weapon is used it will hit exactly 50% of the time.
  ScatterRadius			 = 30.0;When this weapon misses it can randomly miss by as much as this distance.
  
  PreAttackDelay			= 700
  PreAttackType			 = PER_SHOT; Do the delay each time we attack a new target
  PreAttackRandomAmount	 = 200 
  FiringDuration			= 1500; Duration of the archer firing shot is 1000ms.
  RequireFollowThru		= Yes

  ClipSize 				= 1
  AutoReloadsClip 			= Yes
  ClipReloadTime 			= 1500

  RotatingTurret		= Yes
  IsAimingWeapon			= Yes
  AntiAirborneVehicle		= Yes
  AntiAirborneMonster		= Yes

 CanFireWhileMoving		= Yes
 CanFireWhileCharging		= Yes

  CanBeDodged = Yes; Will check for a DodgePercent on the target to have a second chance at failing HitPercent

  HitPassengerPercentage	= 20%

 	ProjectileNugget; Default arrow
		ProjectileTemplateName  = RockBigTreeberd;RohanArcherArrowProjectile
		WarheadTemplateName	 = RohirrimBowWarheadHD
		ForbiddenUpgradeNames   = Upgrade_RohanRedArrowsStrong
	End
	ProjectileNugget; Fire arrow avialble through fire upgrade
		ProjectileTemplateName  = RockBigTreeberd;RohanArcherUpgradeArrowProjectile
		WarheadTemplateName	 = RohirrimBowRedArrowsWarheadHD
		RequiredUpgradeNames	= Upgrade_RohanRedArrowsStrong
	End
End
Weapon Horde
Weapon MovingMissileHordeRangefinderHD
	AttackRange			= 275
	
	RangeBonusMinHeight	= 10
	RangeBonus		= 1
	RangeBonusPerFoot	= 1;;#MULTIPLY( DWARVEN_MENOFDALE_RANGE .01 )
	
	DelayBetweenShots		= 1000;1500
	LeechRangeWeapon		= Yes
	AcceptableAimDelta		= 45
	AntiAirborneVehicle		= Yes
	AntiAirborneMonster		= Yes
	FinishAttackOnceStarted 	= No
	RotatingTurret		= Yes;tried both with and without
	CanFireWhileMoving	   = Yes;same as bove
	CanFireWhileCharging	   = Yes;same as above
	HordeAttackNugget
	End
End
Unit AIUpdateInterface
Behavior = AIUpdateInterface ModuleTag_03
		AutoAcquireEnemiesWhenIdle	= Yes ATTACK_BUILDINGS
		AILuaEventsList				= RohirrimArcherHDFunctions
		AttackPriority				= AttackPriority_Cavalry
		Turret
			TurretTurnRate = 180; turn rate, in degrees per sec
	;;;TurretPitchRate = 30; does not pitch
			ControlledWeaponSlots = PRIMARY
		
;;;; Use these to restrict the firing arc of the turret;;;
			NaturalTurretAngle = 0; Natural angle of the turret relative to the front of the object
			TurretMaxDeflectionCW = 180;90; Maximum deflection of the turrect clockwise from the natural turret angle
			TurretMaxDeflectionACW = 180; Maximum deflection of the turrect anti-clockwise from the natural turret angle
;;;; --------------------------------------------------;;;
		End

	End
HordeAIUpdate
Behavior = HordeAIUpdate ModuleTag_HordeAIUpdate
		AutoAcquireEnemiesWhenIdle	= Yes ATTACK_BUILDINGS
		MoodAttackCheckRate			= 500
		MaxCowerTime				= 5000
		MinCowerTime				= 3000
		AILuaEventsList	= CavalryFunctions;
		AttackPriority				= AttackPriority_Cavalry
Turret
			TurretTurnRate = 180; turn rate, in degrees per sec
	;;;TurretPitchRate = 30; does not pitch
			ControlledWeaponSlots = PRIMARY
		
;;;; Use these to restrict the firing arc of the turret;;;
			NaturalTurretAngle = 0; Natural angle of the turret relative to the front of the object
			TurretMaxDeflectionCW = 180;90; Maximum deflection of the turrect clockwise from the natural turret angle
			TurretMaxDeflectionACW = 180; Maximum deflection of the turrect anti-clockwise from the natural turret angle
;;;; --------------------------------------------------;;;
		End
	End

Like I said before, I tried removing the turret from the HordeAIUpdate but it wasn't successful.

Edited by Rob38, 04 January 2008 - 02:05 AM.

signature_group1.gif

 

16821.png


#43 jimiojoe

jimiojoe

    War Mungerer

  • Project Team
  • 491 posts
  • Projects:X-Mod, The Harry Potter Modification
  •  Advice

Posted 04 January 2008 - 02:06 PM

emmm crikey.

the bits that stand out to me where i'd try out changing are...:

RequireFollowThru = Yes
FinishAttackOnceStarted = No


also you said you tried removing turret from horde ai update,
have you tried removing it from the horde weapon aswell??

sorry this probably isnt great help, but those are the bits i'd try changing if i were you.
the guy i did was a rohan hero i created
so not too sure on hordes

Edited by jimiojoe, 04 January 2008 - 02:26 PM.

Jimiojoe
A light from the shadow shall spring.

#44 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 07 January 2008 - 03:17 AM

Well, I tried your suggestions jimiojoe but still no luck. I just thought of several more ideas today so I'll try them out and see what happens.

signature_group1.gif

 

16821.png


#45 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 12 January 2008 - 11:00 PM

Ok, after some more tweaking and testing, I was finally able to get them to attack properly in a horde! Don't get too excited yet though as their are still some pretty serious problems that need to be addressed. First, they do not play any attack animations in a horde and second, the horde tends to clump up and all collide into one unit. It looks really bad. I may be able to solve the second part (hopefully) but I'm stumped on the animation part for the horde. I'll see what I can do though. If I do manage to solve these two issues, than I'll write a tutorial on getting it to all work. But as of right now, while there is an improvment from before, they are still not the way I or anyone else would want them to be. Wish me luck... I'll need it.

signature_group1.gif

 

16821.png


#46 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 13 January 2008 - 02:03 AM

;)

That's about where i put it on the shelf and started working on something else. :p

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#47 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 13 January 2008 - 03:31 AM

:p

That's about where i put it on the shelf and started working on something else. :p

You got it to somewhat work for a horde also? Perhaps you can send me your code so I can compare it with mine and see if anything is different. Did you also get stuck on the animation and clumping part too? ;)

Edited by Rob38, 13 January 2008 - 03:31 AM.

signature_group1.gif

 

16821.png


#48 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 13 January 2008 - 04:28 AM

Somehow, when you allow the horde's rangefinder to use Charge while moving, it's structure dissembles. Don't know what's going on there. There is also the issue with trampling, which somehow got lost in the translation. So i had to remove stuff until crushing was working again.

I think the problem lies with the double function of the rangefinder. It is used for all kind of target acquisition, both for melee/missile AND for checking the targets 'crushability'. If it can crush, it will probably always try to jump on top of the target before executing the normal attack. In the case of the horde, i think it dissolves the horde structure. The 'horde' object jumps on top, while the horde members loose coherence and lag behind, desperately trying to catch up with the 'horde' center.

If there was a solution to that, i think the animations would easily fall in place ('FIRING_OR_RELOADING_A MOVING ATTACKING'). There could be a workaround i haven't found yet, but i imagine it will necessitate removing the 'crusher' from the horde.

I am not entirely sure of course, but you can imagine i got kind of fed up after a few weeks of that stuff when i was more interested in the AI. Anyway, as you probably well know, there are running-shooting anims for rohirrim. Sad to think that they might be wasted. I believe EA had planned to put them in with a modified hardcoded AIUpdate and a new weapon attribute, probably without the turret logic, or so it looks to me when i see how they made the completely new fire and reload anims for different angles. But who knows... ;)

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users