Jump to content

[TUT]Component Rules


Recommended Posts

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
Link to comment
https://gtaforums.com/topic/530575-tutcomponent-rules/
Share on other sites

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?

Link to comment
https://gtaforums.com/topic/530575-tutcomponent-rules/#findComment-1061859740
Share on other sites

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
Link to comment
https://gtaforums.com/topic/530575-tutcomponent-rules/#findComment-1061859788
Share on other sites

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?

Link to comment
https://gtaforums.com/topic/530575-tutcomponent-rules/#findComment-1061859813
Share on other sites

  • 4 years later...

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-
Link to comment
https://gtaforums.com/topic/530575-tutcomponent-rules/#findComment-1069412897
Share on other sites

  • 3 weeks later...

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.
Link to comment
https://gtaforums.com/topic/530575-tutcomponent-rules/#findComment-1069451782
Share on other sites

  • 4 weeks later...

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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