Hey everybody. I'm working on a FPS segment in a map in a campaign I'm workin on. I've got the camera setup, the traceline functions, the WASD, the works. My issue is this. I looked around and saw some other people had the problem where the traceline returns an XYZ but detecting a unit hit only provides the X and Y of the unit. Thus if you shoot over the unit's head it still registers a hit.
The only suggestions I saw to resolve this were to either set values for unit 'height' manually or use the radius as a rough value. And to be clear when I say height I'm referring to the distance from ground to top vertex of the unit. In other words the vertical dimension of the hit detection bounding box.
Well I have a theoretical solution. Measure the height from the ground to the 'center' attachment point, then double. Voila, no need for manual z value input BS, and definitely no need to use radius (the poor tanks!)
Problem is this. I can't get the height of the center attach point! I've been at this for about 5 hours now, reading tutorials and such, but I still can't figure it out. Does anybody have even the slightest idea how to measure the damn height of a unit attach point? Said person would be obviously awesomest person ever...!
I will say though I'm not super familiar with the whole actor system, so s'cuse me if it involves the actor system and I gotta ask for clarification.
You know it's interesting you ask that. I thik I should mention that as soon as this height of the center att. point thing is worked out I'd like to put out a beta version of the system. And once the AI system I'm working on and the camera pathing blocker system are done I'm putting out the system as a generic FPS/TPS engine for lazy and/or inexperienced at triggering/map making to use/learn from.
The whole reason I decided to make my own system rather than using one of the ones that have been distributed for other people to use is because the two I downloaded.. well they sucked the big one. That's not to say there aren't good FPS/TPS system maps available, it's just to say I didn't find any. The reason I needed such an engine was because I have such a gameplay segment in one of my campaign maps I'm working on.
Anyway, yeah, I'll definitely write up a traceline tutorial once I figure out this question here in the thread. My traceline has ground impact and unit/destructible impact operators, and has different custom functions for 'instant' weapons like a sniper rifle where there's no bullet displayed, and projectile-based weapons. I also have a WIP function for area of effect weapons that are constant, like a flamethrower.
Thanks for the suggestion though dude, even if you're a noob that's what this place is for: advice. After all, with my postcount of 2 I count as a forum noob here myself. As for the suggestion, I investigated that option already earlier today and it's not the solution apparently.
The thing is that there's a function for unit attachment point. My testing trigger is as follows:
UI - Player Any Player presses 1 (Key) key Down with shift Allow, control Allow, alt Allow
-
UI - Display (Text((Height of (Marine [45.07, 63.06] attachment point ("Center")))) with Any Precision decimal places) for (All players) to Subtitle area
Obviously not implemented into traceline yet. Point of the trigger is to figure out what action will output the value I'm looking for.
oh.. to bad. And I guess I'm not really a noob.. Ive made a bunch of wc3 maps and a few sc2 ones, and im working on my own TPS, and I do have a semi ok system going, but right now I just spawn a missile that flies forward along the ground. It works for now, but.. obviously that means no air units and it does not look very good. Anyyywaayy....you want the distance from the top to the bottom of the unit? Or did you want the height of an attachment point from the ground? If you wanted option 1, then maybe you might be able to find the distance between the head and feet attachment points and use that. I attached a pic of what I mean. It might serve as a temporary fix, anyway... hopefully that helps.
edit- in the pic I uploaded I messed up <.> I mean to use the same marine, not triggering unit. But you get the point, Im sure.
@tigerija:
Not if it is single player. Just launch it in the editor. thanks for your oh so helpful post >.<
=] Seriously I'm making my map so it will be easy for me to add in mutliplayer if the lag problem is every fixed, but if not, it will be a good engine for single player.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Blah. The issue appears to be that the 'unit attachment point' function is not passing anything to any other part of the trigger. No matter what I do the real value for the height of the att. point will not pass as a parameter to anything else.
I find it absurd that there's no 'set point to actor location' type thing here. That would let me stick an invisible dummy actor onto the att point and then get its position that way...
I know I ought to give it up and just put in values manually, but the elegance of having unit height detection built right into the unit hit detection operator is just too attractive..
I'll get on the traceline tut. later. The one you linked to seems awfully complicated to me, though that one might be less laggy that mine in MP. I wouldn't know since this is single player for now. Mine doesn't use any coding, it's all just custom actions and custom functions ad the camera rig.
Summary of it is basically there's a periodic event that begins to trigger when the gun shoots. When the key to fire is pressed it takes the camera's pitch and yaw, and then it basically gets the sine and cosine of the camera pitch angle. You can easily modify the pitch angle before feeding it to the tracefunc so that you can have the trajectory angle be, say, lateral relative to the ground when the camera has a slightly higher angle or watev. Anyway so then get the sine and cosine: http://www.mathsisfun.com/geometry/unit-circle.html of yer angle and then multiply those numbers by some sort of modifier, and you'll have the horizontal (cosine) and vertical (sine) distance that the bullet will travel in order to go 1 unit in a given direction. after that it's just a matter of implementing graphics etc.
That was probably not altogether too clear, so I'll still put up a real tut rather than random babbling
Anybody on the att point problem? this is a rather curious problem I think.
Oh and as for why I chose to measure from the ground to the center att point and then double is because some units apparently don't have a head att point. Like the marauder I believe. So if that unt type was fed into the hit detection operator then it would make errors if it was the head specified but the head didn't exist. and the overhead point is too tall relative to the unit. whereas the center is literally in the exact center, so doubling its distance should equal the height at least well enough for my purposes.
Also once I get the AI fully implemented I'll post up a tutorial about that as well. The purpose of the AI is to have computer controlled enemies shoot at the player with the traceline function rather than the usual attack. In other words instead of the units just doing the normal attack which always hits th player units, with the AI they will actually shoot projectiles out and thus can miss or not depending on the player moving or taking cover.
Ahh..So some of our units dont have heads!!! grrr...lol blizzard why?? Umm maybe the problem is in your display thing, not the actual function. Make sure its of type real and not integer (im sorry if that was useless)...
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
I just checked, and the marader DOES have a head point.SO maybe they all do? =]
Do you want the height relative to the terrain or to jsut the height..Galaxy editor has 2 seperate things for that, which makes me wonder.. Im looking into it right now.
I just tried the same thing as you. I tied overhead and e-attach_overhead, both returned the value 0.00 for me. I attached a pic, because I actually got an err message..hmm wierd.
I think I have an idea. You can use the action "Attach model to Unit" and select the center point of a unit, then get the height of that model and double that. I'm not sure if it would work, but I know that attaching a model to a unit works. Tell me if it works for you, I'll try it out.
Edit:
Turns out you can't get the height of an actor/model, so this won't work. :(
I'm having a similar problem...there doesn't seem to be a way to fix an attachment point to a model it seems, I've been poking around with the actors and "Attachment Set Position From" but I don't think thats quite what I'm looking for.
Some models just have no attachment points at all >_<
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey everybody. I'm working on a FPS segment in a map in a campaign I'm workin on. I've got the camera setup, the traceline functions, the WASD, the works. My issue is this. I looked around and saw some other people had the problem where the traceline returns an XYZ but detecting a unit hit only provides the X and Y of the unit. Thus if you shoot over the unit's head it still registers a hit.
The only suggestions I saw to resolve this were to either set values for unit 'height' manually or use the radius as a rough value. And to be clear when I say height I'm referring to the distance from ground to top vertex of the unit. In other words the vertical dimension of the hit detection bounding box.
Well I have a theoretical solution. Measure the height from the ground to the 'center' attachment point, then double. Voila, no need for manual z value input BS, and definitely no need to use radius (the poor tanks!)
Problem is this. I can't get the height of the center attach point! I've been at this for about 5 hours now, reading tutorials and such, but I still can't figure it out. Does anybody have even the slightest idea how to measure the damn height of a unit attach point? Said person would be obviously awesomest person ever...!
I will say though I'm not super familiar with the whole actor system, so s'cuse me if it involves the actor system and I gotta ask for clarification.
Thanks@
Sorry for this nooby replay..but could you make a tutorial on tracelines? There is already one here
http://forums.sc2mapster.com/development/tutorials/1626-trigger-how-to-target-with-mouselook-tracelines/
but i think it is un clear about bounding boxes or something.. I cant get it to work.
but you might try something like "height of unit"?? if that is what you want,sorry I am nooby.
You know it's interesting you ask that. I thik I should mention that as soon as this height of the center att. point thing is worked out I'd like to put out a beta version of the system. And once the AI system I'm working on and the camera pathing blocker system are done I'm putting out the system as a generic FPS/TPS engine for lazy and/or inexperienced at triggering/map making to use/learn from.
The whole reason I decided to make my own system rather than using one of the ones that have been distributed for other people to use is because the two I downloaded.. well they sucked the big one. That's not to say there aren't good FPS/TPS system maps available, it's just to say I didn't find any. The reason I needed such an engine was because I have such a gameplay segment in one of my campaign maps I'm working on.
Anyway, yeah, I'll definitely write up a traceline tutorial once I figure out this question here in the thread. My traceline has ground impact and unit/destructible impact operators, and has different custom functions for 'instant' weapons like a sniper rifle where there's no bullet displayed, and projectile-based weapons. I also have a WIP function for area of effect weapons that are constant, like a flamethrower.
Thanks for the suggestion though dude, even if you're a noob that's what this place is for: advice. After all, with my postcount of 2 I count as a forum noob here myself. As for the suggestion, I investigated that option already earlier today and it's not the solution apparently.
The thing is that there's a function for unit attachment point. My testing trigger is as follows:
UI - Player Any Player presses 1 (Key) key Down with shift Allow, control Allow, alt Allow
-
UI - Display (Text((Height of (Marine [45.07, 63.06] attachment point ("Center")))) with Any Precision decimal places) for (All players) to Subtitle area
Obviously not implemented into traceline yet. Point of the trigger is to figure out what action will output the value I'm looking for.
So anybody else got an idea?
[/code]
oh.. to bad. And I guess I'm not really a noob.. Ive made a bunch of wc3 maps and a few sc2 ones, and im working on my own TPS, and I do have a semi ok system going, but right now I just spawn a missile that flies forward along the ground. It works for now, but.. obviously that means no air units and it does not look very good. Anyyywaayy....you want the distance from the top to the bottom of the unit? Or did you want the height of an attachment point from the ground? If you wanted option 1, then maybe you might be able to find the distance between the head and feet attachment points and use that. I attached a pic of what I mean. It might serve as a temporary fix, anyway... hopefully that helps.
edit- in the pic I uploaded I messed up <.> I mean to use the same marine, not triggering unit. But you get the point, Im sure.
FPS/TPS = Lagg.
WASD = Lagg.
@tigerija:
Not if it is single player. Just launch it in the editor. thanks for your oh so helpful post >.<
=] Seriously I'm making my map so it will be easy for me to add in mutliplayer if the lag problem is every fixed, but if not, it will be a good engine for single player.
Woa I just relized this is my 221st post and I have only been a member for 2 weeks...woooww...lol
Blah. The issue appears to be that the 'unit attachment point' function is not passing anything to any other part of the trigger. No matter what I do the real value for the height of the att. point will not pass as a parameter to anything else.
I find it absurd that there's no 'set point to actor location' type thing here. That would let me stick an invisible dummy actor onto the att point and then get its position that way...
I know I ought to give it up and just put in values manually, but the elegance of having unit height detection built right into the unit hit detection operator is just too attractive..
I'll get on the traceline tut. later. The one you linked to seems awfully complicated to me, though that one might be less laggy that mine in MP. I wouldn't know since this is single player for now. Mine doesn't use any coding, it's all just custom actions and custom functions ad the camera rig.
Summary of it is basically there's a periodic event that begins to trigger when the gun shoots. When the key to fire is pressed it takes the camera's pitch and yaw, and then it basically gets the sine and cosine of the camera pitch angle. You can easily modify the pitch angle before feeding it to the tracefunc so that you can have the trajectory angle be, say, lateral relative to the ground when the camera has a slightly higher angle or watev. Anyway so then get the sine and cosine: http://www.mathsisfun.com/geometry/unit-circle.html of yer angle and then multiply those numbers by some sort of modifier, and you'll have the horizontal (cosine) and vertical (sine) distance that the bullet will travel in order to go 1 unit in a given direction. after that it's just a matter of implementing graphics etc.
That was probably not altogether too clear, so I'll still put up a real tut rather than random babbling
Anybody on the att point problem? this is a rather curious problem I think.
Oh and as for why I chose to measure from the ground to the center att point and then double is because some units apparently don't have a head att point. Like the marauder I believe. So if that unt type was fed into the hit detection operator then it would make errors if it was the head specified but the head didn't exist. and the overhead point is too tall relative to the unit. whereas the center is literally in the exact center, so doubling its distance should equal the height at least well enough for my purposes.
FPS/TPS = Lagg. Is still present in singleplayer. Coz of engine rendering.
Okydoke. FPS/TPS = lagg apparently:
-doesn't solve my att point location problem.
-isn't helpful reply
-doesn't seem to be the case on my machine and I'm running SCII on a goddamn macbook for chrissake.
so therefor that reply is fail.
Also once I get the AI fully implemented I'll post up a tutorial about that as well. The purpose of the AI is to have computer controlled enemies shoot at the player with the traceline function rather than the usual attack. In other words instead of the units just doing the normal attack which always hits th player units, with the AI they will actually shoot projectiles out and thus can miss or not depending on the player moving or taking cover.
Ahh..So some of our units dont have heads!!! grrr...lol blizzard why?? Umm maybe the problem is in your display thing, not the actual function. Make sure its of type real and not integer (im sorry if that was useless)...
What would solve this is a way to get the height of an actor. Anybody know how to do that? Would custom script be needed?
I just checked, and the marader DOES have a head point.SO maybe they all do? =]
Do you want the height relative to the terrain or to jsut the height..Galaxy editor has 2 seperate things for that, which makes me wonder.. Im looking into it right now.
I just tried the same thing as you. I tied overhead and e-attach_overhead, both returned the value 0.00 for me. I attached a pic, because I actually got an err message..hmm wierd.
I think I have an idea. You can use the action "Attach model to Unit" and select the center point of a unit, then get the height of that model and double that. I'm not sure if it would work, but I know that attaching a model to a unit works. Tell me if it works for you, I'll try it out.
Edit: Turns out you can't get the height of an actor/model, so this won't work. :(
I'm having a similar problem...there doesn't seem to be a way to fix an attachment point to a model it seems, I've been poking around with the actors and "Attachment Set Position From" but I don't think thats quite what I'm looking for.
Some models just have no attachment points at all >_<