Jump to content
Mr. Green Gaming

Problem with custom car model and help with mapping :/


Recommended Posts

Posted (edited)

Hi everyone,

When I replace the bandito with this, the car's rear wheels are huge (see attachment below). So how can I make it like on the screenshot from the mod, all wheels-same size and car colour-always black?

 

Also is there any way I can open the door at the abandoned airport in the desert as soon as my map starts as all 57 spawn points are inside the hangar, but it doesn't open up when I approach it with a car from the inside :/

 

And I need to edit the handling on the bandito in order for it to match KITTs, I know that normally I edit handling.cfg, but what should I do so that it remains changed in my map folder? Sry for all of the questions, but I'm new to mapping and stuff :)

 

car wheels.bmp door always closed.bmp

Edited by MegasXLR
Posted (edited)

I found this, but don't know if I should copy it in a .lua file or not?

 

EDIT : tried making a .lua and doesn't work :/ Anyone got other ideas?

make sure you typed right garage id in this line "GARAGE_ID = 25

here's garage ID's http://wiki.multitheftauto.com/wiki/Garage

Edit: or try this

function opengarage()setGarageOpen(41,true)endaddEventHandler('onClientResourceStart', getResourceRootElement(),opengarage)

 

anyways i'm not sure if it will work with map.

Edited by Bob_Tailor
Guest AleksCore
Posted (edited)

for handling try learn some lua.. 2hard4u tho  :P

 

Here's just example of script. It must be server-side

local veh = 411function resetHandling()for k,_ in pairs(getModelHandling(veh)) dosetModelHandling(veh, k, nil)endendaddEventHandler("onResourceStop", root, resetHandling)function onEnterVehicle ( theVehicle, seat, jacked )    if getElementModel ( theVehicle ) == veh thensetVehicleHandling(theVehicle, "engineAcceleration", 24)setVehicleHandling(theVehicle, "tractionMultiplier", 1)setVehicleHandling(theVehicle, "centerOfMass", {0.0, 0.1, -0.6} )setVehicleHandling(theVehicle, "maxVelocity", 350)setVehicleHandling(theVehicle, "steeringLock", 50)setVehicleHandling(theVehicle, "collisionDamageMultiplier", 0.1)setVehicleHandling(theVehicle, "mass",1400)setVehicleHandling(theVehicle, "turnMass", 3400)setVehicleHandling(theVehicle, "dragCoeff", 2.4)setVehicleHandling(theVehicle, "percentSubmerged", 75)setVehicleHandling(theVehicle, "tractionLoss", 0.8)setVehicleHandling(theVehicle, "tractionBias", 0.50)setVehicleHandling(theVehicle, "numberOfGears", 5)setVehicleHandling(theVehicle, "engineInertia", 5)setVehicleHandling(theVehicle, "driveType", "awd")setVehicleHandling(theVehicle, "engineType", "petrol")setVehicleHandling(theVehicle, "brakeDeceleration", 10)setVehicleHandling(theVehicle, "brakeBias", 0.5)setVehicleHandling(theVehicle, "ABS", false)setVehicleHandling(theVehicle, "suspensionForceLevel", 1.2)setVehicleHandling(theVehicle, "suspensionDamping", 0.15)setVehicleHandling(theVehicle, "suspensionHighSpeedDamping", 0.0)setVehicleHandling(theVehicle, "suspensionUpperLimit", 0.28)setVehicleHandling(theVehicle, "suspensionLowerLimit", -0.2)setVehicleHandling(theVehicle, "suspensionFrontRearBias", 0.5)setVehicleHandling(theVehicle, "suspensionAntiDiveMultiplier", 0.3)    endendaddEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle )

setVehicleHandling

Scripting Introduction

Edited by AleksCore
Posted (edited)

function opengarage()setGarageOpen(41,true)endaddEventHandler('onClientResourceStart', getResourceRootElement(),opengarage)

anyways i'm not sure if it will work with map.

 

 

The door script works, thanks Bob :)

I'll take a look at the handling editor and try to learn more lua as Aleks suggested when i've got some free time.

 

