-
Posts
662 -
Joined
-
Last visited
-
Days Won
15
Everything posted by Einheit-101
-
https://bugs.mtasa.com/view.php?id=8526 Not possible
-
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
Server Closed. I am now working on the release version. -added a lot of new maps -added a lot of mini maps for existing maps -added new impact effects / effects for destroyed vehicles -added new engine sounds for tanks -fixed mortars (and any other issues with projectiles in general) -fixed vehicles stucking in ground in some cases because the ground was not loaded -fixed sync for spectators -fixed many, many smaller things I guess thats it so far, everything is final now except the GUI improvements, tail gunnery system and some missing mini maps. -
Shader_pedwall €DIT: however even this will most likely fail when players fade out. Btw on my server I am pretty sure that players are visible far more than 80m
-
Is it still possible to get these maps? Would be a very great addition for SAAW - World War II
-
Shader doesnt get restricted to 1 element as it should
Einheit-101 replied to Einheit-101's topic in Scripting
No, no, the rest of the code consists of 3539 lines onClientElementStreamIn is indeed the correct event. I was just wondering why the shader got applied to all vehicles. It seems, shaders with no set values are using values from other shaders until they get a value. Not sure if this is a bug or a feature of MTA. -
Shader doesnt get restricted to 1 element as it should
Einheit-101 replied to Einheit-101's topic in Scripting
Thanks Walid, but i found the issue! dxSetShaderValue(leftShader, "gUVMove", 0, 0) dxSetShaderValue(rightShader, "gUVMove", 0, 0) These two values have to be set directly after creation of the shader; otherwise (for some reason) if you manipulate that value elsewhere, it gets applied to all vehicles. I dont know why, i dont know how. But it works. I saw that the shader doesnt manipulate any vehicle that has already been entered before so i thought it might be possible that a value has to be set or is missing, i just tried all values after line 11 and gUVMove was the one that caused it. gUVMove gets modified in a onClientRender loop for each vehicle, i thought it should be fine since the shader is limited anyway, but i was wrong -
Hello community. I have a little question about shaders, because this seems to be ridiculous: function addToTable() if getElementType(source) == "vehicle" then local model = getElementModel(source) if tank[model] and not table.contains(tanks, source) then table.insert(tanks, source) local leftShader = dxCreateShader("replacer.fx", 0, 100, true) local rightShader = dxCreateShader("replacer.fx", 0, 100, true) setElementData(source, "leftShader", leftShader, false) setElementData(source, "rightShader", rightShader, false) engineApplyShaderToWorldTexture(leftShader, "tex1", source) engineApplyShaderToWorldTexture(rightShader, "tex2", source) end end Why does this code NOT restrict the shader to the "source" element? The shader gets applied to ALL elements, but engineApplyShaderToWorldTexture clearly restricts it to "source". Am i stupid? end addEventHandler( "onClientElementStreamIn", root, addToTable)
-
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
Server still online. Collected and fixed a lot of very small issues and: -implemented all new vehicles into the inventory/shop system Mortars still dont work. I work on it. Should be fixed in 10 hours when i return home. This and 4 other issues still remain. I will release everything as soon as these 5 things are added/fixed. -
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
-fixed a bunch of small issues (thanks for all testers) Server will be online for 24 more hours now. Make sure u have latest 1.5.2 nightly installed before you join, i defined a min_mta_version in my script however maybe it doesnt work, havent tested it. Else you might get giant issues when trying to load huge maps like "Africa" or "Omaha Beach". original r7981 nightly installer for all lazy or unexperienced people: https://nightly.multitheftauto.com/mtasa-1.5.2-r ... 160505.exe -
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
-Implemented new tank damage calculation (it works, yes) -Finished the jets (MGs, sound, everything) -Fixed/improved some small things -MTA 1.5.2 installed, going to open the BETA server tomorrow -
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
Well I couldn't roll back to 1.5 yet however I fixed a number of remaining issues and stuff -fixed GUI exploit that lets you spawn as spectator and other flaws -added custom vehicle images to killmessages resource (needs testing) -Implemented working gears for F-86 and Me 262 Jets Next thing to implement is the new damage calculation for the tanks and the custom MGs for Jets. Both already exists so I guess it's ready tonight, after that I reinstall 1.5.2 -
onClientElementStreamIn does trigger when a vehicle spawns within streaming range of the local player maybe it's useful
-
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
I'm currently using MTA 1.6n but I will move everything to 1.5 again, I guess I can open the beta server tonight after the installation of 1.5. -
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
Current server version = 1.2 Known issues/ Todo list: -implement tail gunnery system for bombers (ball turrets) - implement warships -
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Einheit-101 replied to Einheit-101's topic in Servers to play on
http://i.imgur.com/2B491ln.jpg http://i.imgur.com/JQWaQe8.jpg http://i.imgur.com/JLxjCKK.jpg http://i.imgur.com/dD5395G.jpg http://i.imgur.com/Lt394nq.jpg http://i.imgur.com/Rq7l1MV.jpg http://i.imgur.com/cZQc0T5.jpg http://i.imgur.com/gGlhqyV.jpg http://1.bp.blogspot.com/-eWNnlKFzfzs/V ... -12-57.png http://4.bp.blogspot.com/-gBaMaodVreA/V ... -37-34.png -
Hello Community! Today i proudly present you the project I was working on for years: The probably most realistic competitive world war 2 server of all time for MTA! Maybe you remember the Brandenburger Gate image from mtasa.com or moddb? The time has come to live that dream! http://gta-saaw.blogspot.de/?m=1 FEATURES -2 teams, U.S. Army vs. German Wehrmacht -competitive, ticket based gamemode with stealth elements, up to 52 players -different map types: -TDM (small maps, infantry only) -WAR (big maps, everything allowed) -AIRSTRIKE (self explaining) -TANK WAR (large maps with masses of vehicles) -more planned! -22 different vehicles (Tiger tank, B-17G Bomber...) -Level/ability system -custom sounds, skins, effects and what not -shaders en masse, you can enable/disable them -improved physics, improved bullet sync -a lot of synced custom weapons -realistic weaponry for vehicles (Coaxial MGs, bombs...) -realistic damage model (front/rear armor) -supply system (trucks can deliver ammo to vehicles) -different ammo types (armor piercing, High explosive...) -custom mini-maps for radar -cockpit view for armored vehicles and aircraft -detailed LOD system for the big maps -many, many other smaller things More will come soon. A new addition currently in development are Warships - yes, you read that correct:
-
Just copy the noise code from stealth resource
-
Its a custom component
-
Unfortunately I am not familiar with C++. But the improved sync I wrote with triggerServerEvent once every 50ms works pretty well, the turrets are rotating with ~20 fps and all players are fine with it. Rhino itself is Not better.
-
rx= -1*rx Problem solved
-
Maximum Player limit is 52. How can we use UDP?
-
This wont reduce a lot since most players are in the streaming radius of the tanks anyway in our gamemodes. And for, lets say, maybe 10 or max. 20 tanks the bandwith used by element data is not much if you pass 2 numbers in a table every 50ms. Also, sending of element data is only done if the turret really rotates (see line 66). If the player is not moving the turret, no element data is sent. The next thing i research is if MTA is syncing only the last elementData within the 50ms span or if it transfers all element datas that have been calculated within the 50ms... €DIT2::: yes, MTA sends 4x the same elementData every 50ms when its calculated 4x withing 50ms, so i will have to add a separate timer that sends the elementData only once every 50ms. Example Video: €DIT::: I forgot to add the getCameraRotation part. Add this: function getCameraRotation() local px, py, pz, lx, ly, lz = getCameraMatrix() local rotz = 6.2831853071796 - math.atan2 ( ( lx - px ), ( ly - py ) )% 6.2831853071796 local rotx = math.atan2 ( lz - pz, getDistanceBetweenPoints2D ( lx, ly,px, py ) ) rotx = math.deg(rotx) rotz = -math.deg(rotz) return rotx, 180, rotz end €DIT3::: i changed the elementData syncing so it sends only the last calcualted elementData every 50ms: change setElementData(veh, "turret", {newRZ, newRY}) to setElementData(veh, "turret", {newRZ, newRY}, false) And add this to the top of the script to the global vars local syncTimer replace the onEnter function: function onEnter(player, seat) local model = getElementModel(source) if player == localPlayer and (model == 499 or model == 455) and seat == 0 then syncTimer = setTimer(function() setElementData(veh, "turret", getElementData(veh, "turret")) end, 50, 0) addEventHandler("onClientRender", root, moveLocalTurret) end end addEventHandler("onClientVehicleEnter", root, onEnter) replace the top of the moveLocalTurret function: function moveLocalTurret() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, moveLocalTurret) if syncTimer ~= nil then killTimer(syncTimer) syncTimer = nil end else It should work €DIT4::: edited last post on page 1, everything is in there, just copy it
-
I guess this enables camera turret rotation for custom vehicles as long as the custom vehicle is model 499 or model 455, but you can change that number. My own script here is a lot larger and i extracted the necessary stuff. That means, some things could be missing or so. local syncTimer function onEnter(player, seat) local model = getElementModel(source) if player == localPlayer and (model == 499 or model == 455) and seat == 0 then syncTimer = setTimer(function() setElementData(veh, "turret", getElementData(veh, "turret")) end, 50, 0) addEventHandler("onClientRender", root, moveLocalTurret) end end addEventHandler("onClientVehicleEnter", root, onEnter) function moveLocalTurret() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, moveLocalTurret) if syncTimer ~= nil then killTimer(syncTimer) syncTimer = nil end else local veh = getPedOccupiedVehicle(localPlayer) local model = getElementModel(veh) local cam = getCamera() if isElementStreamedIn(veh) and (model == 499 or model == 455) and getVehicleController(veh) == localPlayer and not isPedDoingTask(localPlayer, "TASK_SIMPLE_CAR_GET_OUT") and not isElementAttached(cam) and not getKeyState("c") then local rotSpeed = 2 local rx, ry, rz = getElementRotation(veh) local rotV, _, rotH = getCameraRotation() rotH = (-1*rotH)-rz local _, _, rh = getVehicleComponentRotation(veh, "misc_a") local ry, _, _ = getVehicleComponentRotation(veh, "misc_b") rotV = math.rad(rotV) local angleDiff = rh-rotH if math.abs(angleDiff) > 180 then if rh > rotH then angleDiff = -1*((360-rh)+rotH) else angleDiff = (360-rotH)+rh end end local movement = 0 if angleDiff > 0.05 and angleDiff <= 0.2 then movement = -0.025 elseif angleDiff > 0.2 and angleDiff <= 2 then movement = -0.1 elseif angleDiff > 2 then movement = -1 elseif angleDiff < -0.05 and angleDiff >= -0.2 then movement = 0.025 elseif angleDiff < -0.2 and angleDiff >= -2 then movement = 0.1 elseif angleDiff < -2 then movement = 1 end newRZ = rh + (movement*rotSpeed) if rotV > 1 then rotV = rotV-(2*math.pi) end movement = 0 local verticalDiff = math.rad(ry) if verticalDiff > 3 then verticalDiff = verticalDiff-(2*math.pi) end verticalDiff = verticalDiff-(rotV+0.14) if verticalDiff > 0.001 and verticalDiff <= 0.01 then movement = -0.025 elseif verticalDiff > 0.01 then movement = -0.25 elseif verticalDiff < -0.001 and verticalDiff >= -0.01 then movement = 0.025 elseif verticalDiff < -0.01 then movement = 0.25 end local newRY = ry+(movement*rotSpeed) if newRY ~= ry or newRZ ~= rh then if (newRY < 350 and newRY > 150) or (newRY > 24 and newRY < 150) then newRY = ry end setVehicleComponentRotation(veh, "misc_a", 0, 0, newRZ) setVehicleComponentRotation(veh, "misc_b", newRY, 0, 0) setElementData(veh, "turret", {newRZ, newRY}, false) end end end end function turretRotator(dataName) if dataName == "turret" and getVehicleController(source) ~= localPlayer then setVehicleComponentRotation(source, "misc_a", 0, 0, getElementData(source, "turret")[1]) setVehicleComponentRotation(source, "misc_b", getElementData(source, "turret")[2], 0, 0) end end addEventHandler ( "onClientElementDataChange", root, turretRotator) function getCameraRotation() local px, py, pz, lx, ly, lz = getCameraMatrix() local rotz = 6.2831853071796 - math.atan2 ( ( lx - px ), ( ly - py ) )% 6.2831853071796 local rotx = math.atan2 ( lz - pz, getDistanceBetweenPoints2D ( lx, ly,px, py ) ) rotx = math.deg(rotx) rotz = -math.deg(rotz) return rotx, 180, rotz end
-
I would use onClientRender + Camera rotation to rotate the turret smoothly and setElementData (rx,ry,rz). Then onElementDataChange for other clients and set component rotation according to the received data. At least that's how I do it with my prototype I can send you some code once it's finished
-
@Dealman i guess a MTA dev would have to tell us the best way to do this since no one of us really knows what MTA does under its coat. As for the 50ms laggy rotation: Everything is lagging by default anyway, so does Rhinos turret. I won't try and write a lag compensation to smooth the rotations. Feel free to do it, maybe its really nice? @Xwad: addEventHandler ( "onClientCursorMove", getRootElement ( ), function ( cursorX, cursorY, absoluteX, absoluteY, x2, y2, z2 ) if not isChatBoxInputActive ( ) and not isMainMenuActive ( ) and not isConsoleActive ( ) and not isCursorShowing ( ) then local x1, y1, z1 = getPedBonePosition ( player, 6 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) outputChatBox( "cursor moved") end end ) This code makes onClientCursorMove NOT possible without cursor. onClientCursorMove IS POSSIBLE WITHOUT cursor showing. Its just nobody knows it (i did not know either, thanks for the hint) so that above code snippet is essentially useless in your script. Btw. this is my Mouselook code, idk if it helps someone: function mouseLook(newX, newY) local cam = getCamera() if isElementAttached(cam) and not isCursorShowing() then --make sure the cam is attached to the vehicle local vx = (newX - 0.5)*400 local vy = (newY - 0.5)*400 --reduce this 400 to make the mouseLook slower local x, y, z, rx, ry, rz = getElementAttachedOffsets(cam) setElementAttachedOffsets(cam, x, y, z, rx-vy, ry, rz-vx) end end addEventHandler( "onClientCursorMove", root, mouseLook)