MacRae 12 Posted July 19, 2013 Hey Guys, Im needing your help guys! What i'm looking for is a way to create a target system Similar to The UNA Target system that was in Arma 2 So if your not fimiliar to the UNA Target system is that you shoot at a target and as you hit it it registers where your shots are placed so when you have finished shooting you can go and check your score If anyone can sort this out for me it would be awesome! Thanks ~MacRae~ Share this post Link to post Share on other sites
MacRae 12 Posted July 20, 2013 Anyone have an idea on how to do this? Share this post Link to post Share on other sites
austin_medic 109 Posted July 20, 2013 (edited) I know you can make the game show where damage was taken on a body part of a unit... not sure of how to do it atm, need to look it up... i'll try to get you something... Edited July 20, 2013 by austin_medic Share this post Link to post Share on other sites
kylania 568 Posted July 20, 2013 There's already some kind of targeting thing like that built into the game, you can see it in early press demos. I thought I'd read that they were gonna bring it back too, but not sure. Share this post Link to post Share on other sites
zooloo75 834 Posted July 20, 2013 You could add a fired eventhandler to the unit and wait until the bullet has hit the target, then convert the bullet's position to the modelspace position of the target and attach a helper object to that location. Share this post Link to post Share on other sites
Larrow 2823 Posted July 20, 2013 As kylania said im sure ive read somewhere aswell that the devs want to implement this in the firing ranges. Just thinking out aloud but something along the lines of:- Add a fired event handle to the player. When they fire keep checking the projectiles position until its null. Get the worldtomodel offest from the closest target or a target that has registered as animating/hit. Then you would need to spend some time working out positions on the target to compare the offset to. Add some score to the player dependant on area hit. or If targets already have HitPart/Selections in their models Set a HitPart EVH on each target. Dependant on which part is hit add a score to the player. Other than a quick think through like that ive really not investigated whats included with the target models. EDIT: ninja'd by zooloo :D ---------- Post added at 18:41 ---------- Previous post was at 17:03 ---------- Heres a very quick very messy not very accurate example :D this addEventHandler ["HitPart",{ parts = [["Helmet",[-0.13623,0.0012207,6.98916],[0.102539,0.00244141,7.13556],1], ["Face",[-0.0693359,0.00109863,6.85182],[0.0673828,0.0012207,6.9749],10], ["LeftArm",[-0.316406,0.0012207,6.29343],[-0.15332,0.0012207,6.93634],2], ["RightArm",[0.124023,0.000976563,6.35337],[0.29834,0.00109863,6.85105],4], ["Torso",[-0.12207,0.0012207,6.32697],[0.0996094,0.00109863,6.79745],6], ["LeftLeg",[-0.250977,0.000976563,5.82256],[0.000488281,0.0012207,6.25414],3], ["RightLeg",[-0.0126953,0.00134277,5.83468],[0.276367,0.0012207,6.27613],3]];; { _Tpoints = player getVariable ["points",0]; _done = false; _shot = ((_x select 0) worldToModel (_x select 3)); _shotX = _shot select 0; _shotY = _shot select 1; _shotZ = _shot select 2; _dummy = _x select 0; { _desc = _x select 0; _min = _x select 1; _minX = _min select 0; _minY = _min select 1; _minZ = _min select 2; _max = _x select 2; _maxX = _max select 0; _maxY = _max select 1; _maxZ = _max select 2; _points = _x select 3; if ( ((_shotX > _minX) && (_shotX < _maxX)) && ((_shotZ > _minZ) && (_shotZ < _maxZ)) ) then { _dist = player distance _dummy; _Dpoints = (_points * (_dist / 10 )); _Tpoints = _Tpoints + _Dpoints; hint format["Desc: %1\nPoints: %3\nDistance: %2\nPoints @ Dist: %4\nTotal Score: %5",_desc,_dist,_points,_Dpoints,_Tpoints]; player setVariable ["points",_Tpoints]; _done = true; }; }forEach parts; if (!(_done)) then { hint "You Missed"; }; }forEach _this; }]; test mission Share this post Link to post Share on other sites
MacRae 12 Posted July 20, 2013 Larrow Thank you so much! but do you think that there is a way so that for another course i need is that if a player hits the target anywhere (do not matter about scoring here) that i get a message saying "Hit" And obiously if they miss i wont get a message atall? Share this post Link to post Share on other sites
Larrow 2823 Posted July 20, 2013 Something as simple as this addEventHandler ["HitPart",{hint "Target Hit";}]; will give you feedback about hitting the target. Again all very WIP but ive updated the test mission with a UNA alike target. Still needs a little centering and the textures are shit :D need to work on some actions, maybe a UI and then get it working over over MP properly :/ Share this post Link to post Share on other sites
MacRae 12 Posted July 20, 2013 so do i add this to the player that i want the feedback to go to? Share this post Link to post Share on other sites
Larrow 2823 Posted July 21, 2013 No that was just to stick on the target, as i said above this was all just a proof of concept (something to keep me busy this evening) and really needs looking into more as theres most likely all sorts of problems when not using this in editor preview. Share this post Link to post Share on other sites
MacRae 12 Posted July 24, 2013 Yeah thanks for everything, but is there any way for the message saying where you hit, was sent not to you, but say a Drill instructor unit member. Because im using this as a test so if the person shooting can only see it they can lie whether or not they hit it or not. Share this post Link to post Share on other sites