Weapon Arcs on top of weapon arcs

Weapon Arcs on top of weapon arcs

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Weapon Arcs on top of weapon arcs

Post by aGorm »

OK, question, I have a two turrets one mounted on the other...

http://www.youtube.com/watch?v=dmPrPH-g ... AAAAAAAAAA - video doesn't show actully firing, just a reference so you can see the turret set up.

I know what your thinking thats 1 turret, with four guns. And I can do that, that works fine. However what I want to do is make both arms seperate turrets. So, I have it set up so the left side is turret 1 (which is aimed by moving the body around). I then have the rigth hand side as turret 2, I want this to aim within a limited arc from whichever way the body is facing. Is there a way to set up the fire arcs to that it can do this? Currently if I give the second weapon a fire arc, work based on which way the unit is facing, not on which way the primary turret is turned (which does make sense, it just obviosly doesn't help with what I want to achive.)
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Weapon Arcs on top of weapon arcs

Post by FLOZi »

What kind or arc are you thinking?

Afaics; either script the arc, or just give the weapon suitable tolerance
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Re: Weapon Arcs on top of weapon arcs

Post by aGorm »

Code: Select all

[1]={name  = "Basic Laser",
	onlyTargetCategory = [[LAND]],
	},
},
[2]={name  = "Basic Laser",
	onlyTargetCategory = [[LAND]],
	mainDir = [[0 0 1]],
	maxAngleDif = 90,
	},
},
OK, heres the two weapons, 1 can fire anywhere, 2 can shoot in an arc of 90 forwards. However becasue weapon 2 is mounted on weapon 1, what I actully need is weapon 2's arc to be based on which way weapon 1 is pointing not which way the unit is facing... does that make more sense?

I can script it so it can physicly move past that angle, but it doesn't know why it can't without a firearc so it will atempt to target things it can't hit, causeing the weapon to jam untill that target it can't reach is dead or out of range...

Does this make more sense now? Think my explanation sux...
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Weapon Arcs on top of weapon arcs

Post by knorke »

So basically the torso turns to aim, but attached to the torso are 2 arms that also aim in a limited arc?

In spring, does the fire arc work 1) per unitheading or 2) per-piece heading? (firearc rotates with the parent piece)

iirc there are functions to controll what unit a weapon will target*, so you could do some "can i reach this?" calculations and either allow shooting or make it pick a new target.
*=never got that to work as i wanted
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Weapon Arcs on top of weapon arcs

Post by yuritch »

knorke wrote:In spring, does the fire arc work 1) per unitheading or 2) per-piece heading? (firearc rotates with the parent piece)
It's option 1.

Take a look at S'44 tank coaxial machine guns, they are only allowed to fire in a small arc relative to turret rotation (set by main gun). Not 90 degrees of course, but may be a start. But it's a scripted feature, not engine one.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Re: Weapon Arcs on top of weapon arcs

Post by aGorm »

Had a horrible feeling it would be one. :-( I'll have a look to see if I can find out what its targeting and if I can make it keep polling through till it finds a valid target.
Post Reply

Return to “Game Development”