Jump to content

problem with resizing marker


Fist

Recommended Posts

hello,

i have problem with making marker bigger, visually it all works fine. But when player moves screen when it goes out of default marker size it stops rendering marker and disappears until player moves screen back to default size. This is a problem because i need marker really big just for visuals.

it's like rendering size just stays the same, but marker's size changes. 

Edited by Fist
Link to comment
Just now, IIYAMA said:

I am missing some context and code.

 

huh?

marker creation ( for just testing )

addCommandHandler("marker",function(source)
	local x,y,z = getElementPosition(source);
	local wall = createMarker(x,y,z,"cylinder",100,255,255,255,200,root);
	setMarkerSize(wall,100) -- tried resizing it with this maybe that would've changed render size with markers size together, but nope.
	setElementDimension(wall,getElementDimension(source));
end)

here's shader applying a texture to marker.

addEventHandler("onClientResourceStart",resourceRoot,function()
	local wallshader = dxCreateShader("shader/zone.fx");
	local walltexture = dxCreateTexture("images/wall.png");
	dxSetShaderValue(wallshader,"MarkerSkin",walltexture);
	engineApplyShaderToWorldTexture(wallshader,"cj_w_grad");
end);

 

Link to comment
  • Moderators
Quote

disappears until player moves screen back to default size

Quote

goes out of default marker size

 

Screen size or marker size? :o

 

If I am understanding it correctly: "The size of the marker will de-increase and disappear when a player resizes their screen (when they are using window mode)?"

Or do you mean this: "The size of the marker will de-increase and disappear when a player moves their screen? But it will be back to default when they stop moving it?"

Or this: "The large marker will disappear when the player his screen goes inside of the marker?" ( I know this one. It can't be solved because of GTA limitations. You need a dx solution or an object.)

 

And give me some real context, for example a screenshot.

 

 

Link to comment
11 hours ago, IIYAMA said:

 

Screen size or marker size? :o

 

If I am understanding it correctly: "The size of the marker will de-increase and disappear when a player resizes their screen (when they are using window mode)?"

Or do you mean this: "The size of the marker will de-increase and disappear when a player moves their screen? But it will be back to default when they stop moving it?"

Or this: "The large marker will disappear when the player his screen goes inside of the marker?" ( I know this one. It can't be solved because of GTA limitations. You need a dx solution or an object.)

 

And give me some real context, for example a screenshot.

 

 

yep it's more or less last one what you mentioned. I tried with dx but that eats way too much fps, gonna use an object then.

  • Like 1
Link to comment

@IIYAMA so i tried with object, all works fine but when you move far away from object it stops rendering it, is there a way to prevent this? I tried doing setElementStreamable(obj,false) but that doesn't work visually, i guess it just stays there but not visually for client. Tried even placing a huge .col file neither worked.

Link to comment
2 minutes ago, IIYAMA said:

object createObject ( int modelid, float x, float y, float z, [ float rx, float ry, float rz, bool isLowLOD = false ] )

Set to true.


Works for me very good, see screenshots:

mta_screen_2017_11_27_21_19_13.png

 

mta_screen_2017_11_27_21_41_21.png

yeah i already have that on too, but gas size starts with really big size, and if someone is on edge that object won't render until he moves closer to center and he won't see gas effect in that place and he won't be able to tell if he's in it or not.

Link to comment
1 hour ago, IIYAMA said:

lol my lowLOD objects are doing a better job.

I assigned them to an object, maybe that matters.

 

Also are you mta settings max out?

 

actually, i dropped it off making it with object. I did it with dx, works perfectly, previously it lagged because i was drawing way to many of them, now i optimized it and works so well. Only thing what i don't know, is how i can make dxCreateTexture animated? Like wall is sparking like in default pubg zone wall, like in this image. http://prntscr.com/hm6o2w

also when i change width of dxDrawMaterialLine3D then texture stretches too, is there a way to make it just like 50x50 just which repeats by itself, so size stays untouch and it fills whole thing of dxDrawMaterialLine3D

Edited by Fist
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...