-
Posts
1,255 -
Joined
-
Last visited
Posts posted by .:HyPeX:.
-
-
I'm working out an IA which will control a helicopter, and mostly will just keep its rotation within the angles specified.
So far said IA does fine when rotation is applied and height, keeping the helicopter suprisingly quiet. However, whenever i add any angle to the X or Y axis.. it works fine for the first.. 3 seconds? then the rotation axis of Y kicks in and it goes to whatever number and the maths no longer check out. (When the Y axis is flipped the X axis is affected aswell) so i'd like to know how can i properly keep them stable in a 0-360 basis.. and not have them flipping arround whenever another axis alternates (Why is this even a thing?!)
Greetz.
-
I found the issue. It was quite a dumb mistake.
-
function collision (projectile) local time = projectile.counter / 10 local velocity = projectile.velocity velocity = velocity * time -- local position = projectile.position + velocity local sight, x, y, z = processLineOfSight( projectile.position, position, true, true, true, true, true, true, true, false, nil, true ) position = (sight and Vector3(x, y, z)) or position -- Marker( position, 'corona', 3 ) end addEventHandler( 'onClientProjectileCreation', root, function() collision(source) end )
While it probably works, it doesnt apply to my case. It checks if anything is in the missile path, but if an object is moving and enters the path after it was fired, it wouldnt work. I.e. It doesnt take into consideration the target's movement.
-
-
TL;DR, this script calculates two objects and their trajectory and checks if they intersect in any given point, however, it just works sometimes... and sometimes it doesnt.
As you can see, the code DOES work, since it creates a marker where it is expected to hit the target (Where the collision warning was triggered), however, i'm able sometimes to just hit the target with my missiles flawlessly and the warning wont trigger.
http://i.imgur.com/ha7hS6r.jpg
EDIT: Some more images here and here .
Script:
local pos = localPlayer.position local veh = createVehicle(411, pos.x + 10, pos.y, pos.z) setElementFrozen(veh,true) function calculateTrajectory(Object1,Object2,time) local p = {} p[1] = Vector3(Object1.position) p[2] = Vector3(Object2.position) local v = {} v[1] = (Vector3(Object1.velocity) * 50) v[2] = (Vector3(Object2.velocity) * 50) for i=1, math.floor(time/50) do local time = time + i * 50 local nP = {} nP[1] = p[1] + ((v[1]) * (time/1000)) nP[2] = p[2] + ((v[2]) * (time/1000)) d = nP[1] - nP[2] if (math.abs(d.x) > 20) or (math.abs(d.y) > 20) or (math.abs(d.z) > 20) then else outputChatBox(math.abs(d.x) .. " " .. math.abs(d.y).. " "..math.abs(d.z)) end if math.abs(d.x) < 5 and math.abs(d.y) < 5 and math.abs(d.z) < 5 then outputChatBox("Collision warning!") createMarker(nP[1],"corona",4,255,0,0) return end end end addEventHandler("onClientProjectileCreation",root,function() calculateTrajectory(source,veh,getProjectileCounter(source)) outputChatBox('projectile',255,0,0) end)
PD: i know there should be a correct formula for calculating this, bear with my lazyness to make it with a loop.
-
How did you solved it?
I dont remember (It was over a year ago rofl), but on the new VPS i got this on i didnt have to touch anything and it worked fine. Probably that old one wasnt well set up?
-
r,g,b = r/255,g/255,b/255 dxSetShaderValue(Shaders[i],"r",{r,g,b,1}) dxSetShaderValue(Shaders[i],"g",{0,0,0,1}) dxSetShaderValue(Shaders[i],"b",{0,0,0,1}) dxSetShaderValue(Shaders[i],"a",{0,0,0,1})
Values are correctly set, so far discovered its some sort of shader issue, 255,0,0 RGB will be red, 255,75,75 will turn blank
-
dxSetShaderValue(Shaders[i],"r",r) dxSetShaderValue(Shaders[i],"g",g) dxSetShaderValue(Shaders[i],"b",b) dxSetShaderValue(Shaders[i],"a",1)
Shader is float4, check
-
Well, for some reason my shaders wont have the colors assigned..
script:
dY = -5.3499999046326 dX = -4.4745998382568 Colors = { {255,75,75}, {75,255,75}, {75,75,255}, {255,255,255}, {0,0,0}, {255,255,75}, {255,75,255} } Shaders = {} for i=1,#Colors do Shaders[i] = dxCreateShader("colorShader.fx") local r,g,b = unpack(Colors[i]) --local r,g,b = tostring(r),tostring(g),tostring(b) dxSetShaderValue(Shaders[i],"r",r,g,b,1) dxSetShaderValue(Shaders[i],"g",r,g,b,1) dxSetShaderValue(Shaders[i],"b",r,g,b,1) dxSetShaderValue(Shaders[i],"a",r,g,b,1) end function test() local x,y,z = getElementPosition(localPlayer) local x,y,z = x,y+5,z-1 for i=1, #Colors do local obj = createObject(1697,x + dX*(i-1),y,z,32,0,0) engineApplyShaderToWorldTexture ( Shaders[i], "solar_panel_1", obj ) end end addEventHandler('onClientResourceStart',resourceRoot,function() test() end)
Shader:
// // tex_names.fx // float Time : TIME; float4 r; float4 g; float4 b; float4 a; //----------------------------------------------------------------------------- // Techniques //----------------------------------------------------------------------------- technique tec0 { pass P0 { MaterialAmbient = r; MaterialDiffuse = g; MaterialEmissive = b; MaterialSpecular = a; AmbientMaterialSource = Material; DiffuseMaterialSource = Material; EmissiveMaterialSource = Material; SpecularMaterialSource = Material; ColorOp[0] = SELECTARG1; ColorArg1[0] = Diffuse; AlphaOp[0] = SELECTARG1; AlphaArg1[0] = Diffuse; Lighting = true; } }
Result: (Even there's a cyan shader, but there is no cyan color made? wtf?
-
Well ive struggled with text quality for a while now and ive found something weird: Shaders increase text quality.
Now, what i want to know is how big the performance impact is. And for those wondering, do a simple try, draw a text into a render target and then place the render target as a texture of the simple shader example. Then proceed to draw both the render and the shader, and the shader will have better quality. (In fact increasing the shader sub pixel increases the quality even a bit more, tho is barely noticeable).
So anyone has an idea of how bad the performance impact is of doing this?
-
Another solution could be pre-creating textures and then drawing them. It would cause a short lag when the resource starts, but at least drawing should be completely smooth as it's already in GPU memory.
Good idea, i'll try that!
-
Okay, so i got this working, but for some reason i get very big FPS drops on the first 1-4 loops (starting over), and this affects me becouse i just wanna draw one loop of out if, any idea on this?
PD: Just checked, this thingie makes the GTA process go from 800mb to 1800mb RAM usage
-
I am not talking about, how you've called it, patters images or a shader file.
I am talking about vehicle model files (I'll remind you which extensions does they have: txd, dff, col) I made long time ago in 3DS Max only for EPG.
And i'm telling you i'm not using them.
-
You have absolutely no rights to use any of my vehicle model files I made for European Pro Gamers.
I'm not, i looked at them and asked a friend to make something similar, EPG's files are meant to use patters wich i do not want to. But, yeah becouse someone is using a similar shader name tag they're using your files, right?
-
Indeed ill try that. Btw, amazing login
-
Well i tried loading a WebM video wich on my VLC player players softly at 60fps, ingame CEF somehow makes it look laggy, like if it was at 30 fps.. any idea on this?
Original:
-
So i tried, and apparently the shader @hite affects this, but i think this is rather a bug, becouse @hite is not the specified shader, i mean, before i managed to make it work using the 'map' texture, but not it does not work anymore and i dont know why.
Probably the vehicle dff and txd corrupted?
-
I'm using the infernus (411) and the texture 'map'.
The texture 'map' is returned when i use the function engineGetModelTextureNames.
-
Well, the custom texture i'm wanting to replace is visible when i use the function to get the model textures, however, when i use the engineApplyshaderToWorldTexture the texture is not replaced. Even more funny, if i use the "?*" to apply shaders, the texture i want to replace is replaced..
I tried going to the middle of nowhere with the vehicle (freeze + setelementposition) and these were the "visible" texture names:
@hite bfori cloudhigh cloudmasked collisionsmoke coronastar custom_car_plate fist font1 font2 plateback3 radar_centre radar_north radardisc seabd32 shad_car unnamed vehicledash32 vehiclegeneric256 vehiclelights128 vehiclesteering128 vehicletyres128 waterclear256
-
When a player leaves his car is still left there sometimes, what function should i be checking for? destruction derby mode btw.
-
Actually, the other thing is also a proper theme - click on the caret-down icon, and '> Edit HTML and CSS' should be in the dropdown.
Oh yeah, just noticed that anyways, now i've no idea how to get my database info into this place here, how could i do so? Tried using the
-
You're clearly showing two themes on the screenshot - ‘Default’ and ‘Elite Masters Players - Christmas.’ Try editing Elite Masters Players theme since it's set as the default one (i.e. the main theme, used when no other theme is set by the end-user)
Thats why im saying its a only one theme, the christmas one is just a palette wich changes forums colors and doesnt have any possibility to edit code itself.
-
I tried to add
<li class='ipsResponsive_hidePhone ipsType_break'> Server Monitor 2.0 </li>
But after clicking on save and reloading a topic page, there isnt any change visible, do i need to reload from somewhere else to see changes?
Are you using default theme?
There is no other theme..
-
I tried to add
<li class='ipsResponsive_hidePhone ipsType_break'> Server Monitor 2.0 </li>
But after clicking on save and reloading a topic page, there isnt any change visible, do i need to reload from somewhere else to see changes?
YOUTUBE AND LUA!
in Scripting
Posted
Depends on the method, for the most part, youtube links all have the video name in the web page name.
This is mine (Kinda old, but still works):
Server
Client