Page 1 of 1

Weapons range variable?

Posted: 16 Oct 2006, 02:30
by PauloMorfeo
Is it possible to have, for example, missile towers have a range of x for ground units but y for airborn units?

Posted: 16 Oct 2006, 02:35
by j5mello
yes and no. it can be done but not on one weapon. U would have to make two weapons (anti-gorund and anti-air) and jam the one ur not using.

Posted: 16 Oct 2006, 03:10
by BlackLiger
j5mello wrote:yes and no. it can be done but not on one weapon. U would have to make two weapons (anti-gorund and anti-air) and jam the one ur not using.
Then someone needs to make a patch to change that. It's been done before. the C&C games always had AIRBOOST as a tag.

Posted: 16 Oct 2006, 09:52
by KDR_11k
Yes but that would still be hardcoded behaviour to split between air and ground units. Just use two weapons that have disjunct onlytargetcategory tags.

Posted: 18 Oct 2006, 01:39
by BlackLiger
KDR_11k wrote:Yes but that would still be hardcoded behaviour to split between air and ground units. Just use two weapons that have disjunct onlytargetcategory tags.
Viable for OTA style units. If I recall, spring has a 32, is it, weapon maximum for a unit before it begins to lag badly with calculation. Thats with 1 unit. Now, for a mod I've been designing, I want a unit with at least 9 different, independant weapons. I can have 3 of them on the map without much lag. Therefore, as 1 of them is an anti tank/anti air missile, it'd become 10 by your method. Annoying, but bearable. However, what about a mod with 10 weapons by default on a unit? that becomes 11, so lag occurs after 3 units are built. Which annoys the hell out of players.

Posted: 18 Oct 2006, 06:10
by PauloMorfeo
But wouldn't that mean that the unit would have it's firepower doubled?

I mean, it could have it's ground weapon *and* it's air weapon shooting at the same time, if it hapens to have both a ground and an air target. Suposedly, a Missile Tower only has *one* weapon.

Posted: 18 Oct 2006, 13:59
by KDR_11k
Paulo: Jam the weapon if the other weapon has aimed or shot recently.

Liger: What do you have that many weapons for? Are you sure you couldn't turn some of them into one weapon that uses multiple firepoints?

This is still very special case behaviour that IMO does not belong into the engine, if you want tons of weapons that behave differently against different targets use multiple weapons.

Posted: 18 Oct 2006, 17:11
by BlackLiger
KDR_11k wrote:Paulo: Jam the weapon if the other weapon has aimed or shot recently.

Liger: What do you have that many weapons for? Are you sure you couldn't turn some of them into one weapon that uses multiple firepoints?

This is still very special case behaviour that IMO does not belong into the engine, if you want tons of weapons that behave differently against different targets use multiple weapons.
Independant targeting of each weapon on a different target.

I dont want this tank surrounded by infantry and only able to shoot at 1 of them....

Posted: 18 Oct 2006, 20:16
by KDR_11k
Make sure their firearcs differ, then. The Trireme in CvC has eight lasers to attack eight targets at once but in practice it always fires all of them at the same target.

Posted: 19 Oct 2006, 00:32
by BlackLiger
KDR_11k wrote:Make sure their firearcs differ, then. The Trireme in CvC has eight lasers to attack eight targets at once but in practice it always fires all of them at the same target.
Shouldn't the code simply disable the other guns and only use the one that can aim at the target, in your method?

Posted: 19 Oct 2006, 03:58
by rattle
Targets don't change if you let an aim function fail. What KDR means is that one weapon get a 135° firearc to the left and the other 135° to the right for example, then both weapons could engage different targets to the left and right of the unit.

Posted: 19 Oct 2006, 04:50
by PauloMorfeo
KDR_11k wrote:Paulo: Jam the weapon if the other weapon has aimed or shot recently.
...
Like j5mello said. That is a scripting thing, right?

Would i be able to jam it for the weapon's reload time or would it need to be jammed for a specific time? If i need to specify a time for the jam in the script, that will mean that that unit is unmaintainable since every single time i want to rebalance it by changing reload times, i would have to recompile it's script...

Posted: 19 Oct 2006, 09:48
by KDR_11k
Let's say Weapon1 and Weapon2 are technically the same, during their Aim function they check a static var and if it's true they assume the other weapon is blocking stuff. Whenever one of them fires it sets the var that blocks the other and starts a function that will reset it after the reload time is over (make sure you kill this function with a signal if a Fire function is called again before the blocking ends, just in case).

All weapons follow the same targeting logic so they'll usually pick the same target if it's not invalid for some of them because of fire arcs or target categories.

Posted: 19 Oct 2006, 15:15
by 1v0ry_k1ng
just look at the E&E ural. it often targets 2-3 sepearate opponents at once.

Posted: 19 Oct 2006, 21:15
by BlackLiger
hmmm. Interesting. I'll keep that in mind.

That said, many of my things have this multiple weapons that do the same job on different arcs (like a tank with a machinegun turret on 3 sides (front, left, right) to defend against infantry)