The file is still named infected.lua due to the scripts’ initial name. However the correct name would be entities.lua.
StateBags
Entities spawned by mega_entities will have some StateBag values associated to detect which kind of entity type they are and which chunk / zone they belong to depending on the spawn strategy that spawned them. So far the values that you can find inside an entity spawned by mega entities are those:Configuration parameters
- displayName: Display name shown in the PROMPT LOCK ON action (holding right mouse button).
- model: Entity ped model
- group: Group tag for the entity check (groups page)[./scripts/entities/configuration/groups] for more info
Example entity
Let’s say we wanted to create a new entity. This entity is a militia man, it will attack infects and attack only hostile players. Let’s edit the entity types config together:Entity config parameters
Let’s talk about each of these parameters:displayName
Type: stringDisplay name for the entity, it will be shown in prompts, etc.
model
Type: hashModel hash, a list can be found here.
group
Type: hashGroup hash, refer to the groups guide for more info.
scale
Type: numberPed scale for size.
outfits
Type: tableIf set to
nil
, it will choose a random ped outfit across all the vanilla ones. Otherwise, you can pass a list with the outfit “numbers” you want to allow.
maxHealth
Type: numberMax health that the entity will have.
walkStyle
Type: stringThe entity walk style. If set to
nil
, the default one will be preserved. You can find a list here.
accuracy
Type: numberPed’s shooting accuracy from 0-100.
seeingRange
Type: numberPed’s sight detection range.
hearingRange
Type: numberPed’s hearing detection range.
combatAbility
Type: numberPed’s combat ability from 0 to 2.
combatMovement
Type: numberPed’s combat movement type from 0 to 3.
- 0 -> Stationary (Will just stand in place)
- 1 -> Defensive (Will try to find cover and very likely to blind fire)
- 2 -> Offensive (Will attempt to charge at enemy but take cover as well)
- 3 -> Suicidal Offensive (Will try to flank enemy in a suicidal attack)
combatAttributes
Type: table Ped’s combat attributes, in the key part [xxx] there will be the combat attribute we want to enable or disable (true/false). You can find a list (here)[https://github.com/femga/rdr3_discoveries/tree/master/AI/COMBAT_ATTRIBUTES]equipment
Type: table Ped’s equipment, these are the weapons the ped will be carrying, and the ammo that they have. Example:['weapon'] = ammoQuantity