Jump to content

Dzsozi (h03)

Members
  • Posts

    696
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Dzsozi (h03)

  1. Hello! I was browsing around mods and stuff for GTA SA and I found this video on youtube. My question is how can I reach the same effect in MTA? What functions I need to make the vehicles flip more easily when touching the ground with the roof or something else but wheels. I already figured out how can I stop vehicles from sliding on the ground if they are on their roof or side, but I would like to know how can I reach this effect that can be seen in the video. Just check it and you will probably understand what I mean by "stickier" ground. What functions will I need to use, or how can I make a similar effect on vehicle physics? I downloaded the files so I can see if there is anything that helps me, but not too much, only a handling.cfg (which I don't think how they achieved this, or not ONLY by handling) and a .dat file, which I opened, but contained not enough information for me to help me out with this. Thank you for your answers in advance! P.S.: If anybody is interested in how I made the vehicles stop from sliding when flipped, here's the script: function isVehicleOnRoof(vehicle) local rx,ry=getElementRotation(vehicle) if (rx>90 and rx<270) or (ry>90 and ry<270) then return true end return false end addEventHandler("onClientVehicleCollision", root, function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and isElement(vehicle) then if isVehicleOnRoof(vehicle) then if getVehicleSpeed(vehicle) > 1 then local multiplier = 0.015 local speedX, speedY, speedZ = getElementVelocity (vehicle) local loweredSpeedX, loweredSpeedY, loweredSpeedZ = speedX-(speedX*multiplier), speedY-(speedY*multiplier), speedZ-(speedZ*multiplier) setElementVelocity(vehicle, loweredSpeedX, loweredSpeedY, loweredSpeedZ) end end end end) EDIT: lol sorry for the long title
  2. v0.2 - Improved the custom damage handling Every vehicle has different loss-limits, which depend on the mass and collision damage multiplier of the vehicle Added electric damage Minimum vehicle health could be 500 If the vehicle health reaches the minimum, loss-limits will be lowered - Improved vehicle handlings (unfinished) Vehicles accelerate slower Vehicles steer harder More realism (for example, non AWD vehicles drive harder on terrain, etc.) Vehicles don't flip too easily anymore, they do flip although Once your vehicle is flipped, you can't unflip it by reversing and holding left/right steer key - Improved custom vehicle sounds, mostly minor bug fixes and changes (unfinished) - Improved the anti-players-pushing-vehicles feature (vehicle will unfreeze if you are not in contact with the vehicle anymore, before that it unfreezed only when you entered the vehicle or pushed it with another vehicle) The vehicle health bar is just temporary. Breakdowns won't happen as frequently as shown in the video. Fire damage will only be applied if smoke damage is applied. Video (sorry for the bad quality):
  3. Recorded v0.2, editing and uploading it tomorrow, a little bit more complex stuff to come.
  4. Hello! This is my first time working with shaders and I bumped into a problem. I would like to define two textures in one shader file, so I need less coding in lua and don't have to create the shader two times. I want to make a back-up light system for vehicles and I want to reach that by changing the vehiclelights128 and vehiclelightson128 textures. Since these are two different textures, I must replace them both when backing up with a car, since I can't detect if the lights are on or off if the setVehicleOverrideLights is set to 0 (default, changing automatically). That's why I would like to create something like onTexture and offTexture inside the shader file, but I don't know how can I do that, since I have never worked with shaders before. I tried something like this, but this doesn't work: Shader file: texture onTexture; texture offTexture; technique hello { pass P0 { Texture[0] = onTexture; Texture[1] = offTexture; } } I don't know how I should do this. And the lua file (only a part of it, the backing mechanism and everything works): if not shaderReverse and seat == 0 then shaderReverse = dxCreateShader ( "files/texture.fx" ) textureReverse = dxCreateTexture ( "files/images/vehiclelightsreverse128.png", "dxt5" ) textureReverseOn = dxCreateTexture ( "files/images/vehiclelightsonreverse128.png", "dxt5" ) end if shaderReverse then engineRemoveShaderFromWorldTexture ( shaderReverse, "vehiclelights128", vehicle ) engineRemoveShaderFromWorldTexture ( shaderReverse, "vehiclelightson128", vehicle ) end if engine then if getControlState("brake_reverse") and gear == 0 and getVehicleSpeed(vehicle) > 0 then dxSetShaderValue ( shaderReverse, "onTexture", textureReverseOn ) engineApplyShaderToWorldTexture ( shaderReverse, "vehiclelightson128", vehicle ) dxSetShaderValue ( shaderReverse, "offTexture", textureReverse ) engineApplyShaderToWorldTexture ( shaderReverse, "vehiclelights128", vehicle ) end end So what doesn't work: the textures get replaced immediately on resource start, it worked when I did it with one texture in the shader file, but then I couldn't change the vehiclelightson128 texture, that's why I want to "define" two textures in the shader file. Hope you understand me. Thank you for your help in advance!
  5. Alright, awesome, feel free to post suggestions, I would be happy if I could read them!
  6. That will be an addition as well, these are all basic stuff that the system will contain by default, expect more complex stuff than these.
  7. Of course, that's basic stuff, I wanted to do advanced lights, indicators and etc. My answer for the smoke stuff: I think it looks more realistic, also, I would like to represent the exhaust pipe and the stuff around it at the bottom of a car being damaged. v0.2 almost done, since I posted the video I have made lots of changes. I think today I will be able to post about v0.2.
  8. Just added the video I was talking about, preview of v0.1.
  9. Hello! I started working on a vehicle realism system project, and I would like to introduce it to you. What does the system (will) contain? Currently has: - Custom sounds for vehicles - Custom damage "handling" (scroll down a little bit to see what I mean by that) - Players can't push the vehicles with "bare hands", by just running into them, vehicles will stay in one place, but you can push a car with another car or other vehicle I just started working on this, it is in alpha state, so right now it has a lot of bugs, but not so much that I can't make a video about it, so video coming soon (I already recorded it, I just have to edit, render and upload it)! Will feature: - Panels on vehicles (mostly cars) won't break if you collide with something if you are not going so fast, kind of a bug fix, since GTA SA handles these door and etc. breakings really bad, but if you go with high speed the damage will be applied - Probably a little bit complex (at least more complex than current ones) fuel and some other engine systems - Interaction with vehicles, like opening doors from outside, etc. - More realistic handlings - Realistic ramming system, for example if you hit an other player at high speed, your car won't fly up in the air, making the other player just fall down in front of the vehicle and losing a little bit of health - another example: if you collide with a breakable fence, bollard, lamp or something at high speed, it will break more easily, depending on the object you collided with - Engine failure system - breakdowns - Some basic stuff for cars, like travel meter, indicators and etc. - Custom events and functions, like onVehicleRepair, etc. - Custom siren sounds and sirens, flashers for emergency and other vehicles with sirens - Vehicles will get dirty depending on the surface you drive it on, for example, gets dirty on: mud, grass, sand etc. surfaces, and nothing will happen if you drive on surfaces like: concrete, road, etc. Therefore you will have to get your car to a carwash. That's it for now, I can't remember anything else I wanted to do, if something comes into my mind I will just put it in the "Will feature" section. So what do I mean by custom damage handling? You will see it in the video, but for a short explanation: Right now every vehicle's health will only go down to 650 HP, not below, from there, if you collide with something and the vehicle lost more HP than 75 HP, your vehicle will start releasing smoke from the rear tyres. From now on, your vehicle has an element data, which means that your vehicle is overheating and damaged, that's why there is smoke coming out from it, but not in the regular way. You can damage your vehicle however you want, it won't blow up until it loses 150 or more HP. If your vehicle loses 150 (or more) HP, it will be set on fire at the same spot, next to the rear tyres, just like in GTA IV, however, you can still drive it. From this moment, you have 10 seconds to leave your vehicle and run away, after 10 seconds it will blow up. Of course, you will be able to fix and remove the smoke leaking from the vehicle, but you won't be able to "cancel" the blowing up process by fixing the vehicle. So this is what I mean by "custom damage handling", it is a little bit harder to blow up a vehicle, it's like it has more health, since you can damage it with hands and weapons that doesn't remove more HP than 150 at once. As I already wrote, video will be coming soon! P.S.: Sorry for the (grammar) mistakes in sentences, if I made any, I'm not perfect at English. v0.1 - Custom sounds for vehicles - Custom damage "handling" (scroll down a little bit to see what I mean by that) - Players can't push the vehicles with "bare hands", by just running into them, vehicles will stay in one place, but you can push a car with another car or other vehicle Video:
  10. Hello! First of all, my question is if it is possibble to make a color gradiented instead of a solid colored dx element, mainly a dx rectangle. If so, how I could achieve that? Like this: Thank you for your answer in advance!
  11. Hello! Sorry for posting here, I don't know which would be the correct forum for this question, maybe none, but I need help asap, and I thought that this would be the fastest way where I could get help. And since I need it for scripting, it is not really off topic. My question is if anybody knows which font is it? I mean the "+100" and the "One shot One kill" texts, does anybody know which font is it? I would need it really bad and I can't find it. It is not the bankgothic, the letters and numbers doesn't look the same. Thanks for your help in advance!
  12. @Zango I like your second idea better, but I also like parts of the first one. I will try to mix these two, my idea is to create a timer after a certain distance, and then burst the tyres, the timer would have a random time generated by the script if the driver goes above the given distance, and then reset the distance counter after the tyre was burst, so the whole thing starts from the beginning with a newly generated timer with a random time. Thanks! One more question, which is better in your opinion? - to use the setTimer function - to use onClientRender and getTickCount? Right now I find the second one easier and better, but I don't know, I really want to prevent lags and fps drops.
  13. Hello! I would like to create a script in which your vehicle's tyre would burst randomly, so I can do things like you will have to change tyres, etc. but I don't know what would be the most efficient way to do this, since I will have to do it server side to sync it, I don't think setTimer is a good choice, therefore there would be lots of timers which is not really good I guess. Or is it okay to use timers? If so, how should I use them, when to create and kill them, etc. Any suggestions or help in connection with that? Has anybody made something similar like this?
  14. I know it doesn't remove the lights, but this is one useful resource if you want darker nights without shaders. https://community.multitheftauto.com/index.php?p=resources&s=details&id=9333 I think you should at least try it and see if you like it.
  15. You can try using https://wiki.multitheftauto.com/wiki/CreateAnimation function. I didn't test it or tried it out but it might work.
  16. Fixed it by myself omg... The problem was in the meta, I should write the weatherS.lua before the waterS.lua, not after the waterS.lua. Thank you anyway!
  17. Still not working, btw, it must be added there so you can use the event in other resources as well.
  18. Hello! I am trying to make a new custom server-sided event for my weather system, but for some reason it doesn't work in an other script. Here's the handling of my custom event in weatherS.lua: addEvent("onWeatherChange", true) local lastWeather = getWeather() function checkNewWeather() local weather = getWeather() if weather ~= lastWeather then triggerEvent("onWeatherChange", getRootElement(), lastWeather, weather) lastWeather = weather end end setTimer(checkNewWeather, 50, 0) And here's the part that doesn't work inside waterS.lua: function testWeatherEvent(lastWeather, weather) outputChatBox(tostring(weather)) outputChatBox("lol") end addEventHandler("onWeatherChange", getRootElement(), testWeatherEvent) It doesn't output anything from the waterS.lua, not even the "lol" string. Finally, here's my meta.xml: <meta> <download_priority_group/>2<download_priority_group/> <script src="waterS.lua" type="server" /> <script src="weatherS.lua" type="server" /> <script src="timecycS.lua" type="server" /> <export function="onWeatherChange" type="server" /> </meta> Could somebody tell me what is the problem or what am I doing wrong, or help me fixing this?
  19. I was thinking about that too, but I think there would be too much objects then. EDIT: And also, when using the useLODs setting in the maps' meta file, it won't change, the default SA model will still be visible as a LOD (I guess).
  20. I checked it this way and it says false, but I don't know why. function fixWallModelLODs() for index, mod in pairs(mods) do if string.find(mod.fileName, "/walls/") then for k, v in ipairs(getElementsByType("object")) do if getElementModel(v) == mod.modelID then return outputChatBox(tostring(setLowLODElement(v, v))) end end end end end
×
×
  • Create New...