Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTAForums Annual Awards 2018

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

DK22Pac

[TUT]Component Rules

Recommended Posts

DK22Pac

Let me explain what is 'comprules' parameter and how to use it.

What is it

This parameter determines how vehicle extras will spawn.

How to use

General presentation:

 

<     extra      slot     2     ><     extra      slot     1     ><type><var3 id><var2 id><var1 id><type><var3 id><var2 id><var1 id>
Let's see few examples from original vehicles.ide

 

SECURICA    3f10
We have only 4 digits here. This means this vehicle uses only one slot for extra.

Vehicle can use 2 slots too. Then, the number will have 8 digits.

The first digit is spawning type for this slot.

 

type                                            variation id ranges1 - must be created                             0 - num of variations in slot2 - must be created, but at rainy weather only  0 - num of variations in slot3 - random creation (could be created or not)   0 - num of variations in slot4 - must be created with any component          0 - 4
Next three digits are variation ids (extra component ids), in this order:

 

var3 var2 var1
What is variation id? It is an id of vehicle extra component (extra1, extra2,...).

Basically, extra1 will have id '0', extra2 - '1', and so on...

The only exception is when some extra is missed:

 

chassis|+--extra1 # this one will have id 0+--extra3 # no 'extra2' in hierarchy, this one will have id 1
If there only 1 or 2 variations in a slot, other ids are set to value 'f' (-1 in decimal).

So. Line

 

SECURICA    3f10
Means: We have 1 slot for spawning extra. This extra spawns randomly (type 3) and it uses extras with ids 0 and 1 (means it will select some of them). It doesn't use 3rd variation, since var3 is set to 'f'.

 

TRAM        1012
This means extra will always spawn and will use 0|1|2 extra components.

 

SPEEDER     4fff
Type 4 means game will select random variation id in ranges 0 - 4.

If vehicle has a component with this id, it will spawn it, otherwise it will ignore spawning.

For example, you'll create 4 extras and will use '4fff' parameter.

 

chassis|+--extra1 # id 0+--extra2 # id 1+--extra3 # id 2+--extra4 # id 3
Game could spawn all of them for 1st slot. But if randomizer will select number '4', spawning will be ignored.

 

NRG500      1f341210
Nrg bike uses 2 slots to spawn extras:

 

1210 first slot1f34 second slot
I think you already can describe it.

Extra from first slot will be always spawned, with components 0|1| 2.

Extra from second slot will be always spawned, with components 3|4

Now let's try to experiment.

 

SECURICA    3f10
Change it to

 

SECURICA    1ff11ff0
And you'll see securica will spawn with 2 extras at same position (always) smile.gif Edited by DK22Pac

Share this post


Link to post
Share on other sites
Silent

Nice, you can suspect that Comet was supposed to have roof then tounge.gif

 

That looks like a decent work, but I'm a bit confused with 1 and 4 types - is 4 used only with fff IDs?

Share this post


Link to post
Share on other sites
DK22Pac

Type '4' gets random id (0-5) so it ignores these ('fff') parameteres.

 

Type        Values to choose1           var1 var2 var32           var1 var2 var33           -1 var1 var2 var34           0 1 2 3 4
Edited by DK22Pac

Share this post


Link to post
Share on other sites
Silent

What if comprules are 0 at all (eg. Monster Truck)? It looks like "do whatever you want, you can spawn them or not". Not sure if 2/3 extras can be spawned at the same time then though?

Share this post


Link to post
Share on other sites
DK22Pac

Yes, in this case it will randomly spawn available extra.

Share this post


Link to post
Share on other sites
-Anti-

Thanks for this explanation. It helped me a lot. Though I found a few things that do not seem to be true or need more explanation imo.

I tried this with VC but I guess it should be the same for the other III era games.

 

1st: No more than 6 extras are possible.

2 - must be created, but at rainy weather only

If there is no rain either no extra or one of the (up to) six extras will be created. Excluding the extras that are already bound to another slot. (eg. if the other slot is 1f10 extra1 and extra2 cant be created randomly at the "2/rain slot" when there is no rain)

4 - must be created with any component          0 - 5

4fff only uses extra 1-5. extra6 cant be created. Also there will always be an extra created. No extra is impossible.

 

 

 

A component which is highest in hierarchy will have id '0'. Next component will have 1,... No matter, which number after "extra" word it has.

 

That seems to be wrong. When I tried the hirachy within the dff and the order of the three digits (for var3 var2 var1) have no relevance. Only the number behind "extra" is important.

(But var3 var2 var1 have to be used in ascending order otherwise the game will crash. So eg 12f3 or 13f2 is not allowed. It has to be 1f23 or 1f32.)

 

 

Also:

If you use 1, 2 (during rain) or 3 and leave the second slot empty, one of the unused extras will (or will not) be created randomly in addition to the extra in slot 1.

 

 

 

//:Not important: If you do something like this: 1f103f10 extra 1 and 2 can be created at the same time (meaning there is no hirachy) but I cant think of any possible use for this.

 

 

 

Question: The number of slots is probably hardcoded, right? Any chance to allow more slots to be used? *Looking towards the Limit Adjusters*

Edited by -Anti-

Share this post


Link to post
Share on other sites
DK22Pac

4fff only uses extra 1-5. extra6 cant be created. Also there will always be an extra created.

Yes. Probably a R*s mistake :)

IHEIXBL.png

 

 

Question: The number of slots is probably hardcoded, right? Any chance to allow more slots to be used?

We have only 6 slots for extras.

https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CVehicleModelInfo.h#L88

 

 

That seems to be wrong.

Yes. First post was updated.

Share this post


Link to post
Share on other sites
DK22Pac

Oh, another one...

6ifUfxo.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 1 User Currently Viewing
    0 Members, 0 Anonymous, 1 Guest

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.