Moony

Members
  • Content Count

    96
  • Joined

  • Last visited

Community Reputation

5 Neutral

About Moony

  • Rank
    Punk-@ss B*tch
  • Birthday 27/01/1993

Details

  • Gang
    What's a Gang?
  • Location
    Argentina
  • Occupation
    Musician
  • Interests
    Music

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I heard about shaders, but I don't have enough knowledge yet. Would you please explain a bit more about shaders?
  2. I already have such script. I just wanted to add more variety to the wheel models. I haven't found I way to change the color of the object, so I thought I could add more models while learning about colors.
  3. The wheel upgrades have a limited amount of wheels. Replacing those can give you a limited amount of options. I was thinking that if I could "preload" more skins, I could make functions that also replace the .txd and .dff for each wheel, thus, surpassing the amount of changable wheels.
  4. After a lot of work and several tests, we managed to fix it. Case dismissed.
  5. I apologize for the format. I hope you can see the video correctly. The only thing that changed with the line provided (and also happened with the previous line) is that the width modifier now is modifying the height as seen in the video. I'm certain this is happening because there are values being read when they shouldn't. I'll try to fix that in the meantime. Regardless, they wheels are still not on ground level. I'll mess around with the values to see if I find anything weird.
  6. Here it is: function wheel1Move() local px1, py1, pz1 = getVehicleComponentPosition(vehicle, "wheel_lf_dummy") local vehicle = getPedOccupiedVehicle (localPlayer) if not vehicle then return end -- Gets ride of a couple of DB 3 errors. local wrx1, wry1, wrz1 = getVehicleComponentRotation (vehicle, "wheel_lf_dummy") attachElements (wheel1, vehicle, px1, py1, pz1, wrx1, wry1, wrz1) -- attachElements(wheel1, vehicle, px1, py1, pz1+getElementDistanceFromCentreOfMassToBaseOfModel(wheel1)*getObjectScale(wheel1)-getElementDistanceFromCentreOfMassToBaseOfModel(wheel1), wrx1, wry1, wrz1) -- Alternating between both 'attachElements' gives the same result show in the picture. end addEventHandler ("onClientPreRender", getRootElement(), wheel1Move) [IMAGE] * Ignore the excessive brightness. That's another issue I'll have to resolve.
  7. I've placed everything but the resizing in the 'onClientPreRender'. The resizing has the "stick to ground" function as well as the 'setObjectScale' only modifying the two necessary values. This is on a separate 'onClientGUIScroll'. I'm playing around with the functions, but I can't figure it out. I either get the glitchy will that is still anchored to the center, or no wheel at all. Sometimes the wheel flashes as it is rescaled, sometimes it looks clear. What's certain is that I can't find the correct setting to keep the wheels grounded. I've made sure there are no new instances of the wheels. I've placed the "stick to ground" function inside the 'onClientPreRender' function so it always updates the Z value. The scrollbar only modifies the scale of the wheel. [IMAGE]
  8. I apologize for the multiple posts; everytime I finish posting, I dare myself to test some more... As of this moment, the following function lets my set the diameter of the wheels. However, the wheels are pivoting from their center; if the size is small enough, they float; if they are big enough, they clip through the ground. fdiam = guiCreateScrollBar (0.09, 0.66, 0.375, 0.06, true, true, wheelWnd) local function setScaleFront () local vehicle = getPedOccupiedVehicle(localPlayer) if not vehicle then return end local fdim = guiScrollBarGetScrollPosition(fdiam) local fx1, fy1, fz1 = getObjectScale (wheel1) local fx2, fy2, fz2 = getObjectScale (wheel2) setObjectScale (wheel1, fx1, fdim/100+0.5, fdim/100+0.5) setObjectScale (wheel2, fx2, fdim/100+0.5, fdim/100+0.5) local x1, y1, z1 = getElementPosition (wheel1) -- attachElements(wheel1, vehicle, x1, y1, z1+2+getElementDistanceFromCentreOfMassToBaseOfModel(wheel1)*getObjectScale(wheel1)-getElementDistanceFromCentreOfMassToBaseOfModel(wheel1), 0, 0, 180) -- [Notice the above function disabled] end addEventHandler("onClientGUIScroll", fdiam, setScaleFront, false) Everything else works correctly: rotation, suspension, width and position relative to the center of the wheel dummy.
  9. Here's the function that used to handle the diameter of the wheels, one for both front wheels, and one for the rear wheels: fdiam = guiCreateScrollBar (0.09, 0.66, 0.375, 0.06, true, true, wheelWnd) local function setScaleFront () local vehicle = getPedOccupiedVehicle (localPlayer) local valueFront = guiScrollBarGetScrollPosition (fdiam) local sx1, sy1, sz1 = getObjectScale (wheel1) local sx2, sy2, sz2 = getObjectScale (wheel2) local px1, py1, pz1 = getVehicleComponentPosition (vehicle, "wheel_lf_dummy") local px2, py2, pz2 = getVehicleComponentPosition (vehicle, "wheel_rf_dummy") -- setObjectScale (wheel1, valueFront/100+0.5) -- setObjectScale (wheel2, valueFront/100+0.5) -- attachElements (wheel1, vehicle, px1, py1, pz1+getElementDistanceFromCentreOfMassToBaseOfModel(wheel1)*getObjectScale(wheel1)-getElementDistanceFromCentreOfMassToBaseOfModel(wheel1)) -- attachElements (wheel2, vehicle, px2, py2, pz2+getElementDistanceFromCentreOfMassToBaseOfModel(wheel2)*getObjectScale(wheel2)-getElementDistanceFromCentreOfMassToBaseOfModel(wheel2)) -- setObjectScale (wheel1, valueFront/100, valueFront/100, valueFront/100) -- setObjectScale (wheel2, valueFront/100, valueFront/100, valueFront/100) -- local position1 = getElementPosition (wheel1) -- local position2 = getElementPosition (wheel2) -- setElementPosition (wheel1, 0, 0, valueFront+0.01) -- setElementPosition (wheel2, 0, 0, valueFront+0.01) end addEventHandler("onClientGUIScroll", fdiam, setScaleFront, false) RESULT ** I've disabled everything. I tried to find the error but couldn't. The front train is the one available right now. I've disabled the rear train. As the bar is scrolled, the wheel jumps in a glitchy manner following an imaginary line that goes from the center of the car to the right top front corner. For every pixel that the bar is moved, the wheel jumps into this imaginary line and then returns to its ideal position. I think I know what the problem is. 'onClientPreRender' is constantly updating the position of the wheels. The wheel is kept on the ground only when the scrollbar is moved because the function is triggered by said event. When the bar is static again, the wheels' position is then updated again by the 'onClientPreRender'. In other words, I've got two 'attachElements' that are bumping eachother trying to fit in a very narrow door.
  10. Thought I could try a few things. Now that I know about 'onClientPreRender', I tried adding the suspension effect. You can do it the same way you used the handler for the rotation. I used your same format and 'getElementPosition' and 'attachElements' to set the position. It's hard to notice, but the front wheel is pressing up, while the rear wheel is almost hanging. [IMAGE]. Those are the custom wheels. If I only press the button to apply the set of wheels, they will show the noinclination mistake. Strangely, if I scroll the bar, they will light-speed move between a normal state and the no-inclination state. As if the commands were happing both everytime the scroll moves one point. I've managed to get a single frame by spamming the F12 to get the screenshot: [IMAGE] That screenshot also shows that the scrollbar updates not only the inclination, but the position as well. The scrolling also calls for the ground level. As soon as I lift the mouse off the bar, the wheels lose the ground effect and starts floating. I'll try to fix how the size effect works on the wheels and the angle/wobble with your last comment. Do you want me to show you the script? ---- ---- ---- ---- UPDATE: I tried your last suggestion, and it worked perfectly. I had to remove the "+rotz" to get rid of the vehicle's rotation adding to the wheels rotation. It all works perfectly ❤️ UPDATE_2: keep ground level while resizing has stop working. Now there is a glitchy wheel that starts off from the center of the car and explodes off and get bigger as I increase the value of the scrollbar. As for the wheels, they glitchily increase size while staying anchored to their center.
  11. I've managed to: - Set the wheels at ground level at all times when resizing. - Set the rotation to follow the dummies' rotation (including the steering). - Add an extra resize width scrollbar. After reading a few posts, I fell victim of the same strange effect mentioned in them: if the cars have either the McPhearson suspension or the Reverse suspension applied, or the wheels change their Y rotation for any reason, a strange wobble effect appears on the wheels-object. Apparently, the wheels-object, as it constantly grabs the position of the wheels-dummy, when these change their Y rotation, the wheels-object do so too, but this Y rotation axe spins as well, giving the effect of a severely uncentered wheel. Is there any way to fix this? I read something about locking the Y and X rotation... Additionally, I've noticed that when changing the cars inclination, the wheels do not get this inclination. Instead, they stay perpendicular to the ground: [IMAGE] Also, there is no suspension on the wheels-object. Could this be fixed with an "onClientPreRender" applied to a function that gets the position of the dummies and then setting said position to the objects? Finally, and out of context, how can I stop the script from running when there are no custom wheels applied? DB 3 goes nuts because it is not finding any wheels to apply all these functions. This also applies to a button that removes the wheels: there is no wheel to remove, so the script throws a warning. Thanks for all the help so far! I can't think you enough.
  12. I'm pretty sure I'm not getting the functions. Nothing happens. Wheels are still static. I don't get how they both work, and how they have to be used to give the desired effect. I tried: local vehicle = getPedOccupiedVehicle(localPlayer) local x1, y1, z1 = getVehicleComponentPosition(vehicle, "wheel_lf_dummy") local a1, b1, c1 = getGroundPosition (x1, y1, z1) wheel1 = createObject (1097, a1, b1, c1, rx1, ry1, rz1) attachElements (wheel1, vehicle, a1, b1, c1, rx1, ry1, rz1) DB 3 returns "attempt to call global 'getGroundPosition' (a nil value) My thought process was (while hardly understand how the functions work): Get the ground position of the coordinates of the left front wheel of the vehicle being driven by the local player. Apply that position to the creation of the object and the attachment of the element.
  13. UPDATE: I've managed to set a minimum size to the wheels. However, I'm still having trouble getting the wheels to stay at ground level. Additionally, are there any functions to apply the rotation and steering visuals of the original wheels to the attached objects?
  14. Alrighty! Big progress has been made. Would you mind helping me a bit more? I've managed to set all 4 wheels in the appropiate place and apply a function to them to set the size. IMAGE I'd like to know if there is a way to keep the wheels grounded; they are anchored to the center. Is there a function that can help me in such way? Also, as soon as the scrollbar is moved, the wheels begin from practically a zero size, and scale 100 points (scroll value was divided by 100). Would it be possible to set the lowest limit? Here's the function that handles the size: -- Parent function that creates everything fdiam = guiCreateScrollBar(0.09, 0.66, 0.752, 0.06, true, true, wheelWnd) local function setScaleFront() local vehicle = getPedOccupiedVehicle(localPlayer) local valueFront = guiScrollBarGetScrollPosition(fdiam) local size = getObjectScale (wheel1) setObjectScale (wheel1, valueFront/100, valueFront/100, valueFront/100) setObjectScale (wheel2, valueFront/100, valueFront/100, valueFront/100) -- local position1 = getElementPosition (wheel1) -- local position2 = getElementPosition (wheel2) -- setElementPosition (wheel1, 0, 0, valueFront+0.01) -- setElementPosition (wheel2, 0, 0, valueFront+0.01) -- Failed attempt to set a dynamic position that increases -- 0.01 the position. end addEventHandler("onClientGUIScroll", fdiam, setScaleFront, false) -- Everything else.