Now if I can only get the wheels to appear as the front ones (not big as are now) and the car colour to always be black, I can start making my map tomorrow :)

Edited by koragg
Posted (edited)

Thanks Aleks :-) I'll have a look. But one thing : I've got this -->

 

Hadling.cfg
BANDITO      1400.0    2000.3   1.5    0.0 0.0 -0.25 70  0.70 0.8  0.46         5 250.0 32.0 10.0 R D   9.0  0.51 1 30.0       1.2  0.19  0.0   0.25 -0.10 0.5  0.4            0.37 0.72 95000         40002004         C04000                    1    1  1
Vehciles.ide
568,     bandito,     bandito,     car,         BANDITO,     BANDITO,    null,    ignore,        10,    0,    0,            -1, 0.7, 0.7,
carcol.dat
bandito, 0,34

 

as handling for the vehicle i have to change. How do I know which numbers from above means what from your script ^^?

 

PS : I noticed that by changing vehicles.ide and carcols.ide the wheels problem is gone and car colour is always black (tried on normal SA).

Edited by koragg
Guest AleksCore
Posted (edited)

first - vehicle name(bandito), second - mass(1400), third - turn mass(2000.3) etc.

 

http://gta.wikia.com/Handling.cfg/GTASA

 

Early we had online converter (handling.cfg line to lua), but site doesn't exist anymore tho

Edited by AleksCore
Guest AleksCore
Posted (edited)

Try to replace on infernus (411 id).

It works good with infernus.

post-2580-0-31822600-1415570988_thumb.pn

About vehicles.ide - here's nothing interesting in this file and nothing that you can use in mta. For car colours you can use this:

function onEnterVehicle ( theVehicle, seat, jacked )    if getElementModel ( theVehicle ) == 411 then        setVehicleColor ( theVehicle, 0, 0, 0)         setVehicleHeadLightColor ( theVehicle, 255, 0, 0)    endendaddEventHandler ( "onPlayerVehicleEnter", root, onEnterVehicle )

Simply place lua (car_color.zip) file in map folder and this line in meta.xml: 

<script src="car_color.lua" type="client"></script>

P.S. right now I manually converting all this (handling.cfg) for you dude. Can someone make simple converting tool for this? Damn :D It's like pain in the ass to convert it manually.

P.P.S. here is car. I've made all work for you. You just need to add this (carforkorrag.zip) files in map folder and add this lines in meta.xml of your map. I've replaced infernus. 

<script src="car_c.lua" type="client"></script><script src="car_s.lua" type="server"></script><file src="car.txd" /><file src="car.dff" />
Edited by AleksCore
Posted (edited)

Car colour doesn't stay black, it changes on every spawn and infernus has original SA wheels (looks weird :D)

I tried adding -- upgrades="0" /-- at the end of each spawn point in .map file, but that way the map doesn't load at all :(

Edited by koragg
Guest AleksCore
Posted (edited)

I tried adding -- upgrades="0" /-- at the end of each spawn point in .map file, but that way the map doesn't load at all :(

It means you made something wrong. You must know, it's like program. If one symbol wrong - whole program will not work. Same here.

Example how it must be:

<spawnpoint id="spawnpoint (Bullet) (1)" vehicle="541" posX="3824.7746582031" posY="-3368.9592285156" posZ="10.710000038147" rotX="0" rotY="0" rotZ="180" upgrades="0" />

About colors.. This script will work only for id 411 (Infernus). It's pretty simple to change id. This script must work, have no idea what problems you have

Edited by AleksCore
Posted (edited)

I tried this way

<spawnpoint id="spawnpoint (Bandito) (1)" vehicle="568" posX="424" posY="2438" posZ="16.5" rotX="0" rotY="0" rotZ="0" upgrades="0"></spawnpoint>

didn't work. Tried this way

<spawnpoint id="spawnpoint (Bandito) (1)" vehicle="568" posX="424" posY="2438" posZ="16.5" rotX="0" rotY="0" rotZ="0" upgrades="0"/></spawnpoint>

Nope. Also did this

