karlis Posted June 13, 2011 Author Share Posted June 13, 2011 ye i had that idea already... probably just server settings will have option to enable it, url for stream, and path for icon. Link to comment
will briggs Posted June 13, 2011 Share Posted June 13, 2011 Looks pretty awesome dude Link to comment
MX_Master Posted June 17, 2011 Share Posted June 17, 2011 advise to resource author: circle radar now can be made by dxCreateTexture -- map and mask imagesdxCreateRenderTarget, dxSetRenderTarget -- draw piece of map ^ into custom new texturedxCreateShader, dxSetShaderValue -- use `mask` image as alpha channel for custom texture ^dxDrawImage -- draw shader ^ to screen all you need is knowledge of HLSL for creating a shader .fx file Link to comment
karlis Posted June 26, 2011 Author Share Posted June 26, 2011 true, ill have to rewrite it all. it basically takes out all the hard part of script, do'h. expect it release even later. and srry for delay and inactivity, i was in countryside. Link to comment
karlis Posted August 27, 2011 Author Share Posted August 27, 2011 don't loose hopes, im back from countryside, and ill try to finish it. its not abandoned. Link to comment
qaisjp Posted August 27, 2011 Share Posted August 27, 2011 yay, good work mate! For the fading and brief anims use interpolateBetween Link to comment
karlis Posted August 30, 2011 Author Share Posted August 30, 2011 thanks, any1 who want to help check this thread: viewtopic.php?f=91&t=34101#p366963 Link to comment
MX_Master Posted August 30, 2011 Share Posted August 30, 2011 i can show you a right and simple way to make round radar as I said earlier. Here is example resource. Here lua script from it local uMyShader= dxCreateShader( "shaders/mask.fx" ) local uMyImage = dxCreateTexture( "images/grass.png" ) local uMyMask = dxCreateTexture( "images/grayscaleMask.png" ) local uRenderImage = dxCreateRenderTarget( 256,256, true ) if not uMyShader or not uMyImage or not uRenderImage or not uMyMask then outputChatBox( "Can't create shader or textures for it!" ) return end dxSetShaderValue( uMyShader, "tex0", uMyImage ) dxSetShaderValue( uMyShader, "maskTex0", uMyMask ) -- simple rotation example addEventHandler( "onClientRender", root, function() dxSetRenderTarget( uRenderImage, false ) -- draw to render texture dxDrawImage( 0, 0, 256, 256, uMyShader ) dxSetRenderTarget() -- draw to screen dxDrawImage( 300, 300, 256, 256, uRenderImage, getPedRotation(localPlayer) or 0 ) end ) here hlsl script from it too texture tex0; // texture texture maskTex0; // mask sampler sBase = sampler_state { Texture = (tex0); }; sampler sAlpha = sampler_state { Texture = (maskTex0); }; struct PS_IN { float2 Base : TEXCOORD0; }; float4 ps( PS_IN In ) : COLOR { float4 color; float4 alpha; color = tex2D( sBase, In.Base.xy ); alpha = tex2D( sAlpha, In.Base.xy ); color.a = alpha.r * alpha.g * alpha.b; return color; } technique mask { pass p0 { PixelShader = compile ps_2_0 ps(); } } all these scripts, sample image and mask image you can find in the example resource ^ Link to comment
karlis Posted August 30, 2011 Author Share Posted August 30, 2011 (edited) thnx, problem is that w/o hlsl i still can't script the hud, so i still have to learn it. ill give it a try. EDIT: cuz i need to use dxDrawImageSection it didnt work propertly, but still, what could be the reason for simple float4 to cause error? Edited August 30, 2011 by Guest Link to comment
MX_Master Posted August 30, 2011 Share Posted August 30, 2011 to make hud you no need hlsl (: shaders is only for radar of course you may want to make a fullscreen grayscale shader (after local player death) and i can give you it Link to comment
karlis Posted August 30, 2011 Author Share Posted August 30, 2011 i aim it to be quite more advanced. we'll see how it goes dont you see a ovbious mistake in this line? struct PS_IN { float2 texCord : TEXCOORD0, float2 pixelPos : VPOS0 }; edit: or this struct PS_IN { float2 texCord : TEXCOORD0; float2 pixelPos : VPOS }; Link to comment
MX_Master Posted August 30, 2011 Share Posted August 30, 2011 use shader only for masking, for other calculations, texture scaling, rotating, fading .. - use lua dx functions. some correct steps to make round radar: draw to the first clean render texture needed scaled piece of the map texture, using dxDrawImageSection also draw needed gang zone images to this render target set new texture value for mask shader to this render texture draw this shader to the second clean render target draw a round border to it draw this second render target to the screen with rotation parameter related to local player's camera position/target draw (N) icon image to the screen draw needed icon images to the screen draw local player's icon image to the screen Link to comment
karlis Posted August 31, 2011 Author Share Posted August 31, 2011 thanks, that part works... but the dxdrawimagesection draws the image stretched horizontally, altrought im sure i didnt do so. EDIT:sloved Link to comment
karlis Posted August 31, 2011 Author Share Posted August 31, 2011 YAY! all bugs are solved, it works fluently now. that means its time for NEW FEATURES! now im gonna make radar areas. edit: quick new feature altitude meter Link to comment
GodFather Posted August 31, 2011 Share Posted August 31, 2011 Looks so nice. :> Can't wait for more pics! Link to comment
karlis Posted September 1, 2011 Author Share Posted September 1, 2011 now oficially this radar has all functions from default one and many additional! flashinġ radar area: is this spacing between radio stations fine? Link to comment
Static-X Posted September 1, 2011 Share Posted September 1, 2011 is this spacing between radio stations fine? Seems fine to me. Link to comment
Castillo Posted September 1, 2011 Share Posted September 1, 2011 Nice work karlis, I'll surely check it out when you release it! keep up the good work. Link to comment
MX_Master Posted September 1, 2011 Share Posted September 1, 2011 some suggestions: use grayscaled map use thin borders around health/armor bar copy (N) from original GTA IV radar use round blips use original ">" blip for the local player draw blips over the health/armor bar off course radar size must be based on client screen size just see the difference good work, keep going Link to comment
karlis Posted September 1, 2011 Author Share Posted September 1, 2011 at least i dont like the thin borders, my target arent making one exact like iv, by calling it iv hud i mean i want to get the good stuff from the iv(circular radar areas, zoom, hp and armor bar, radio, hidable content, etc.) but ill consider your suggestions and size is based on res already, but i find hard to find right formula, cuz proportional wouldnt work. PS:im not a photoshop artist, im a scripter, ill fail even at creating basic things in it. PPS:and drawing blips over hp/armor would be good for sp, but in mp, which often have dozens of blips they would jsut totally block the view. Link to comment
MX_Master Posted September 2, 2011 Share Posted September 2, 2011 it won't be a gta4 style radar (: it will be only a custom radar Link to comment
karlis Posted September 2, 2011 Author Share Posted September 2, 2011 it will not be a gtaiv hud,itll be a gtaiv style hud. and dont you agree on the issue about the blips over the hp? Link to comment
karlis Posted September 3, 2011 Author Share Posted September 3, 2011 yay done the circular radar areas! functions(use exports.IVhud:functionName(args) ): element/boolean createRoundRadarArea(float x,float y,float radius,int r,int g,int b,int a) --[[ x and y: pos on the world radius: radius of area on the world r,g,b and a:4last args optional, the color of radar area(default:white, 150alpha) returns false if invalid args, element of "roundradararea" type if sucessful ]] boolean/float float float areaDimensions(element area,float x,float y,float radius) --[[ sets and gets position and radius of specified area call it with only 1st argument to return pos and radius of area, call with all 4 to set them boolean/int int int int roundRadarAreaColor(element area,int r,int g,int b,int a) --[[ sets and gets radar area color call it with only 1st argument to return color, call with all 5 to set the color boolean isElementInRoundArea(element theElement,element area) --[[checks is particular element inside the round radar area returns boolean boolean/table getElementsInRoundRadarArea(element area,string elemType) --[[ gets all elements in particula round radar area, filters them by type, if elemType specified. returns table(may be empty) or false if invalid arguments boolean/int int int int int string float float float roundRadarAreaFlashing(element area,int interval,int r2,int g2,int b2,int a2,sting easetype,float easeperiod,float easeamplitude,float easeovershoot) --[[ makes round radar area flash. interval: how long will the flash/interpolation go before reaching the edge r2,g2,b2,a2: second color for the flash, first being the normal one. easetype: any type of easing used for interpolation of colors NOTE: "Binary" is aviable aswell-it just switches from color1 to color2 and back without easing. easeperiod,easeamplitude,easeovershoot: arguments for the easing, OPTIONAL to turn flashing off call it with only first 2 arguments. to return all arguments specified before(except area itself ofc) call it only with first argument. Link to comment
Sharingan Posted September 4, 2011 Share Posted September 4, 2011 Definitely I don't like those thick borders. I want an exact hud. 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