» «

# [TUT]Component Rules

7 replies to this topic
DK22Pac
• ##### DK22Pac

• Feroci
• Joined: 12 Apr 2009
• Best Conversion 2017 Contribution [Liberty City Stories: PC]
Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
Contribution Award [Mods]

### #1 Posted 06 November 2012 - 06:58 PM Edited by DK22Pac, 12 March 2017 - 11:28 AM.

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 ranges
1 - must be created                             0 - num of variations in slot
2 - must be created, but at rainy weather only  0 - num of variations in slot
3 - random creation (could be created or not)   0 - num of variations in slot
4 - 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 slot
1f34 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)
• -Anti-, Silent, Dosceve and 4 others like this

Silent
• ##### Silent

Chief Vision™ Alterer

• GTA Mods Staff
• Joined: 01 Feb 2010
• Best Conversion 2017 Contribution [Liberty City Stories: PC]
Contribution Award [Mods]
Best Script/Plugin 2014 [SilentPatch]
Most Respected 2014
Most Talented [Modding] 2013
Best Map 2013 [ViceCityStories PC Edition]
Best Vehicle 2013 [III Aircraft]
Modder of the Year 2012

### #2 Posted 06 November 2012 - 07:20 PM

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

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

DK22Pac
• ##### DK22Pac

• Feroci
• Joined: 12 Apr 2009
• Best Conversion 2017 Contribution [Liberty City Stories: PC]
Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
Contribution Award [Mods]

### #3 Posted 06 November 2012 - 07:29 PM Edited by DK22Pac, 12 March 2017 - 11:30 AM.

Type '4' gets random id (0-5) so it ignores these ('fff') parameteres.
```Type        Values to choose
1           var1 var2 var3
2           var1 var2 var3
3           -1 var1 var2 var3
4           0 1 2 3 4```

Silent
• ##### Silent

Chief Vision™ Alterer

• GTA Mods Staff
• Joined: 01 Feb 2010
• Best Conversion 2017 Contribution [Liberty City Stories: PC]
Contribution Award [Mods]
Best Script/Plugin 2014 [SilentPatch]
Most Respected 2014
Most Talented [Modding] 2013
Best Map 2013 [ViceCityStories PC Edition]
Best Vehicle 2013 [III Aircraft]
Modder of the Year 2012

### #4 Posted 06 November 2012 - 07:33 PM

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?

DK22Pac
• ##### DK22Pac

• Feroci
• Joined: 12 Apr 2009
• Best Conversion 2017 Contribution [Liberty City Stories: PC]
Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
Contribution Award [Mods]

### #5 Posted 06 November 2012 - 07:58 PM

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

-Anti-
• ##### -Anti-

Trick

• Members
• Joined: 23 Jan 2008

### #6 Posted 19 February 2017 - 12:06 AM Edited by -Anti-, 19 February 2017 - 12:08 AM.

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*

DK22Pac
• ##### DK22Pac

• Feroci
• Joined: 12 Apr 2009
• Best Conversion 2017 Contribution [Liberty City Stories: PC]
Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
Contribution Award [Mods]

### #7 Posted 12 March 2017 - 11:12 AM

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

Yes. Probably a R*s mistake

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/D...ModelInfo.h#L88

That seems to be wrong.

Yes. First post was updated.
• -Anti- likes this

DK22Pac
• ##### DK22Pac

• Feroci
• Joined: 12 Apr 2009
• Best Conversion 2017 Contribution [Liberty City Stories: PC]
Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
Contribution Award [Mods]

### #8 Posted 09 April 2017 - 08:28 PM

Oh, another one...
• -Anti- likes this

#### 2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users