<spawnpoint id="spawnpoint (Bandito) (1)" vehicle="568" posX="424" posY="2438" posZ="16.5" rotX="0" rotY="0" rotZ="0" upgrades="0"/ ></spawnpoint>

Gave every possible one and still gets stuck on "opening map..."

 

The thing is that I need to replace the Bandito, because only this way the scanner on the front works (it should move like this). So yeah, that's why I wanna fix the wheels problem on the Bandito and make it always be black.

Edited by koragg
Guest AleksCore
Posted (edited)

Attach your map. Let me see

 

About Bandito.. I am working on it. I tryed to change handlingFlags by  

setVehicleHandling(theVehicle, "handlingFlags",  tonumber("0x00412212"))

and

setVehicleHandling(theVehicle, "handlingFlags",  tonumber("00412212"))

And nothing. Idk how it works

Edited by AleksCore
Posted (edited)

OK. About the wheels problem I just found that if I don't edit vehicles.ide on normal SA, the same thing happens (large rear wheels, normal front ones). So I need a script which replaces Bandito's line with

568,     bandito,     bandito,     car,         BANDITO,     BANDITO,    null,    ignore,        10,    0,    0,            -1, 0.7, 0.7,

That way the car will look normal (like on mod's screenshot).

 

https://forum.mtasa.com/viewtopic.php?f=91&t=35990(maybe smth like this, if  ImportDATA "Vehicle.ide" function even exists)

http://www.gta-modding.com/san_andreas/tutorials/vehicles_ide.html(look at numbers 12,13,14 - all are about wheels size and stuff)

 

We'll worry about a colour script later :P

Edited by koragg
Guest AleksCore
Posted (edited)

https://forum.mtasa.com/viewtopic.php?f=91&t=35990(maybe smth like this, if  ImportDATA "Vehicle.ide" function even exists)

What is that? there's no such function loadData, importData.

P.S. I thought problems with color was solved in my post.

Simply place lua file from car_color.zip in map folder and this line in meta.xml:

<script src="car_color.lua" type="client"></script>
Edited by AleksCore
Posted

I thought problems with color was solved in my post.

Simply place lua file from car_color.zip in map folder and this line in meta.xml:

<script src="car_color.lua" type="client"></script>

Dunno why, but colour is still changing on every spawn : I decided to use Cheetah (has nice handling). It should be like this, right?

function onEnterVehicle ( theVehicle, seat, jacked )    if getElementModel ( theVehicle ) == 415 then        setVehicleColor ( theVehicle, 0, 0, 0, 0 )         setVehicleHeadLightColor ( theVehicle, 255, 0, 0)    endendaddEventHandler ( "onPlayerVehicleEnter", root, onEnterVehicle )
Posted

LOL, I just noticed that the customcar.txd is huge (6-7MB). How will I be able to upload my map when map size limit is 5MB? :/ I read that I can edit it with TXD Workshop to make the .txd smaller in size without losing quality, but can't find tutorial on doing it. Anyone got an idea how i can do it? (or just post link to tut)

Guest AleksCore
Posted (edited)

 

I thought problems with color was solved in my post.

Simply place lua file from car_color.zip in map folder and this line in meta.xml:

<script src="car_color.lua" type="client"></script>

Dunno why, but colour is still changing on every spawn : I decided to use Cheetah (has nice handling). It should be like this, right?

Damn sorry. My fault. It must be server-side. Meta.xml:

<script src="car_color.lua" type="server"></script>
Edited by AleksCore
Posted

But I already know all that stuff, the video doesn't say how I can decrease .txd size. FYI, all the images inside my BIG .txd are compressed, so that's done.

 

 

I thought problems with color was solved in my post.

Simply place lua file from car_color.zip in map folder and this line in meta.xml:

<script src="car_color.lua" type="client"></script>

Dunno why, but colour is still changing on every spawn : I decided to use Cheetah (has nice handling). It should be like this, right?

Damn sorry. My fault. It must be server-side. Meta.xml:

<script src="car_color.lua" type="server"></script>

Thanks, now it works. Awesome :-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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