@adatechnology/game-vehicles 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/MIGRATION.md +397 -0
- package/README.md +267 -2
- package/dist/index.d.ts +824 -0
- package/dist/index.global.js +12015 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +11992 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anderson Fernandes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/MIGRATION.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
# Migration from the Portuguese `VehicleSDK`
|
|
2
|
+
|
|
3
|
+
`@adatechnology/game-vehicles` is the port of the Portuguese `VehicleSDK` (`veiculos-sdk.js` + `veiculos-ui.js`, global `window.VehicleSDK`). The
|
|
4
|
+
geometry and every damage formula are unchanged: for the same vehicle, state and zone health the vertices are identical to the original (the test
|
|
5
|
+
suite compares them against digests produced by the original). What changed is naming, packaging and where the texts live.
|
|
6
|
+
|
|
7
|
+
- All names, options and ids are English. Portuguese lives only in `src/locales/pt-BR.json`.
|
|
8
|
+
- The singleton became a factory: `window.VehicleSDK` is now `GameVehicles.createVehicleKit({ THREE, locale })`.
|
|
9
|
+
- Everything that is content (fleet, fuels, scenarios, texts) comes from your plugin, as before.
|
|
10
|
+
- Seeds are unchanged: renamed ids keep their old text for random seeding, see [Seeds](#seeds-and-determinism).
|
|
11
|
+
|
|
12
|
+
Contents: [Setup](#setup) - [Kit](#kit) - [Configure and plugins](#configure-and-plugins) - [Spec and build context](#spec-and-build-context) -
|
|
13
|
+
[Meta](#meta) - [Zones](#zones) - [Scenarios](#scenarios) - [Values](#values) - [Zone ids](#zone-ids) - [Part labels](#part-labels) -
|
|
14
|
+
[UI](#ui) - [Seeds](#seeds-and-determinism) - [Removed](#removed)
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
| Old | New |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `<script src="veiculos-sdk.js">` then `window.VehicleSDK` | `import { createVehicleKit } from '@adatechnology/game-vehicles'`, or the IIFE global `GameVehicles.createVehicleKit` |
|
|
21
|
+
| `THREE` read from the page | `createVehicleKit({ THREE })` (required); `three` is a type-only peer dependency |
|
|
22
|
+
| `<script src="veiculos-ui.js">` (adds `SDK.ui`) | Included: `kit.ui` |
|
|
23
|
+
| Texts always Portuguese | `createVehicleKit({ locale: 'pt-BR' })` (default `'en'`) |
|
|
24
|
+
| `SDK.version` | Removed |
|
|
25
|
+
| `SDK.plugin(p)` after load | `createVehicleKit({ plugins: [p] })` or `kit.plugin(p)` |
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
// before
|
|
29
|
+
const SDK = window.VehicleSDK
|
|
30
|
+
SDK.plugin(myPlugin)
|
|
31
|
+
const c = SDK.build('proto', 'intacto')
|
|
32
|
+
|
|
33
|
+
// after
|
|
34
|
+
const kit = GameVehicles.createVehicleKit({ THREE, locale: 'pt-BR', plugins: [myPlugin] })
|
|
35
|
+
const c = kit.build('proto', 'intact')
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Kit
|
|
39
|
+
|
|
40
|
+
Top-level members of `VehicleSDK` (`SDK.x`) and of the kit (`kit.x`). Members not listed kept their name.
|
|
41
|
+
|
|
42
|
+
| Old | New |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `FUELS` | `fuels` |
|
|
45
|
+
| `GROUPS` | `groups` |
|
|
46
|
+
| `WATER_GROUPS` | `waterGroups` |
|
|
47
|
+
| `FLEET` | `fleet` |
|
|
48
|
+
| `BUILD` | `builders` |
|
|
49
|
+
| `FX` | `partEffects` |
|
|
50
|
+
| `ZONE_FX` | `zoneEffects` |
|
|
51
|
+
| `SCENARIOS` | `scenarios` |
|
|
52
|
+
| `BANDS` | `bands` |
|
|
53
|
+
| `DMG_MAT` | `damageMaterials` |
|
|
54
|
+
| `STEELM` | `steelMaterial` |
|
|
55
|
+
| `MT` | `materials` |
|
|
56
|
+
| `CM` | `makeMaterial` |
|
|
57
|
+
| `FM` | `makeFlatMaterial` |
|
|
58
|
+
| `paintCol` | `paintColor` |
|
|
59
|
+
| `textTex` | `textTexture` |
|
|
60
|
+
| `studioEnv` | `studioEnvironment` |
|
|
61
|
+
| `mkWarp` | `makeWarp` |
|
|
62
|
+
| `jerry` | `jerryCan` |
|
|
63
|
+
| `gBox` | `localBox` |
|
|
64
|
+
| `zoneBox` | `normalizeBox` |
|
|
65
|
+
| `Ctx` | `BuildContext` |
|
|
66
|
+
| `flagFx` | `flagEffects` |
|
|
67
|
+
| `geo.rbox` | `geo.roundedBox` |
|
|
68
|
+
| `geo.sloft` | `geo.smoothLoft` |
|
|
69
|
+
| `internals.gInvOf` | `internals.worldInverseOf` |
|
|
70
|
+
| `version` | removed |
|
|
71
|
+
| `SDK.ui.*` | `kit.ui.*` (same function names) |
|
|
72
|
+
| (none) | `kit.t(key, vars)`, `kit.strings`, `kit.matchers`, `kit.resolveLabel`, `kit.document` |
|
|
73
|
+
|
|
74
|
+
Unchanged: `register`, `find`, `build`, `dispose`, `configure`, `plugin`, `plugins`, `on`, `hook`, `defaultDamage`, `internals`, `config`,
|
|
75
|
+
`hash`, `geo`, `car`, `shell`, `addGlass`, `asGlass`, `autoWindows`, `sideWindows`, `headlight`, `taillight`, `lightBar`, `emblem`, `grille`, `seat`,
|
|
76
|
+
`steeringWheel`, `yoke`, `dashboard`, `interior`, `busRows`, `makeHood`, `hinge`, `engineBay`, `underbody`, `carDetails`, `archFlare`, `truckCab`,
|
|
77
|
+
`truckChassis`, `spokedWheel`, `tracks`, `spawn`, `burst`, `addEmitter`, `exhaustLook`, `fluidTypes`, `defineFluid`, `splat`, `puddle`,
|
|
78
|
+
`updateFluids`, `wipe`, `hitGlass`, `breakLight`, `hurtEngine`, `igniteFuel`, `applyPart`, `impact`, `probe`, `zoneImpact`, `roll`, `rollContact`,
|
|
79
|
+
`explode`, `blastDamage`, `tick`, `settle`, `setHood`, `applyArmor`, `bandOf`, `zoneEffect`, `zonesOf`, `zoneOwner`, `applyZones`, `scenario`,
|
|
80
|
+
`zoneScenario`, `zoneOverall`, `zoneAt`, `zoneDamageAt`, `zonePoint`, `halfAt`, `profX`, `surfaceAt`, `surfaceX`, `cutMesh`, `quadDef`, `glassQuad`,
|
|
81
|
+
`halo`, `holeTop`, `holeSide`, `holeQuad`, `holeBox`, `holeWhere`.
|
|
82
|
+
|
|
83
|
+
## Configure and plugins
|
|
84
|
+
|
|
85
|
+
| Old | New |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `configure({ zoneFx })` | `configure({ zoneEffects })` |
|
|
88
|
+
| `configure({ partFx })` | `configure({ partEffects })` |
|
|
89
|
+
| `configure({ flags })` | `configure({ flagEffects })` |
|
|
90
|
+
| `bands: [{ n, col, min, h }]` | `bands: [{ name, color, min, health }]` |
|
|
91
|
+
| `texts: { who, noEffect, plate, ui }` | same keys; `ui` keys are `front`, `inside`, `aria`, `noZones`, `health` |
|
|
92
|
+
| `{quem}` in effect texts | `{who}` |
|
|
93
|
+
| fluid type `mancha` (default stain) | `stain` |
|
|
94
|
+
| `plugin({ name, configure, install(SDK) })` | `plugin({ name, configure, install(kit) })` |
|
|
95
|
+
| flag effect `apply(c, flags, SDK)` | `apply(c, flags, kit)` |
|
|
96
|
+
|
|
97
|
+
Unchanged: `scenarios`, `fluids`, `fuels`, `groups`, `waterGroups`, `palette.rust`, `impactStain`, `defaultSplat`, `defaultGroup`, `damagedScenario`.
|
|
98
|
+
The hook event `defaultDamage` keeps its name. Effect-text keys are the English zone types and `fxKey`s (see [Values](#values)).
|
|
99
|
+
|
|
100
|
+
## Spec and build context
|
|
101
|
+
|
|
102
|
+
Vehicle spec given to `register`:
|
|
103
|
+
|
|
104
|
+
| Old | New |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `k` | `key` |
|
|
107
|
+
| `grp` | `group` |
|
|
108
|
+
| `n` | `name` |
|
|
109
|
+
| other fields (`fuel`, `hood`, `mass`, `seats`, ...) | passed through unchanged |
|
|
110
|
+
|
|
111
|
+
Build function: `(c, kit)` as before. Members of the build context `c`:
|
|
112
|
+
|
|
113
|
+
| Old | New |
|
|
114
|
+
|---|---|
|
|
115
|
+
| `c.g` | `c.vehicle` |
|
|
116
|
+
| `c.fx` | `c.effects` |
|
|
117
|
+
| `c.st` | `c.state` |
|
|
118
|
+
| `c.k` | `c.key` |
|
|
119
|
+
| `c.rb(...)` | `c.roundBox(...)` |
|
|
120
|
+
| `c.cyl(...)` | `c.cylinder(...)` |
|
|
121
|
+
| `c.sph(...)` | `c.sphere(...)` |
|
|
122
|
+
| `c.zs` | `c.zoneState` (`{ health, flags }`) |
|
|
123
|
+
| `c.zOwner` | `c.zoneOwners` |
|
|
124
|
+
| `c.zDrop` | `c.zoneDrops` |
|
|
125
|
+
| `c.zoneErr` | `c.zoneErrors` |
|
|
126
|
+
| `c.ps` | `c.particles` |
|
|
127
|
+
| `c.emit` | `c.emitters` |
|
|
128
|
+
| `c.rollA` | `c.rollState` |
|
|
129
|
+
| `c.boom` | `c.blast` |
|
|
130
|
+
| `c.tankDmg` | `c.tankDamage` |
|
|
131
|
+
| `c.toFx(p)` / `c.dirFx(v)` | `c.toEffects(p)` / `c.dirToEffects(v)` |
|
|
132
|
+
| `c.part(kind, label, obj, pos, reach)` | same signature; `label` may also be `{ key, label? }` (see [Part labels](#part-labels)) |
|
|
133
|
+
| part object `{ kind, n, obj, pos, reach }` | `{ kind, label, key, obj, pos, reach }` |
|
|
134
|
+
| log entry `n` | `label` |
|
|
135
|
+
| light object `{ g, inner, lens, kind, tint, broken }` | `{ group, inner, lens, kind: 'headlight' or 'taillight', tint, broken }` |
|
|
136
|
+
|
|
137
|
+
The car, truck and other builders keep their option names (`W`, `col`, `gh`, `hl`, `tl`, `lower`, `arches`, `f`, `L`, `axles`, `dual`, ...). Changed values:
|
|
138
|
+
|
|
139
|
+
| Old | New |
|
|
140
|
+
|---|---|
|
|
141
|
+
| `truckChassis` option `tank: 'direita'` / `'esquerda'` | `'right'` / `'left'` |
|
|
142
|
+
| zone option `hinge`: `'frente'` / `'tras'` / `'cima'` / `'baixo'` | `'front'` / `'rear'` / `'up'` / `'down'` |
|
|
143
|
+
| `wipe(c, 'limpador')` / `'chuva'` | `'wiper'` / `'rain'` |
|
|
144
|
+
| `puddle(c, 'oleo' / 'gasolina' / 'diesel', ...)` | `'oil'` / `'gasoline'` / `'diesel'` |
|
|
145
|
+
| `addGlass(..., 'laminado' / 'temperado')` | `'laminated'` / `'tempered'` |
|
|
146
|
+
| `zoneImpact(c, 'frente' / 'traseira' / 'esquerda' / 'direita' / 'capotado')` | `'front'` / `'rear'` / `'left'` / `'right'` / `'rolled'` |
|
|
147
|
+
| `zonePoint(c, 'frente' ...)` | same side words as `zoneImpact` |
|
|
148
|
+
| engine bay `motor: 'gasolina' / 'eletrico' / 'v8n'` | `'gasoline'` / `'electric'` / `'v8_na'` |
|
|
149
|
+
| `spec.fuel: 'gasolina' / 'qav' / 'eletrico' / 'nenhum'` | `'gasoline'` / `'jet_fuel'` / `'electric'` / `'none'` |
|
|
150
|
+
|
|
151
|
+
## Meta
|
|
152
|
+
|
|
153
|
+
| Old | New |
|
|
154
|
+
|---|---|
|
|
155
|
+
| `col` | `color` |
|
|
156
|
+
| `L` | `length` |
|
|
157
|
+
| `W` | `width` |
|
|
158
|
+
| `clear` | `clearance` |
|
|
159
|
+
| `bodyH` | `bodyHeight` |
|
|
160
|
+
| `fusW` | `fuselageWidth` |
|
|
161
|
+
| `fusTop` | `fuselageTop` |
|
|
162
|
+
| `cabL` | `cabLength` |
|
|
163
|
+
| `bigBoom` | `bigBlast` |
|
|
164
|
+
| `quadF` | `frontQuad` |
|
|
165
|
+
| `underG` | `underbodyGroup` |
|
|
166
|
+
| `bumperF` / `bumperR` | `frontBumper` / `rearBumper` |
|
|
167
|
+
| `gh` | `glasshouse` |
|
|
168
|
+
| `T` | `tumble` |
|
|
169
|
+
|
|
170
|
+
Unchanged: `kind`, `front`, `rear`, `belt`, `top`, `roof`, `bed`, `bay`, `cabin`, `exhaust`, `exhaustDir`, `arches`, `armor`, `damage`, `stiff`, `rack`,
|
|
171
|
+
`armored`, `bullet`. The old code sniffed the vehicle key with `/militar|worker/` to choose the body zone type; that is gone. Set `meta.bodyLabel`
|
|
172
|
+
(a label for the single body zone) or `meta.bodyKind: 'box' | 'body'`. Meta kinds are the same English words (`car`, `bike`, `quad`, `tractor`, `boat`,
|
|
173
|
+
`plane`, `heli`, `bus`, `truck`).
|
|
174
|
+
|
|
175
|
+
## Zones
|
|
176
|
+
|
|
177
|
+
| Old | New |
|
|
178
|
+
|---|---|
|
|
179
|
+
| zone `n` | `name` |
|
|
180
|
+
| zone `h` | `health` |
|
|
181
|
+
| zone `b` | `band` |
|
|
182
|
+
| zone `w` | `weight` |
|
|
183
|
+
| zone `own` | `owned` |
|
|
184
|
+
| zone `lagarta` | `track` |
|
|
185
|
+
| zone `type`: `porta` `painel` `teto` `tampa` `capo` `parachoque` `vidro` `luz` `roda` `interno` `peca` | `door` `panel` `roof` `lid` `hood` `bumper` `glass` `light` `wheel` `internal` `part` |
|
|
186
|
+
| zone `tags`: `parabrisa` `frente` `traseira` `esquerda` `direita` | `windshield` `front` `rear` `left` `right` |
|
|
187
|
+
| zone tag/fxKey names | English (`windshield`, `glass`, `landing_gear`, `skid`, `axle`, `engine`, `handlebar`, ...) |
|
|
188
|
+
| `ZONE_WEIGHTS` keys | the English zone types above |
|
|
189
|
+
| `zs = { h, flags }` (input of `build` / `applyZones`) | `{ health, flags }` |
|
|
190
|
+
| `c.zs.h` | `c.zoneState.health` |
|
|
191
|
+
| `zoneOverall(c)` returns `{ h, b, n }` | `{ health, band, name }` |
|
|
192
|
+
| `zoneDamageAt(...)` returns `{ main, list: [{ id, n, dmg }] }` | `{ main, list: [{ id, name, damage }] }` |
|
|
193
|
+
| `c.zone(id, label, box, parts, opts)` | unchanged signature; use English ids and `opts.seedId` to keep an old seed |
|
|
194
|
+
|
|
195
|
+
Band ids and fields:
|
|
196
|
+
|
|
197
|
+
| Old | New |
|
|
198
|
+
|---|---|
|
|
199
|
+
| ids `intacto` `arranhado` `amassado` `destruido` `arrancado` | `intact` `scratched` `dented` `destroyed` `torn_off` |
|
|
200
|
+
| band fields `n`, `col`, `h`, `min` | `name`, `color`, `health`, `min` |
|
|
201
|
+
| band names (`Intacto`, `Arranhado`, `Amassado`, `Destruído`, `Arrancado`) | `locales/pt-BR.json` (`bands.*`), English in `en.json` |
|
|
202
|
+
|
|
203
|
+
Build states: `'intacto'` / `'danificado'` / `'modificado'` are now `'intact'` / `'damaged'` / `'modified'`.
|
|
204
|
+
|
|
205
|
+
## Scenarios
|
|
206
|
+
|
|
207
|
+
Definition `{ id, n, init?, zone }` becomes `{ id, name, init?, zone }`. `zone(z, X)` and `init(X)` receive:
|
|
208
|
+
|
|
209
|
+
| Old (`X.`) | New |
|
|
210
|
+
|---|---|
|
|
211
|
+
| `F` | `front` |
|
|
212
|
+
| `R` | `rear` |
|
|
213
|
+
| `L` | `length` |
|
|
214
|
+
| `W` | `width` |
|
|
215
|
+
| `cl` | `clearance` |
|
|
216
|
+
| `cen` | `center` |
|
|
217
|
+
| `isPB` | `isWindshield` |
|
|
218
|
+
| `BODY_TYPES` | `bodyTypes` (keys are the English zone types) |
|
|
219
|
+
| `r()` | `rand()` |
|
|
220
|
+
| `h` | `health` |
|
|
221
|
+
| `set`, `flags`, `c`, `meta`, `top`, `clamp` | unchanged |
|
|
222
|
+
|
|
223
|
+
`zoneScenario(c, id)` returns `{ health, flags, scenario }` (was `{ h, flags, sc }`) and the result can be passed straight to `build` or
|
|
224
|
+
`applyZones`. A scenario is found by `id` or by `name`. Built-in flags `flipped`, `burnt` and `abandoned` are unchanged.
|
|
225
|
+
|
|
226
|
+
## Values
|
|
227
|
+
|
|
228
|
+
Particle types (`spawn`, `burst`):
|
|
229
|
+
|
|
230
|
+
| Old | New |
|
|
231
|
+
|---|---|
|
|
232
|
+
| `faisca` `caco` `cubo` `lente` `lata` `plastico` `poeira` `fumaca` `fogo` `agua` `gota` | `spark` `shard` `cube` `lens` `scrap` `plastic` `dust` `smoke` `fire` `water` `droplet` |
|
|
233
|
+
| variants `branca` `preta` `cinza` `vapor` | `white` `black` `gray` `steam` |
|
|
234
|
+
| emitter kinds `branca` `preta` `fogo` `escape` | `white` `black` `fire` `exhaust` |
|
|
235
|
+
|
|
236
|
+
Part kinds (`c.part(kind, ...)`, `parts[].kind`, `partEffects` keys):
|
|
237
|
+
|
|
238
|
+
| Old | New |
|
|
239
|
+
|---|---|
|
|
240
|
+
| `farol` `lanterna` `vidro` `roda` `parachoque` `radiador` `motor` `capo` `tanque` `bateria` `casco` `popa` `helice` `rotor` `rotorcauda` `trem` `lagarta` | `headlight` `taillight` `glass` `wheel` `bumper` `radiator` `engine` `hood` `fuel_tank` `battery` `hull` `stern` `propeller` `rotor` `tail_rotor` `landing_gear` `track` |
|
|
241
|
+
|
|
242
|
+
## Zone ids
|
|
243
|
+
|
|
244
|
+
Zones derived by the engine have English ids. The old id is still what seeds the damage (see below). Ids that are not listed did not change.
|
|
245
|
+
|
|
246
|
+
| Old id | New id |
|
|
247
|
+
|---|---|
|
|
248
|
+
| `parachoque_d` | `bumper_front` |
|
|
249
|
+
| `parachoque_t` | `bumper_rear` |
|
|
250
|
+
| `paralama_de` | `fender_front_left` |
|
|
251
|
+
| `paralama_dd` | `fender_front_right` |
|
|
252
|
+
| `porta_de` | `door_front_left` |
|
|
253
|
+
| `porta_dd` | `door_front_right` |
|
|
254
|
+
| `porta_te` | `door_rear_left` |
|
|
255
|
+
| `porta_td` | `door_rear_right` |
|
|
256
|
+
| `lateral_te` | `side_rear_left` |
|
|
257
|
+
| `lateral_td` | `side_rear_right` |
|
|
258
|
+
| `capo` | `hood` |
|
|
259
|
+
| `teto` | `roof` |
|
|
260
|
+
| `tampa` | `lid` |
|
|
261
|
+
| `assoalho` | `underbody` |
|
|
262
|
+
| `cacamba` | `cargo_bed` |
|
|
263
|
+
| `motor` | `engine` |
|
|
264
|
+
| `radiador` | `radiator` |
|
|
265
|
+
| `tanque` | `fuel_tank` |
|
|
266
|
+
| `bateria` | `battery` |
|
|
267
|
+
| `carenagem` | `fairing` |
|
|
268
|
+
| `guidao` | `handlebar` |
|
|
269
|
+
| `banco` | `seat` |
|
|
270
|
+
| `quadro` | `frame` |
|
|
271
|
+
| `escapamento` | `exhaust` |
|
|
272
|
+
| `frente` | `front` |
|
|
273
|
+
| `traseira` | `rear` |
|
|
274
|
+
| `topo` | `top` |
|
|
275
|
+
| `capo_trator` | `tractor_hood` |
|
|
276
|
+
| `paralama_te` | `fender_rear_left` |
|
|
277
|
+
| `paralama_td` | `fender_rear_right` |
|
|
278
|
+
| `posto` | `operator_station` |
|
|
279
|
+
| `cab_frente` | `cab_front` |
|
|
280
|
+
| `cab_e` | `cab_left` |
|
|
281
|
+
| `cab_d` | `cab_right` |
|
|
282
|
+
| `corpo_e` | `body_left` |
|
|
283
|
+
| `corpo_d` | `body_right` |
|
|
284
|
+
| `corpo_t` | `body_rear` |
|
|
285
|
+
| `chassi` | `chassis` |
|
|
286
|
+
| `blind_frente` | `armor_front` |
|
|
287
|
+
| `blind_e` | `armor_left` |
|
|
288
|
+
| `blind_d` | `armor_right` |
|
|
289
|
+
| `blind_t` | `armor_rear` |
|
|
290
|
+
| `arma` | `weapon` |
|
|
291
|
+
| `torre` | `turret` |
|
|
292
|
+
| `lagarta_e` | `track_left` |
|
|
293
|
+
| `lagarta_d` | `track_right` |
|
|
294
|
+
| `rodas_e` | `wheels_left` |
|
|
295
|
+
| `rodas_d` | `wheels_right` |
|
|
296
|
+
| `proa` | `bow` |
|
|
297
|
+
| `costado_e` | `side_left` |
|
|
298
|
+
| `costado_d` | `side_right` |
|
|
299
|
+
| `popa` | `stern` |
|
|
300
|
+
| `conves` | `deck` |
|
|
301
|
+
| `nariz` | `nose` |
|
|
302
|
+
| `cabine` | `cab` |
|
|
303
|
+
| `asa_e` | `wing_left` |
|
|
304
|
+
| `asa_d` | `wing_right` |
|
|
305
|
+
| `fuselagem` | `fuselage` |
|
|
306
|
+
| `cauda` | `tail` |
|
|
307
|
+
| `trem` | `landing_gear` |
|
|
308
|
+
| `tanques` | `fuel_tanks` |
|
|
309
|
+
| `cone` | `tail_cone` |
|
|
310
|
+
| `rotor` | `rotor` |
|
|
311
|
+
| `rotor_cauda` | `tail_rotor` |
|
|
312
|
+
| `esquis` | `skids` |
|
|
313
|
+
| `vidros_f` / `vidros_e` / `vidros_d` / `vidros_t` (grouped glass) | `glass_front` / `glass_left` / `glass_right` / `glass_rear` |
|
|
314
|
+
| `vidro_<slug of label>`, `para_brisa`, `janela_*` (one zone per pane) | `windshield`, `rear_window`, `window_front`, `window_rear`, `quarter_glass`, `cab_window`, `window`, `glass` (the part `key`), with `_left` / `_right` for side panes; free text labels still use `glass_<slug>` |
|
|
315
|
+
| `farol_e` `farol_d` `farol_c` (+ `_2`, `_3` for more) | `headlight_left` `headlight_right` `headlight_center` (+ `_2`, ...) |
|
|
316
|
+
| `lanterna_e` `lanterna_d` `lanterna_c` | `taillight_left` `taillight_right` `taillight_center` |
|
|
317
|
+
| `roda_<dianteira\|traseira>[_<esquerda\|direita>]` | `wheel_<front\|rear>[_<left\|right>]` |
|
|
318
|
+
| `rodas_eixo1`, `rodas_eixo2`, ... | `wheels_axle_1`, `wheels_axle_2`, ... |
|
|
319
|
+
|
|
320
|
+
## Part labels
|
|
321
|
+
|
|
322
|
+
`c.part`, `addGlass` and the light builders accept a plain string (as before) or `{ key, label? }`. A key is looked up in the locale as `parts.<key>`
|
|
323
|
+
and also lets the engine recognise the part without matching text. Free text still works: the engine falls back to the regular expressions in the
|
|
324
|
+
locale `matchers` (windshield, rear, side, tank, diesel, fuel), which for `pt-BR` are the original Portuguese patterns. A part can carry `fuel:
|
|
325
|
+
'diesel' | 'gasoline'` instead of the old `/diesel/` and `/gasolina|etanol|álcool|combust/` label matching.
|
|
326
|
+
|
|
327
|
+
| Key | Portuguese (original label) | English |
|
|
328
|
+
|---|---|---|
|
|
329
|
+
| `tire_front` | Pneu dianteiro {sideM} | Front {side} tire |
|
|
330
|
+
| `tire_rear` | Pneu traseiro {sideM} | Rear {side} tire |
|
|
331
|
+
| `bike_tire_front` | Pneu dianteiro | Front tire |
|
|
332
|
+
| `bike_tire_rear` | Pneu traseiro | Rear tire |
|
|
333
|
+
| `headlight` | Farol {sideM} | {Side} headlight |
|
|
334
|
+
| `taillight` | Lanterna {side} | {Side} taillight |
|
|
335
|
+
| `led_bar` | Barra de LED | LED bar |
|
|
336
|
+
| `taillight_bar` | Barra de lanterna | Taillight bar |
|
|
337
|
+
| `hood` | Capô | Hood |
|
|
338
|
+
| `engine` | Motor | Engine |
|
|
339
|
+
| `engine_electric` | Motor elétrico e inversor | Electric motor and inverter |
|
|
340
|
+
| `radiator` | Radiador | Radiator |
|
|
341
|
+
| `bumper_front` | Para-choque dianteiro | Front bumper |
|
|
342
|
+
| `bumper_rear` | Para-choque traseiro | Rear bumper |
|
|
343
|
+
| `fuel_tank` | Tanque de combustível | Fuel tank |
|
|
344
|
+
| `diesel_tank` | Tanque de diesel | Diesel tank |
|
|
345
|
+
| `windshield` | Para-brisa | Windshield |
|
|
346
|
+
| `rear_window` | Vidro traseiro | Rear window |
|
|
347
|
+
| `window_front` | Janela dianteira | Front window |
|
|
348
|
+
| `window_rear` | Janela traseira | Rear window |
|
|
349
|
+
| `quarter_glass` | Vidro lateral traseiro | Rear quarter glass |
|
|
350
|
+
| `cab_window` | Janela da cabine | Cab window |
|
|
351
|
+
| `window` | Janela | Window |
|
|
352
|
+
| `glass` | Vidro | Glass |
|
|
353
|
+
| `glass_side` | {label} {side} | {label} ({side}) |
|
|
354
|
+
| `glass_side_m` | {label} {sideM} | {label} ({side}) |
|
|
355
|
+
| `track` | Lagarta {side} | {Side} track |
|
|
356
|
+
|
|
357
|
+
## UI
|
|
358
|
+
|
|
359
|
+
| Old | New |
|
|
360
|
+
|---|---|
|
|
361
|
+
| `SDK.ui.damageMap(host, c, { selected, onSelect })` | `kit.ui.damageMap(host, c, { selected, onSelect })` |
|
|
362
|
+
| `bandButtons`, `legend`, `healthBar`, `scenarioButtons`, `zoneLabel`, `bandRange`, `css`, `injectStyles` | same names under `kit.ui` |
|
|
363
|
+
| `healthBar` returns `{ h, b, n }` | `{ health, band, name }` |
|
|
364
|
+
| stylesheet id `vsdk-ui-css` | `vehicles-ui-css` |
|
|
365
|
+
| text keys `front`, `inside`, `aria`, `noZones`, `health` (`texts.ui`) | same keys; defaults from `ui.*` in the locale |
|
|
366
|
+
| SVG class names (`dmap`, `dm-body`, `zn`, `sel`, `gone`, ...) | unchanged |
|
|
367
|
+
|
|
368
|
+
## Seeds and determinism
|
|
369
|
+
|
|
370
|
+
Every random stream is seeded from the vehicle key plus a text. To keep the output identical after the rename, the seed text of renamed things is the
|
|
371
|
+
original one:
|
|
372
|
+
|
|
373
|
+
| Seed | Text |
|
|
374
|
+
|---|---|
|
|
375
|
+
| build state | `intact` -> `intacto`, `damaged` -> `danificado`, `modified` -> `modificado` |
|
|
376
|
+
| zone | the old zone id (`LEGACY_ZONE_IDS`, or an explicit `seedId` on the zone) |
|
|
377
|
+
| phases of `applyZones` | the salts of `SEED_SALTS`: `ferrugem` (rust), `cenario` (scenario flags), `assenta` (settling), `capota` (rollover) |
|
|
378
|
+
|
|
379
|
+
Exported for packs: `LEGACY_STATES`, `LEGACY_ZONE_IDS`, `SEED_SALTS`, `legacyZoneId(zone)`. A pack that registers its own zones with `c.zone(...)` can
|
|
380
|
+
pass `seedId` to keep the look of an earlier version; zones without it seed from their own id.
|
|
381
|
+
|
|
382
|
+
## Removed
|
|
383
|
+
|
|
384
|
+
- `SDK.version`.
|
|
385
|
+
- The global `window.VehicleSDK` singleton (use a kit; make one per game).
|
|
386
|
+
- The `/militar|worker/` key sniffing in the body zones (use `meta.bodyLabel` or `meta.bodyKind`).
|
|
387
|
+
- Portuguese text anywhere outside `locales/pt-BR.json`.
|
|
388
|
+
- `zombiada/plugin.js` and `zombiada/frota/*.js` were never part of the SDK; the fleet is a content pack built on this package.
|
|
389
|
+
|
|
390
|
+
## What a fleet pack changes
|
|
391
|
+
|
|
392
|
+
1. Replace `VehicleSDK.register({ k, grp, n, ... }, build)` with `kit.register({ key, group, name, ... }, build)`.
|
|
393
|
+
2. Rename the context calls (`c.g` -> `c.vehicle`, `c.rb` -> `c.roundBox`, ...) and the meta keys (`L`, `W`, `clear`, ... -> `length`, `width`, `clearance`, ...).
|
|
394
|
+
3. Use English part kinds, glass types, zone types, particle names and state names; use `{ key }` labels where the label is a known part.
|
|
395
|
+
4. Move scenario definitions, effect texts and bands to `configure` with the new key names (`zoneEffects`, `partEffects`, `flagEffects`) and `{who}`.
|
|
396
|
+
5. Zone ids in saved game data (`zs.h` maps) must be translated once with the table above; `build` takes `{ health, flags }`.
|
|
397
|
+
6. Choose the locale: `createVehicleKit({ THREE, locale: 'pt-BR' })` reproduces the original texts exactly.
|