Page 1 of 1

waterweapon targeting seaplane/hover/amphibious

Posted: 29 Jul 2009, 20:46
by Caydr
I've got a torpedo launcher, and I want it to only target units in the water, obviously.

To accomplish this, I say onlytargetcategory and rule out anything that's not:
-a water-only unit
-a hovercraft
-a seaplane
-an amphibious tank

Problem is, now it will target hovers or amphibious while they're on land, and make a sincere effort to shoot down seaplane fighters using torpedoes. So I set the weapon type to waterweapon.

Here's my question. Is Spring smart enough to realize that hovers, amphibious units, and seaplanes DO become acceptable targets for waterweapons while they're on/in the water?

Re: waterweapon targeting seaplane/hover/amphibious

Posted: 02 Aug 2009, 19:55
by Spawn_Retard
in b4 Learn2lua.

Re: waterweapon targeting seaplane/hover/amphibious

Posted: 02 Aug 2009, 20:04
by Caydr
I know, let's use LUA instead of built-in features, that seems efficient.

Re: waterweapon targeting seaplane/hover/amphibious

Posted: 02 Aug 2009, 20:11
by imbaczek
option 1) let's use LUA instead of built-in features, that seems efficient.
option 2) wait for code gods to bring features to the people

Re: waterweapon targeting seaplane/hover/amphibious

Posted: 02 Aug 2009, 20:24
by Kloot
Is Spring smart enough
The meaning of waterweapon is "if true, this weapon can target and shoot at underwater stuff", so yes.

Re: waterweapon targeting seaplane/hover/amphibious

Posted: 02 Aug 2009, 21:18
by Caydr
Yes I get that but I wonder if the engine bothers to check on whether a unit is currently underwater or if it just has a waterline tag. I know there are lots of examples where shortcuts like that have been taken in the past because it would be too wasteful to do constant checks on every unit's position.

Maybe I'll just test it, I have a bit more time to spare today than I usually do.

Re: waterweapon targeting seaplane/hover/amphibious

Posted: 03 Aug 2009, 10:24
by yuritch
In my experience engine actually checks if the unit is underwater (or in water). It's easy to see - when a ground unit gets into water, subs start firing at it. When the same unit is on the ground near water, subs don't try to torpedo it.
So hovers would never be targeted as they always remain above water (can be changed with little model edit).

Re: waterweapon targeting seaplane/hover/amphibious

Posted: 03 Aug 2009, 19:13
by KDR_11k
If your torp launcher shoots land units it's either not a torp launcher or it has submissile=1 set. The TorpedoLauncher weapon will not shoot at land.