[.xml] Tricks, Discoveries and Joy

Started by Sebastian, Jun 09, 2019, 03:52 PM

Previous topic - Next topic

Sebastian

I've made this post so I can share what I've found, with you.
Don't know how many of you know, but you can play with the engine more than R* did when about special features of vehicles.
Didn't test too much, but will update when I have news.
Also, if you have your own discoveries, feel free to share. Will put it in the list.

Handling.cfg explained: https://projectcerbera.com/gta/vc/tutorials/handling

Flags calculator: https://vc-flags.netlify.com/
Original Author: @maxorator
Modified by: @MEGAMIND



1. Emergency Lights/Taxi Light can be used even if the vehicle is not properly categorized

Take the Flying Delly as example.
All you need to do, is adding this <specials></specials> category and play with the settings inside, like colors, position, if the lights should be turned on all the time or not, etc
[spoiler=Taxi Light]
<specials>
<taxilight>
<alwayson>false</alwayson>
<colour>128,128,0</colour>

<position>
<x>0.0</x>
<y>0.0</y>
<z>0.95</z>
</position>
</taxilight>
</specials>
[/spoiler]
[spoiler=Police style]
<specials>
<emlights>
<alwayson>true</alwayson>
<colourone>50,255,50</colourone>
<colourtwo>50,50,255</colourtwo>

<posleft>
<x>-0.750687</x>
<y>-2.64971</y>
<z>-0.147924</z>
</posleft>

<posright>
<x>0.750687</x>
<y>-2.64971</y>
<z>-0.147924</z>
</posright>
</emlights>
</specials>
[/spoiler]
[spoiler=FBI style]
<specials>
<emlightsingle>
<alwayson>false</alwayson>
<colour>70,70,255</colour>

<position>
<x>0.4</x>
<y>0.6</y>
<z>0.3</z>
</position>
</emlightsingle>
</specials>
[/spoiler]



2. Heli weapons will work only with heli flags, in .xml

Simple: Even with the weapons code inserted, weapons won't be active, if you use different flags than heli's.
So, in order to use Hunter's weapons, you gonna add heli's flags + specials + helidata.
Then, via script, you can play how much you want with the flags, because when you gonna reset the flags to heli's, weapons will be still working.

Heli's flags:
<flags>08028000</flags>[spoiler=Hunter's settings]
<helidata>
<helitype>hunter</helitype>
<weapons>hunter</weapons>
<rotorradius>6.150000</rotorradius>
<rotordammult>0.500000</rotordammult>
</helidata>

<specials>
<heliweps>
<missilepos>
<x>2.5</x>
<y>1.0</y>
<z>-0.5</z>
</missilepos>

<machinegunpos>
<x>0.0</x>
<y>4.8</y>
<z>-1.3</z>
</machinegunpos>
</heliweps>
</specials>
[/spoiler]
[spoiler=Sea Sparrow's settings]
<helidata>
<helitype>water</helitype>
<weapons>sparrow</weapons>
<rotorradius>5.150000</rotorradius>
<rotordammult>0.800000</rotordammult>
</helidata>

<specials>
<heliweps>
<machinegunpos>
<x>0.0</x>
<y>4.8</y>
<z>-1.3</z>
</machinegunpos>
</heliweps>
</specials>
[/spoiler]



3. RC Vehicles and Boats ALL vehicles are looping their animations!

So ? Well, try setting animation 0 of group 0, while being inside a vehicle. Your player will start walking without stopping :P

https://www.youtube.com/watch?v=1mFEJ3OAjms

Maybe developers can follow this method of looping animations, for some proper function ?!



4. SA vehicles imported to VC:MP won't lose their wheels :c (like this)

If your custom vehicle follows SA's .dff example, then you won't be able to remove the wheel. 
with vehicle.SetTyre( tyre, status ) e.g. vehicle.SetTyre( 0, 2 )
SA's .dff way ?? Yeah. SA engine needs just one wheel for a vehicle, in the .dff.
Then, in game, it just duplicates it to all the needed spots.

SanAndreas vs ViceCity



5. Custom vehicles return no handling data (when GetHandlingRule or vehicle.GetHandlingData)

Unfortunately, server is not taking the info out of our .7z archives;
here is a work-around: https://forum.vc-mp.org/?topic=8378

Note: Don't play with handling rule 8, because no matter value you will set, vehicle will go directly to Vector(0,0,0) when touching the water/sea.



6. EXTRA FLAGS can go in mix with other features!

YES! A day ago I've found out that a vehicle with Hunter properties can also get the TANK's rocket in the same time !
And you can also go for hermes' flames too, mixed with firetruk's water splashing, and anything else you want!

My luck ? The vehicle I was testing, was having this in the XML
Seems like, without this, the extra flags won't be activated.
<comprules>12272</comprules>
EXTRA FLAGS:
- 00000001h - SIREN
- 00000002h - HYDRAULICS
- 00000004h - BARON
- 00000008h - BFROTATION
- 00000010h - EXHAUST
- 00000020h - ENGINEFLAP
- 00000040h - TANK
- 00000080h - FIRETRUCK
- 00000100h - AI_POLICE
- 00000200h - AI_SWAT
- 00000400h - AI_PREDATOR
- 00000800h - AI_TANK
- 00001000h - AI_BARRACKS
- 00002000h - AI_FBI
- 00004000h - AI_VICE
- 00008000h - AI_FIRETRUCK
- 00010000h - AI_AMBULANCE
- 00020000h - AI_TAXI
- 00040000h - RCAUDIO
- 00080000h - REVBEEP
- 00100000h - GEARTHUD
- 00200000h - NOMAXALTITUDE

[spoiler=Hunter weps + tank explosion]

[/spoiler]

[spoiler=Jetpack with real flames]

[/spoiler]



7. We can add more working blades than we are used to

Thanks the trick number 6 we can add even the "skimmer" blade and make it work, just by activating extra flag:
00000008h - BFROTATIONUnfortunately, VC's engine is forcing some of the blades to stick to the middle of the model

https://www.youtube.com/watch?v=mBEHYpLUVu8&t=9s



Notes:
  • you cannot mix lights styles (e.g.: taxi light with some emergency lights)
  • light style + heli weapons is posible
  • you can use special lights on helicopters too - don't know about the others, but it must work also. (boat tested, but no lights shown up)
  • even if you trick the flags, like I did with the Flying Delly, you cannot make weapons work when vehicle is a car.
    It must be helicopter.

[spoiler=Gallery]
https://i.imgur.com/c7JhcDf.png - helicannon + lights
[/spoiler]



PS:
<author></author> setting acutally does something,
so when using downloaded vehicles in your server, don't forget to add the setting and the name.

MEGAMIND

Always impressed from this guy...

Sebastian

#2
Discovery number 3, posted.

Sebastian


Sebastian

just reminded 5.this here too, because is the right place too.

Sebastian

Trick 5 was updated. Apparently, all vehicles are looping their animations, not just RCs or Boats.

Tricks 6 and 7 added! Check it out!

MEGAMIND