Dre-+- Posted April 24, 2011 Share Posted April 24, 2011 (edited) This resource add detective vision in MTA(like Batman Arkham Asilum game) For use this resource just use night vision or infrared goggles. I hope you like it) Screenshots: https://wiki.multitheftauto.com/images/4/46/Dvision.png For see exports go to: Mta wiki page Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=2074 BTW: all suggestions or bugs post in commentaries. Edited October 17, 2011 by Guest Link to comment
Xierra Posted April 25, 2011 Share Posted April 25, 2011 Wow, now you feel like you're a robot or using a gadget! I was impressed with your work dre, amazing. Link to comment
Orange Posted April 26, 2011 Share Posted April 26, 2011 I did same but without nightvision. Anyway, good work. I hope that it's more optimized that my script Link to comment
Puma Posted May 2, 2011 Share Posted May 2, 2011 Looks cool. But how many FPS does it eat? A lot, I think. Link to comment
darkdreamingdan Posted May 14, 2011 Share Posted May 14, 2011 Looks cool.But how many FPS does it eat? A lot, I think. They're 2D lines, minimal performance hit. Great idea, nice work Link to comment
Castillo Posted May 16, 2011 Share Posted May 16, 2011 Karlis, do you mean this: https://community.multitheftauto.com/index.php?p= ... ls&id=1627 ? Link to comment
Xierra Posted May 16, 2011 Share Posted May 16, 2011 For me, I think karlis meant: When detective vision is active, will the GTA HUD still be visible? But yours also make sense. He may be asking for that HUD resource that was on the bottom right. P.S: Glad to see you back karlis Link to comment
Phat Looser Posted May 16, 2011 Share Posted May 16, 2011 The heads are missing, if you use the "eye bone positions" you'd have a triangle. I was thinking about that, too, for stealth. Link to comment
karlis Posted May 17, 2011 Share Posted May 17, 2011 Karlis, do you mean this: https://community.multitheftauto.com/index.php?p= ... ls&id=1627 ? yep thats what i meant, thnx _____ ty XX3, glad to see you too. Link to comment
Dre-+- Posted June 8, 2011 Author Share Posted June 8, 2011 May I improve it a bit? Ok, if you have good idea) Link to comment
Phat Looser Posted June 8, 2011 Share Posted June 8, 2011 aBoneList = {} --right leg aBoneList[54] = 53; aBoneList[53] = 52; aBoneList[52] = 51; aBoneList[51] = 1; --left leg aBoneList[44] = 43; aBoneList[43] = 42; aBoneList[42] = 41; aBoneList[41] = 1; --spine aBoneList[1] = 2; aBoneList[2] = 3; aBoneList[3] = 4; --right arm aBoneList[26] = 25; aBoneList[25] = 24; aBoneList[24] = 23; aBoneList[23] = 22; aBoneList[21] = 22; --right arm aBoneList[36] = 35; aBoneList[35] = 34; aBoneList[34] = 33; aBoneList[33] = 32; aBoneList[31] = 32; --head aBoneList[4] = 6; aBoneList[6] = 7; aBoneList[7] = 4; --torso aBoneList[32] = 41; aBoneList[22] = 51; -- function drawPedBones (ped) if isElement(ped) then for iFrom,iTo in pairs(aBoneList) do local x1,y1,z1 = getPedBonePosition(ped,iFrom); local x2,y2,z2 = getPedBonePosition(ped,iTo); if not (x1 or x2) then return; end local screenX1, screenY1 = getScreenFromWorldPosition ( x1,y1,z1 ); local screenX2, screenY2 = getScreenFromWorldPosition ( x2,y2,z2 ); local playerTeam = getPlayerTeam( ped ); local red,green,blue = 0,0,0; if playerTeam then red,green,blue = getTeamColor ( playerTeam ) end if screenX1 and screenX2 then dxDrawLine ( screenX1, screenY1, screenX2, screenY2, tocolor(red,green,blue,255) ); end end end end The thing is, code is generated by humans, not by machines. So keeping it readable is always a good idea. Link to comment
Dre-+- Posted June 9, 2011 Author Share Posted June 9, 2011 aBoneList = {} --right leg aBoneList[54] = 53; aBoneList[53] = 52; aBoneList[52] = 51; aBoneList[51] = 1; --left leg aBoneList[44] = 43; aBoneList[43] = 42; aBoneList[42] = 41; aBoneList[41] = 1; --spine aBoneList[1] = 2; aBoneList[2] = 3; aBoneList[3] = 4; --right arm aBoneList[26] = 25; aBoneList[25] = 24; aBoneList[24] = 23; aBoneList[23] = 22; aBoneList[21] = 22; --right arm aBoneList[36] = 35; aBoneList[35] = 34; aBoneList[34] = 33; aBoneList[33] = 32; aBoneList[31] = 32; --head aBoneList[4] = 6; aBoneList[6] = 7; aBoneList[7] = 4; --torso aBoneList[32] = 41; aBoneList[22] = 51; -- function drawPedBones (ped) if isElement(ped) then for iFrom,iTo in pairs(aBoneList) do local x1,y1,z1 = getPedBonePosition(ped,iFrom); local x2,y2,z2 = getPedBonePosition(ped,iTo); if not (x1 or x2) then return; end local screenX1, screenY1 = getScreenFromWorldPosition ( x1,y1,z1 ); local screenX2, screenY2 = getScreenFromWorldPosition ( x2,y2,z2 ); local playerTeam = getPlayerTeam( ped ); local red,green,blue = 0,0,0; if playerTeam then red,green,blue = getTeamColor ( playerTeam ) end if screenX1 and screenX2 then dxDrawLine ( screenX1, screenY1, screenX2, screenY2, tocolor(red,green,blue,255) ); end end end end The thing is, code is generated by humans, not by machines. So keeping it readable is always a good idea. Thanks, mate, now its really looks more better) BTW: Do you have MTA Community profile, for i add you in creators? Link to comment
Castillo Posted June 9, 2011 Share Posted June 9, 2011 I think this is his profile: https://community.multitheftauto.com/index.php?p=profile&id=33540 Link to comment
Phat Looser Posted June 9, 2011 Share Posted June 9, 2011 aBoneList = {} --right leg aBoneList[54] = 53; aBoneList[53] = 52; aBoneList[52] = 51; aBoneList[51] = 1; --left leg aBoneList[44] = 43; aBoneList[43] = 42; aBoneList[42] = 41; aBoneList[41] = 1; --spine aBoneList[1] = 2; aBoneList[2] = 3; aBoneList[3] = 4; --right arm aBoneList[26] = 25; aBoneList[25] = 24; aBoneList[24] = 23; aBoneList[23] = 22; aBoneList[21] = 22; --right arm aBoneList[36] = 35; aBoneList[35] = 34; aBoneList[34] = 33; aBoneList[33] = 32; aBoneList[31] = 32; --head aBoneList[4] = 6; aBoneList[6] = 7; aBoneList[7] = 4; --torso aBoneList[32] = 41; aBoneList[22] = 51; -- function drawPedBones (ped) if isElement(ped) then for iFrom,iTo in pairs(aBoneList) do local x1,y1,z1 = getPedBonePosition(ped,iFrom); local x2,y2,z2 = getPedBonePosition(ped,iTo); if not (x1 or x2) then return; end local screenX1, screenY1 = getScreenFromWorldPosition ( x1,y1,z1 ); local screenX2, screenY2 = getScreenFromWorldPosition ( x2,y2,z2 ); local playerTeam = getPlayerTeam( ped ); local red,green,blue = 0,0,0; if playerTeam then red,green,blue = getTeamColor ( playerTeam ) end if screenX1 and screenX2 then dxDrawLine ( screenX1, screenY1, screenX2, screenY2, tocolor(red,green,blue,255) ); end end end end The thing is, code is generated by humans, not by machines. So keeping it readable is always a good idea. Thanks, mate, now its really looks more better) BTW: Do you have MTA Community profile, for i add you in creators? Yes, like Solid said. But I suffer from the "lonewolf" disease(just like any other scripter) which makes you stop working together with other people before you even started talking to them Also, did your script detect that bones were outside the screen? Always check those nil values. Link to comment
Dre-+- Posted June 10, 2011 Author Share Posted June 10, 2011 aBoneList = {} --right leg aBoneList[54] = 53; aBoneList[53] = 52; aBoneList[52] = 51; aBoneList[51] = 1; --left leg aBoneList[44] = 43; aBoneList[43] = 42; aBoneList[42] = 41; aBoneList[41] = 1; --spine aBoneList[1] = 2; aBoneList[2] = 3; aBoneList[3] = 4; --right arm aBoneList[26] = 25; aBoneList[25] = 24; aBoneList[24] = 23; aBoneList[23] = 22; aBoneList[21] = 22; --right arm aBoneList[36] = 35; aBoneList[35] = 34; aBoneList[34] = 33; aBoneList[33] = 32; aBoneList[31] = 32; --head aBoneList[4] = 6; aBoneList[6] = 7; aBoneList[7] = 4; --torso aBoneList[32] = 41; aBoneList[22] = 51; -- function drawPedBones (ped) if isElement(ped) then for iFrom,iTo in pairs(aBoneList) do local x1,y1,z1 = getPedBonePosition(ped,iFrom); local x2,y2,z2 = getPedBonePosition(ped,iTo); if not (x1 or x2) then return; end local screenX1, screenY1 = getScreenFromWorldPosition ( x1,y1,z1 ); local screenX2, screenY2 = getScreenFromWorldPosition ( x2,y2,z2 ); local playerTeam = getPlayerTeam( ped ); local red,green,blue = 0,0,0; if playerTeam then red,green,blue = getTeamColor ( playerTeam ) end if screenX1 and screenX2 then dxDrawLine ( screenX1, screenY1, screenX2, screenY2, tocolor(red,green,blue,255) ); end end end end The thing is, code is generated by humans, not by machines. So keeping it readable is always a good idea. Thanks, mate, now its really looks more better) BTW: Do you have MTA Community profile, for i add you in creators? Yes, like Solid said. But I suffer from the "lonewolf" disease(just like any other scripter) which makes you stop working together with other people before you even started talking to them Also, did your script detect that bones were outside the screen? Always check those nil values. Ok, added in special thanks) Link to comment
will briggs Posted June 13, 2011 Share Posted June 13, 2011 Dude, Awesome! Really well done... Link to comment
Phat Looser Posted June 14, 2011 Share Posted June 14, 2011 Naw, thats what scripts should be like Link to comment
Phat Looser Posted June 15, 2011 Share Posted June 15, 2011 aBoneList = {} --right leg aBoneList[54] = 53; aBoneList[53] = 52; aBoneList[52] = 51; aBoneList[51] = 1; --left leg aBoneList[44] = 43; aBoneList[43] = 42; aBoneList[42] = 41; aBoneList[41] = 1; --spine aBoneList[1] = 2; aBoneList[2] = 3; aBoneList[3] = 4; --right arm aBoneList[26] = 25; aBoneList[25] = 24; aBoneList[24] = 23; aBoneList[23] = 22; aBoneList[21] = 22; --right arm aBoneList[36] = 35; aBoneList[35] = 34; aBoneList[34] = 33; aBoneList[33] = 32; aBoneList[31] = 32; --head aBoneList[4] = 6; aBoneList[6] = 7; aBoneList[7] = 4; --torso aBoneList[32] = 41; aBoneList[22] = 51; -- aBoneFarList = {} --right leg aBoneFarList [54] = 51; --left leg aBoneFarList [44] = 41; --spine aBoneFarList [1] = 4; --right arm aBoneFarList [26] = 22; --right arm aBoneFarList [36] = 32; --head aBoneFarList [6] = 7; --torso aBoneFarList [32] = 41; aBoneFarList [22] = 51; -- function drawPedBones (ped) local aList = {}; if isElement(ped) then local x,y,z = getCameraMatrix(); local px,py,pz = getElementPosition(ped); local fDistance = getDistanceBetweenPoints3D(x,y,z,px,py,pz); if fDistance < 50 then aList = aBoneList; elseif fDistance < 300 then aList = aBoneFarList; end for iFrom,iTo in pairs(aList) do local x1,y1,z1 = getPedBonePosition(ped,iFrom); local x2,y2,z2 = getPedBonePosition(ped,iTo); if not (x1 or x2) then return; end local screenX1, screenY1 = getScreenFromWorldPosition ( x1,y1,z1 ); local screenX2, screenY2 = getScreenFromWorldPosition ( x2,y2,z2 ); local playerTeam = getPlayerTeam( ped ); local red,green,blue = 0,0,0; if playerTeam then red,green,blue = getTeamColor ( playerTeam ) end if screenX1 and screenX2 then dxDrawLine ( screenX1, screenY1, screenX2, screenY2, tocolor(red,green,blue,255) ); end end end end Uses less GFX speed - all DX funktions have the drawback that they are pushed through the pipe, which is the bottleneck of a GFX card. Link to comment
Dre-+- Posted June 16, 2011 Author Share Posted June 16, 2011 aBoneList = {} --right leg aBoneList[54] = 53; aBoneList[53] = 52; aBoneList[52] = 51; aBoneList[51] = 1; --left leg aBoneList[44] = 43; aBoneList[43] = 42; aBoneList[42] = 41; aBoneList[41] = 1; --spine aBoneList[1] = 2; aBoneList[2] = 3; aBoneList[3] = 4; --right arm aBoneList[26] = 25; aBoneList[25] = 24; aBoneList[24] = 23; aBoneList[23] = 22; aBoneList[21] = 22; --right arm aBoneList[36] = 35; aBoneList[35] = 34; aBoneList[34] = 33; aBoneList[33] = 32; aBoneList[31] = 32; --head aBoneList[4] = 6; aBoneList[6] = 7; aBoneList[7] = 4; --torso aBoneList[32] = 41; aBoneList[22] = 51; -- aBoneFarList = {} --right leg aBoneFarList [54] = 51; --left leg aBoneFarList [44] = 41; --spine aBoneFarList [1] = 4; --right arm aBoneFarList [26] = 22; --right arm aBoneFarList [36] = 32; --head aBoneFarList [6] = 7; --torso aBoneFarList [32] = 41; aBoneFarList [22] = 51; -- function drawPedBones (ped) local aList = {}; if isElement(ped) then local x,y,z = getCameraMatrix(); local px,py,pz = getElementPosition(ped); local fDistance = getDistanceBetweenPoints3D(x,y,z,px,py,pz); if fDistance < 50 then aList = aBoneList; elseif fDistance < 300 then aList = aBoneFarList; end for iFrom,iTo in pairs(aList) do local x1,y1,z1 = getPedBonePosition(ped,iFrom); local x2,y2,z2 = getPedBonePosition(ped,iTo); if not (x1 or x2) then return; end local screenX1, screenY1 = getScreenFromWorldPosition ( x1,y1,z1 ); local screenX2, screenY2 = getScreenFromWorldPosition ( x2,y2,z2 ); local playerTeam = getPlayerTeam" class="kw2">getPlayerTeam" class="kw2">getPlayerTeam( ped ); local red,green,blue = 0,0,0; if playerTeam then red,green,blue = getTeamColor ( playerTeam ) end if screenX1 and screenX2 then dxDrawLine ( screenX1, screenY1, screenX2, screenY2, tocolor(red,green,blue,255) ); end end end end Uses less GFX speed - all DX funktions have the drawback that they are pushed through the pipe, which is the bottleneck of a GFX card. I dont really understand how, but your code add more 4~6 fps, thanx) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now