So, I did a revision on “The Last Swarm” TPS engine so that I can shoot air units. Here’s a video
The traceline only works when your on the ground level, shooting ground(camera pitch angle <90) and air units(camera pitch angle >=90) just fine. But the problem is when I go up a cliff, you shoot ground units, its fine, but it doesnt shoot air units anymore. The traceline return is kind of mess up when you go up the hill. I think it’s just a matter trigonometric calculation. When your on the ground, you use right triangle formula. When shooting air units at a cliff, acute triangle formula comes in which I dont know.
Old Post:
Hi, I’m using the TPS engine from the sc2mapster library for “The Last Swarm” map and revised it to somewhat easier for me to work on. I made it to a function that returns Point XY. That means I can shoot enemies only on the ground. Anybody knows of a traceline function that works for shooting air units like returning Point XYZ or similar?
I even play around with the original TPS engine and added air units but it only works on ground units, no effect on air units.
you need to add a custom height to air units but problem with tracelines we have now are that you can still shoot the gap inbetween the air unit and the ground and still kill the air unit.
I'll make a tutorial of my version of traceline since this is being asked a lot. it will include a way to add accuaracy, better point positioning, removing that gap problem, and adding projectiles when shooting impacting ground. Only thing missing is a way to fir projectiles into the air that arn't targeting anything.
@gamfvr: Go
Then rrowland's tutorial isn't so lonely anymore. xD
There must be a way to detect model collision... multiple bounding cylinders is the best i've seen thus far.
Projectiles for grenades are doable in data, but it won't have the same feel as throwing it yourself into the air in TPS/FPS view.
A solution i came up with in beta, was a simulated-physics projectile (doable in galaxy script or triggers). But has a lot of limitations in terms of movement precision, and the lack of angle adjustments to the model. If there's a demand for it, i could write up a tutorial.
Nice to work with you dude. I am the author of "The Last Swarm". We both working on a TPS kind of map.
This will be a big step in TPS mode if we could work things on air units.
At least, your traceline detects ground unit's height, and could shoot units that are tall. Mine is just pure point XY return. In order for my traceline to work,
my target must have a limited height. If I aim at a very tall unit it will return a point behind that target, not the upper part of the target, so it registers units behind it. So, I just raise my camera height so that you aim downwards making the target's height insignificant. Ofcourse, wont work on air units.
And then when you click mouse, basically, it will just issue an order to attack the unit closest to my traceline, no special triggers.
Maybe I could at least make something so it registers the height of a target. Hopefully you will post your tutorials about your traceline and I can
take a look at it. I will post my traceline functions later......
if you're using cylinders to detect collision, you can make the cylinder's radius and height dependent on the unit's radius and height. For height you can use either a predefined field for each unit under data module, or use a custom value. You can have amazing accuracy by having accurately represented cylinders. Check rrowland's code, he uses implied cylinders.
For air units you just have to offset your implied cylinders by flying height. (Preferably you should just change the flying units to ground units with a height offset, it'll simplified the coding)
Updates:
So, I did a revision on “The Last Swarm” TPS engine so that I can shoot air units. Here’s a video
The traceline only works when your on the ground level, shooting ground(camera pitch angle <90) and
air units(camera pitch angle >=90) just fine. But the problem is when I go up a cliff, you shoot ground units, its fine, but it doesnt shoot air units anymore. The traceline return is kind of mess up when you go up the hill.
I think it’s just a matter trigonometric calculation. When your on the ground, you use right triangle formula. When shooting air units at a cliff, acute triangle formula comes in which I dont know.
Old Post:
Hi, I’m using the TPS engine from the sc2mapster library for “The Last Swarm” map and revised it to somewhat easier for me to work on. I made it to a function that returns Point XY. That means I can shoot enemies only on the ground. Anybody knows of a traceline function that works for shooting air units like returning Point XYZ or similar?
I even play around with the original TPS engine and added air units but it only works on ground units, no effect on air units.
you need to add a custom height to air units but problem with tracelines we have now are that you can still shoot the gap inbetween the air unit and the ground and still kill the air unit.
I'll make a tutorial of my version of traceline since this is being asked a lot. it will include a way to add accuaracy, better point positioning, removing that gap problem, and adding projectiles when shooting impacting ground. Only thing missing is a way to fir projectiles into the air that arn't targeting anything.
@gamfvr: Go Then rrowland's tutorial isn't so lonely anymore. xD
There must be a way to detect model collision... multiple bounding cylinders is the best i've seen thus far.
Projectiles for grenades are doable in data, but it won't have the same feel as throwing it yourself into the air in TPS/FPS view.
A solution i came up with in beta, was a simulated-physics projectile (doable in galaxy script or triggers). But has a lot of limitations in terms of movement precision, and the lack of angle adjustments to the model. If there's a demand for it, i could write up a tutorial.
@gamfvr: Go
Hi gamfvr
Nice to work with you dude. I am the author of "The Last Swarm". We both working on a TPS kind of map. This will be a big step in TPS mode if we could work things on air units. At least, your traceline detects ground unit's height, and could shoot units that are tall. Mine is just pure point XY return. In order for my traceline to work, my target must have a limited height. If I aim at a very tall unit it will return a point behind that target, not the upper part of the target, so it registers units behind it. So, I just raise my camera height so that you aim downwards making the target's height insignificant. Ofcourse, wont work on air units.
And then when you click mouse, basically, it will just issue an order to attack the unit closest to my traceline, no special triggers.
Maybe I could at least make something so it registers the height of a target. Hopefully you will post your tutorials about your traceline and I can take a look at it. I will post my traceline functions later......
@jerberson12: Go
if you're using cylinders to detect collision, you can make the cylinder's radius and height dependent on the unit's radius and height. For height you can use either a predefined field for each unit under data module, or use a custom value. You can have amazing accuracy by having accurately represented cylinders. Check rrowland's code, he uses implied cylinders.
For air units you just have to offset your implied cylinders by flying height. (Preferably you should just change the flying units to ground units with a height offset, it'll simplified the coding)
Hi guys, Please check my first post. I uploaded a video about TPS shooting ground and air units with details below it. Thanks!