-
Notifications
You must be signed in to change notification settings - Fork 4
[EN] Recursive Extras
Before proceeding, be sure to read the Introduction.
The current variation part system of GTA SA is very limited. This function aims to eliminate these limits.
It works on a whole new system (without replacing the current game extras system), providing many advantages.
- Unlimited amount of extra parts (originally is only 6);
- Recursive system: When an extra is selected, it will select a child, and so on, creating a "grouping" where an extra will only appear if the other appears;
- You can define how many extras from each grouping will be selected;
- Soon: Possibility to add extras anywhere in the vehicle, such as doors and bumpers (originally only in the "chassis") with functional damage;
- Possibility to add extras also on trains (originally is possible in all vehicles types except trains);
- Can be used in conjunction with the Characteristics para criar variar características de um veículo.
- If the player who download your vehicle mod doesn't have VehFuncs installed, all extras will be visible by default.
The basic syntax is as follows:
The above image is self-explanatory and already teaches you the basics of how it works.
Note that the name "extra" is just an example, it can be anything else.
Before proceeding I want to make it clear that the system is very flexible and convenient, you do not need to use too much memory, even, the names of the functions can be written in any order and as you please. In fact, each node doesn't even need a name, nor some visible model inside it.
f_extras
is a "trigger", that is, a node that represents the starting point; it will always be visible, however, there doesn't have to be any model inside it, it can simply be a dummy (an empty node).
All childs of f_extras
will be considered "extras". Note that they can have absolutely any name, don't need to be called "extras" as in the image above.
Read this as "select X childs", for example :2
will select 2 childs; :1
will select 1 child (what is the default); :0
may select 1, or none.
As said, if you use :
by default will select 1 child, but if the parent has only 1 child? So will have 50% of chances to the child be selected. To force that the single child always be selected (100% of chance), use the suffix :1
on parent.
As said, you can use :0
to create a chance to select no child. For example, there's 3 childs and you want to select one of them, but you also want a chance to select none of them, just use :0
on parent.
But probably what you will most use is the :0+
or :1+
. To understand, the +
at the end is literally "randomize up to maximum quantity", so, if you use :0+
, it will select no one, or one, or some, or all childs! As so :1+
will select at least one, or some, or all. In short, the number after :
mean "select at least this" and the +
mean "...randomly up to the maximum possible".
It is possible to use the Characteristics along with extras, thus enabling the vehicle to have certain features based on which extras were selected.
In the above example,
- The mod will select randomly the extras
gas
orcargo
; - If select
gas
, will also apply a custom ID driver (190) configured atdrv=190
("drv" from "driver") and the paintjob 1 configured atpj=1
(from "paintjob"), which would be a gas truck painting; - And what is that
:2
? How many child extras will be selected; - In this case, the childs of
gas
extra iscylinders
andinterior
, will select both; -
cylinders
have 2 extras which contains variations of cylinders, will be selected and 1 of them will appear; -
Interior
has 3 extras and is set to select 2 extras (:2
), so you will select 2 of 3:magazines
and/orbottles
and/orcrowbar
. If selectbottles
, there is also a chance to selectcup
; - And if
gas
was not selected? Will be selectedcargo
; - Selecting
carga
, the script will apply a custom driver of ID 160 or 161; - And we have 2 extras:
furniture
andrubble
, where ifrubble
is selected, will apply between 7 and 9 dirt level ("drt" from "dirty") (the setting goes from 0 to 9).
If you find it confusing, that's fine, at the bottom of the page there's an easier example, but it's also important that you understand the basics of this.
Read more about Characteristics.
Right, we learned to put extras somewhere in the car, but how to communicate between different parts of the car?
After all, for example, we want a decal to appear on the doors if a ladder appears on the roof (chassis
).
In the example above we have f_class
that will select unocompany
ou unoold
. If unocompany
is selected, the category will be defined [unocompany]
.
When you process door extras, you can apply the companydecal[unocompany]
. Note that in the example there is a 50% chance that the decal will be applied or not. If you want to force the decal to always appear if the [unocompany]
has been selected, in f_extras_ok
and f_extras_dam
, let f_extras:1_ok
and f_extras:1_dam
, so will always select, as explained above.
You can also place characteristics in the class name, so the characteristics will be applied soon if this class is chosen.
Note: Only one category per node is supported.
And what happens if we brothers from the same class?
If there are 2 nodes brothers marked with the same category, the operation of choosing the extras will be exactly the same between them. However, if you have set the suffix":" as a number greater than the total of brothers, will first be selected among the brothers from the same class, and then select the nodes that are left over that there's no category (very convenient, no?).
See a last example similar to what we saw before. Inside ZModeler:
Uses the extras system. In the cart is a great example of :1+
.
Download
(WIP)