Gemessen mit /tauchprobe beobachten: beim Wechsel "schwimmt" -> nein verschwanden Komponente 8 (global 123) und Prop 1 gleichzeitig, bei ausgeschaltetem Tauchgeraet; die Items blieben in den Slots. CPED_CONFIG_FLAG_DisableTakeOffScubaGear = 409 (nachgeschlagen) am Spieler-Ped, nach jedem Ped-Wechsel neu, beim Stoppen ab. /tauchprobe beobachten zeigt die Flagge mit an. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
161 lines
6.1 KiB
Lua
161 lines
6.1 KiB
Lua
--[[
|
|
d4rk_divegear - /tauchprobe: welche Kleidung ist die Tauchmaske?
|
|
(plan-divegear.md Schritt 0, 28.09.2026)
|
|
|
|
Flasche und Maske werden Kleidungsstuecke aus dem Kleiderladen
|
|
(d4rk_garment). Dafuer braucht es Komponente, Sammlung und lokalen Index -
|
|
je Modell (m/f). Der Katalog hat keine Namen, also wird gemessen:
|
|
|
|
SetPedScubaGearVariation (0x36C6984C3ED0C911, PED, client) setzt laut
|
|
Nativ-Datenbank bei Freemode-Modellen die Tauchmaske. Diese Probe liest
|
|
ALLE Komponenten (0-11) und Props (0-7) vorher und nachher und nennt,
|
|
was sich geaendert hat - samt Sammlung, lokalem Index und Zahl der
|
|
Texturen.
|
|
|
|
GEGENPROBE: aendert sich gar nichts, steht "UNGUELTIG" da - das Native hat
|
|
dann nichts getan, und "keine Maske" waere die falsche Lesart.
|
|
|
|
DIE FLASCHE setzt das Native bei Freemode NICHT (laut Doku nur bei
|
|
player_*-Modellen). Nachgeschlagen, nicht gemessen: maennlich Komponente 8,
|
|
Drawable 123. Deshalb liest die Probe mit "flasche [n]" Komponente 8 bei
|
|
Drawable n (Vorgabe 123) - ob es die Flasche IST, sieht nur das Auge.
|
|
|
|
Zurueck zur eigenen Kleidung: /d4rk_anziehen (d4rk_inventory).
|
|
]]
|
|
|
|
local function modell(ped)
|
|
local m = GetEntityModel(ped)
|
|
if m == `mp_m_freemode_01` then return 'm' end
|
|
if m == `mp_f_freemode_01` then return 'f' end
|
|
return '?'
|
|
end
|
|
|
|
local function stand(ped)
|
|
local t = {}
|
|
|
|
for c = 0, 11 do
|
|
t['c' .. c] = {
|
|
art = 'c', id = c,
|
|
d = GetPedDrawableVariation(ped, c), tex = GetPedTextureVariation(ped, c),
|
|
sammlung = GetPedDrawableVariationCollectionName(ped, c) or 'base',
|
|
lokal = GetPedDrawableVariationCollectionLocalIndex(ped, c),
|
|
}
|
|
end
|
|
|
|
for p = 0, 7 do
|
|
t['p' .. p] = {
|
|
art = 'p', id = p,
|
|
d = GetPedPropIndex(ped, p), tex = GetPedPropTextureIndex(ped, p),
|
|
sammlung = GetPedPropCollectionName(ped, p) or 'base',
|
|
lokal = GetPedPropCollectionLocalIndex(ped, p),
|
|
}
|
|
end
|
|
|
|
return t
|
|
end
|
|
|
|
local function zeile(ped, e)
|
|
local texturen = e.art == 'c' and GetNumberOfPedTextureVariations(ped, e.id, e.d)
|
|
or (e.d >= 0 and GetNumberOfPedPropTextureVariations(ped, e.id, e.d) or 0)
|
|
|
|
return ('%s%-2d global %4d Textur %2d Sammlung %-14s lokal %4d Texturen %d'):format(
|
|
e.art, e.id, e.d, e.tex, tostring(e.sammlung ~= '' and e.sammlung or 'base'), e.lokal or -1, texturen or -1)
|
|
end
|
|
|
|
--[[
|
|
/tauchprobe beobachten [sekunden] - 29.09.2026. Betreiber: "bei der
|
|
taucherfalsche haben wir das problem er zieht sie aus wenn er an land ist".
|
|
|
|
Schreibt JEDE Aenderung an Flasche (Komponente 8) und Maske (Prop 1) mit
|
|
Zeit, Wasserzustand und ob das Tauchgeraet aktiv ist - damit man sieht,
|
|
WANN sie verschwindet (Wasser verlassen? Tauchgeraet aus? Neuanziehen?),
|
|
statt es zu raten. Alle 10 s eine Lebenszeile, damit Stille nicht wie
|
|
"keine Aenderung" aussieht, wenn die Probe gar nicht laeuft.
|
|
]]
|
|
local function beobachten(sekunden)
|
|
local ende = GetGameTimer() + sekunden * 1000
|
|
local start = GetGameTimer()
|
|
local letzt, lebenszeichen = nil, 0
|
|
|
|
print(('^5=== Tauchprobe beobachten, %d s ===^7'):format(sekunden))
|
|
print(' t Flasche (c8) Maske (p1) Wasser Schwimmt Unten Geraet Flag409')
|
|
|
|
while GetGameTimer() < ende do
|
|
local ped = PlayerPedId()
|
|
local c8 = ('%s:%d (g%d t%d)'):format(GetPedDrawableVariationCollectionName(ped, 8) or 'base',
|
|
GetPedDrawableVariationCollectionLocalIndex(ped, 8) or -1, GetPedDrawableVariation(ped, 8), GetPedTextureVariation(ped, 8))
|
|
local p1 = ('%s:%d (g%d t%d)'):format(GetPedPropCollectionName(ped, 1) or 'base',
|
|
GetPedPropCollectionLocalIndex(ped, 1) or -1, GetPedPropIndex(ped, 1), GetPedPropTextureIndex(ped, 1))
|
|
local function jn(x) return (x == true or x == 1) and 'j' or 'n' end
|
|
local okA, aktiv = pcall(function() return exports.d4rk_divegear:geraetAktiv() end)
|
|
local zeile = ('%-29s %-29s %s %s %s %s %s'):format(c8, p1, jn(IsEntityInWater(ped)),
|
|
jn(IsPedSwimming(ped)), jn(IsPedSwimmingUnderWater(ped)), okA and jn(aktiv) or '?',
|
|
jn(GetPedConfigFlag(ped, 409, true)))
|
|
local t = (GetGameTimer() - start) / 1000
|
|
|
|
if zeile ~= letzt then
|
|
print((' %5.1f %s'):format(t, zeile))
|
|
letzt = zeile
|
|
elseif t - lebenszeichen >= 10 then
|
|
print((' %5.1f (unveraendert)'):format(t))
|
|
lebenszeichen = t
|
|
end
|
|
|
|
Wait(250)
|
|
end
|
|
|
|
print('^5=== Tauchprobe beobachten: Ende ===^7')
|
|
end
|
|
|
|
RegisterCommand('tauchprobe', function(_, args)
|
|
local ped = PlayerPedId()
|
|
|
|
if args[1] == 'beobachten' then
|
|
CreateThread(function() beobachten(tonumber(args[2]) or 120) end)
|
|
lib.notify({ title = 'Tauchprobe', description = 'Beobachte - Ausgabe in F8.', type = 'info' })
|
|
return
|
|
end
|
|
|
|
print('')
|
|
print(('^5=== d4rk_divegear: Tauchprobe (Modell %s) ===^7'):format(modell(ped)))
|
|
|
|
if args[1] == 'flasche' then
|
|
local n = tonumber(args[2]) or 123
|
|
|
|
SetPedComponentVariation(ped, 8, n, 0, 0)
|
|
Wait(300)
|
|
|
|
local s = stand(ped).c8
|
|
print(' Komponente 8 gesetzt auf global ' .. n .. ':')
|
|
print(' ' .. zeile(ped, s))
|
|
print((' Ist das die Taucherflasche? Ansehen. Andere Nummer: /tauchprobe flasche <n>. '
|
|
.. 'Zurueck: /d4rk_anziehen'))
|
|
return
|
|
end
|
|
|
|
local vorher = stand(ped)
|
|
SetPedScubaGearVariation(ped)
|
|
Wait(500)
|
|
local nachher = stand(ped)
|
|
|
|
local anders = 0
|
|
|
|
for k, n in pairs(nachher) do
|
|
local v = vorher[k]
|
|
|
|
if v.d ~= n.d or v.tex ~= n.tex then
|
|
anders = anders + 1
|
|
print(' vorher ' .. zeile(ped, v))
|
|
print(' nachher ' .. zeile(ped, n))
|
|
end
|
|
end
|
|
|
|
if anders == 0 then
|
|
print('^1 UNGUELTIG: SetPedScubaGearVariation hat nichts geaendert - keine Aussage.^7')
|
|
else
|
|
print(('^2 %d Teil(e) geaendert.^7 Zurueck zur eigenen Kleidung: /d4rk_anziehen'):format(anders))
|
|
end
|
|
|
|
lib.notify({ title = 'Tauchprobe', description = 'Ergebnis in F8.', type = 'info' })
|
|
end, false)
|