FiveM Add-on Clothes คืออะไร ต่างจาก Replace Clothes อย่างไร และใช้งานอย่างไร

FiveM Add-on Clothes คือแนวทางเพิ่มเสื้อผ้า เครื่องแต่งกาย และ Props ใหม่เข้าไปในระบบ Ped ของ GTA V/FiveM โดยพยายามรักษา Content เดิมไว้ แทนที่จะนำ Custom Asset ไปเขียนทับเสื้อผ้าเดิมแบบ Replace

สำหรับ Server Roleplay ที่มีเสื้อผ้าจำนวนมาก เช่น ชุดตำรวจ EMS แก๊ง ธุรกิจ เสื้อแฟชั่น รองเท้า หมวก และเครื่องประดับ การใช้ Add-on Clothes ช่วยให้จัด Content เป็นชุด ๆ ได้ง่ายกว่า แต่สิ่งสำคัญคือระบบ Clothing Script ต้องเข้าใจ Ped Model, Component, Drawable, Texture, Prop และ Collection ด้วย

Cfx.re ปัจจุบันมี Collection-based natives สำหรับ Drawable Components และ Props โดยระบุว่า Global Index ของ Custom Clothes สามารถเลื่อนหลัง GTA Title Update ได้ ขณะที่ Local Index ภายใน Named Collection ถูกออกแบบให้คงที่หลังการอัปเดต จึงเหมาะกับ Server ที่ต้องการดูแล Outfit ระยะยาว.

บทความนี้จาก comsiam จะอธิบาย FiveM Add-on Clothes แบบครบ ตั้งแต่ความแตกต่างกับ Replace Clothes ไปจนถึงวิธีจัด Index และป้องกัน Outfit เพี้ยนหลัง Game Update

FiveM Add-on Clothes คืออะไร

เข้าใจแบบง่ายที่สุดว่า

Add-on Clothes
=
เพิ่ม Clothing Content ใหม่
โดยไม่ตั้งใจแทนที่ของเดิม

ตัวอย่างเช่น Server เดิมมีเสื้อจำนวนหนึ่งอยู่แล้ว แล้วเพิ่ม

Police Pack
EMS Pack
Gang Pack
Business Pack
Fashion Pack

เข้ามาเป็น Content เพิ่มเติม

แนวคิดนี้ต่างจาก Replace ที่นำ Custom Asset ไปใช้แทน Variation เดิม

① Add-on Clothes ต่างจาก Custom Clothes อย่างไร

Custom Clothes เป็นคำกว้าง

สามารถประกอบด้วย

Custom Clothes
├── Add-on Clothes
└── Replace Clothes

ดังนั้น Add-on Clothes เป็นรูปแบบหนึ่งของ Custom Clothes

แต่ Custom Clothes ไม่ได้หมายความว่าเป็น Add-on ทุกชุด

② Add-on Clothes ต่างจาก Replace Clothes อย่างไร

Add-on

พยายามเพิ่ม Content ใหม่

ของเดิม
+
ของใหม่

Replace

นำ Custom Asset ไปแทนตำแหน่งของเดิม

ของเดิม
↓
ถูกแทน
↓
Custom Asset

สำหรับ Server ที่มีเสื้อผ้าจำนวนมาก การรู้ว่า Pack เป็น Add-on หรือ Replace ก่อนติดตั้งสำคัญมาก เพราะวิธีจัด Asset และผลกระทบต่อ Clothing IDs แตกต่างกัน

③ Add-on Clothes ดีกว่า Replace เสมอไหม

ไม่เสมอ

Add-on เหมาะกับ Server ที่ต้องการ

  • เสื้อจำนวนมาก

  • หลายหน่วยงาน

  • หลายแก๊ง

  • หลายธุรกิจ

  • เพิ่ม Content ต่อเนื่อง

  • รักษาของ GTA เดิมไว้

แต่ Replace อาจยังเหมาะกับ Server ที่ต้องการเปลี่ยน Content บาง Slot โดยเฉพาะและมีจำนวน Asset ไม่มาก

จึงควรเลือกตาม Architecture ของ Clothing System มากกว่าเลือกจากคำว่า Add-on เพียงอย่างเดียว

④ Add-on Clothes ทำงานกับ Ped อย่างไร

FiveM Clothing System พื้นฐานสามารถมองเป็นโครงสร้าง

Ped Model
↓
Component
↓
Drawable
↓
Texture

FiveM Native SET_PED_COMPONENT_VARIATION รับ componentId, drawableId, textureId และ paletteId และ Cfx.re ระบุว่า Components, Drawables และ Textures สัมพันธ์กับ Ped Model ที่กำลังใช้งาน.

ดังนั้น Clothing ID ต้องอ่านภายใต้ Ped Model ที่ถูกต้องเสมอ

⑤ Component คืออะไร

Component คือส่วนของตัวละคร

ตัวอย่างที่ใช้บ่อย เช่น

3  Torso
4  Legs
6  Shoes
7  Accessories
8  Undershirts
9  Body Armor
10 Decals
11 Tops

ระบบเสื้อผ้าจะเลือก Component ก่อน แล้วเลือก Drawable และ Texture ภายใน Component นั้น.

⑥ Drawable คืออะไร

Drawable คือ Variation หลัก

ตัวอย่าง

Component 11 = Tops

อาจประกอบด้วย

Drawable 0
Drawable 1
Drawable 2
...

Drawable หนึ่งอาจเป็น Hoodie

อีก Drawable อาจเป็น Jacket

อีกตัวอาจเป็น Police Shirt

⑦ Texture คืออะไร

Drawable เดียวสามารถมีหลาย Texture

ตัวอย่าง

Hoodie
├── Texture 0 = Black
├── Texture 1 = Red
├── Texture 2 = Blue
└── Texture 3 = Custom Logo

ดังนั้นการเปลี่ยนเพียงสีหรือลาย ไม่จำเป็นต้องใช้ Drawable ใหม่ทุกครั้งหาก Asset ถูกออกแบบเป็น Texture Variations

⑧ Add-on Clothes สามารถมี Props ได้ไหม

ได้ในความหมายของ Clothing Pack ที่รวมเครื่องประดับด้วย

แต่ Ped Props ถูกจัดการแยกจาก Components ในระบบ GTA/FiveM

FiveM Collection-based Documentation ระบุว่าทั้ง Drawable Components และ Props ถูกจัดเก็บเป็น Named Collections และสามารถเข้าถึงด้วย Collection-based APIs ได้.

ตัวอย่าง Props ได้แก่

หมวก
แว่น
นาฬิกา
กำไล

ตาม Slot และ Ped Model ที่รองรับ

⑨ Add-on Hat กับ Add-on Shirt เหมือนกันไหม

แนวคิด Add-on คล้ายกัน แต่ API ที่นำไปใช้ต่างกัน

เสื้อหรือกางเกงใช้ Component

ส่วนหมวกหรือ Prop ใช้ Prop Variation

จึงต้องแยก

Component Drawable

ออกจาก

Prop Drawable

ใน Clothing Database และ Script

⑩ Male และ Female Add-on Clothes ใช้ไฟล์เดียวกันไหม

ไม่ควรสมมติว่าใช้ร่วมกันได้

เพราะ Cfx.re ระบุว่า Drawable/Texture IDs ขึ้นกับ Ped Model.

Asset ที่ทำสำหรับ Ped ชายอาจมี

  • Geometry

  • Rig

  • Shape

  • Index

ต่างจาก Ped หญิง

ดังนั้น Pack ควรระบุให้ชัดว่า

Male
Female
หรือ Both

⑪ MP Freemode Ped สำคัญอย่างไร

FiveM Roleplay Servers จำนวนมากใช้ Multiplayer Freemode Ped เป็นฐานในการแต่งตัว

แต่สิ่งที่สำคัญกว่าในเชิงระบบคือ Clothing Variation ต้องสัมพันธ์กับ Ped Model

จึงไม่ควร Save เพียง

Drawable = 100

โดยไม่รู้ว่า Drawable 100 นั้นเป็นของ Ped Model ใด

⑫ Global Drawable Index คืออะไร

ก่อน Collection-based natives ระบบมักอ้าง Drawables ผ่าน Global Index

แนวคิดคือ Collections ต่าง ๆ ถูกนำมาต่อกัน

เช่น

Collection A
0–49

Collection B
50–99

Collection C
100–149

Global Index เป็นตำแหน่งจากต้นรายการทั้งหมด

Cfx.re อธิบายว่าปัญหาคือเมื่อ GTA Title Update เพิ่ม Drawables เข้า Collection ที่อยู่ก่อนหน้า Global Index ของ Custom Content ที่ตามหลังสามารถเปลี่ยนได้.

⑬ ทำไม GTA Update แล้วเสื้อเปลี่ยนตัว

สมมติ Outfit บันทึก

Top Drawable = 150

ต่อมา GTA Update เพิ่ม Drawables เข้า Collection ก่อน Custom Pack

Global Index เดิมอาจเลื่อน

ผลคือ

ก่อน Update
150 = Police Shirt

หลัง Update
150 = Clothes ตัวอื่น

นี่คือปัญหาที่ Collection-based natives ถูกออกแบบมาช่วยแก้โดยตรง.

⑭ Collection คืออะไร

Cfx.re อธิบายว่า GTA V เก็บ Ped Drawable Components และ Props ไว้ในกลุ่มที่มีชื่อเรียกว่า Collections.

แนวคิด

Collection A
├── Drawable 0
├── Drawable 1
└── Drawable 2

Collection B
├── Drawable 0
├── Drawable 1
└── Drawable 2

แต่ละ Collection มี Local Index ของตัวเอง

⑮ Local Index คืออะไร

Local Index เริ่มนับจากต้นของ Collection นั้น

ตัวอย่าง

Collection custom_police

Drawable 0
Drawable 1
Drawable 2

แม้ Global Index ของ custom_police จะเปลี่ยนหลัง GTA Update แต่ Local Index ภายใน Collection สามารถคงเดิมได้

นี่คือข้อดีหลักของ Collection-based System.

⑯ Collection-based Index ดีกว่า Global Index อย่างไร

Cfx.re ระบุชัดว่า Collection-based indexes ถูกออกแบบให้ Stable หลัง Title Updates.

สำหรับ Server ที่มี Outfit Database จำนวนมาก สิ่งนี้ช่วยลดปัญหา

Update Game Build
↓
Custom Clothes Index เลื่อน
↓
Outfit ผู้เล่นพังทั้ง Server

⑰ Collection-based natives ใช้ฝั่งไหน

Documentation ปัจจุบันของ Cfx.re ระบุว่า Collection-based natives ชุดนี้สำหรับ GTAV และใช้งาน Client-side.

ดังนั้น Clothing Script ต้องออกแบบ Client Logic ให้เหมาะกับ API นี้

⑱ SetPedCollectionComponentVariation คืออะไร

FiveM มี Native สำหรับใส่ Component โดยอ้าง Collection และ Local Drawable

แนวคิด

SetPedCollectionComponentVariation(
    ped,
    componentId,
    collectionName,
    localDrawableId,
    textureId,
    paletteId
)

จุดต่างสำคัญคือ Drawable ID เป็น Local Index ภายใน Collection ไม่ใช่ Global Index ของ Clothing ทั้งหมด.

⑲ ระบบ Outfit ใหม่ควรเก็บ Collection หรือไม่

ถ้าระบบรองรับ Collection-based natives ควรพิจารณาเก็บ

Ped Model
Component ID
Collection Name
Local Drawable ID
Texture ID

แทนการเก็บเพียง

Component
Global Drawable
Texture

เพราะ Collection + Local Index มีความทนทานต่อ Title Update มากกว่า.

⑳ Outfit เก่าที่ใช้ Global Index ต้องลบทิ้งไหม

ไม่จำเป็นต้องลบทิ้งทันที

ควรทำ Migration อย่างเป็นระบบ

แนวคิด

อ่าน Global Index เดิม
↓
หา Collection
↓
หา Local Drawable
↓
บันทึกโครงสร้างใหม่

Cfx.re Documentation อธิบายความสัมพันธ์ระหว่าง Global และ Local Index เพื่อช่วยให้ Developer เข้าใจการ Migration ไปยัง Collection-based APIs.

㉑ Add-on Clothes ต้องมี Clothing Menu ใหม่ไหม

ไม่จำเป็นเสมอไป

ถ้า Clothing Menu เดิมรองรับ Asset Pack และ Index System ที่ใช้ ก็สามารถใช้งานต่อได้

แต่หาก Menu ใช้

Global Index อย่างเดียว

และ Server ต้องการใช้ Collection-based Architecture อาจต้องปรับ Script

ดังนั้นก่อนเปลี่ยน Asset Pack ควรตรวจ Clothing Resource ก่อน

㉒ ESX ใช้ Add-on Clothes ได้ไหม

ตัว Asset ไม่ได้ผูกกับ ESX โดยตรง

FiveM Resource สามารถประกอบด้วย Streaming Assets และ Scripts ได้ และระบบ Ped Variations เป็น API ของ FiveM/GTA.

แต่ Clothing Menu ของ Server อาจเป็น ESX Resource

จึงต้องดู Integration ของ Menu/Database แยกจาก Asset

㉓ QBCore ใช้ Add-on Clothes ได้ไหม

หลักเดียวกัน

Add-on Clothes เป็น Content Layer

ส่วน QBCore Clothing Script เป็น Gameplay/Application Layer

จึงต้องตรวจว่า Clothing Script ที่ใช้อยู่รองรับ

  • Custom Collections

  • Drawables

  • Props

  • Outfit Persistence

มากน้อยแค่ไหน

㉔ Add-on Clothes ต้องใช้ OneSync ไหม

ตัว Ped Clothing Asset และ Client Clothing Variation ไม่ได้ทำให้ OneSync เป็น Requirement โดยอัตโนมัติ

OneSync เป็นระบบ Synchronization ของ FiveM ซึ่งเป็นอีกระบบหนึ่งต่างหาก.

Framework หรือ Character Script อาจใช้ OneSync ด้วยเหตุผลอื่น แต่ไม่ควรสรุปว่า Add-on Clothes = ต้องใช้ OneSync

㉕ Add-on Clothes เป็น FiveM Resource ได้ไหม

ได้

Cfx.re ระบุว่า Resource คือ Collection ของ Files เช่น

  • Client Scripts

  • Server Scripts

  • Streaming Assets

และสามารถ Start, Stop หรือ Restart ได้.

Clothing Pack จึงสามารถถูกจัดเป็น Resource แยกได้

㉖ ตัวอย่างโครงสร้าง Resource

ตัวอย่างเชิงแนวคิด

resources/
└── [clothes]/
    └── police_clothes/
        ├── fxmanifest.lua
        └── stream/

Cfx.re รองรับ Category Folder แบบ [name] ภายใต้ resources/ และ Resource แต่ละตัวต้องมี Resource Manifest เพื่อให้ Server รู้จักอย่างถูกต้อง.

㉗ fxmanifest.lua คืออะไร

fxmanifest.lua คือ Resource Manifest ปัจจุบันของ FiveM และอยู่ใน Resource Folder เพื่อกำหนด Metadata และ Resource Configuration.

ถ้า Clothing Pack วาง Folder ผิดชั้น เช่น

police_clothes/
└── police_clothes/
    └── fxmanifest.lua

แต่ Server พยายาม Start Folder ชั้นนอก อาจหา Resource Manifest ไม่พบ

㉘ Add-on Clothes ไม่ขึ้นหลังติดตั้ง

ตรวจตามลำดับ

Resource Folder
↓
fxmanifest.lua
↓
Resource ถูกค้นพบ
↓
Resource Started
↓
Ped Model
↓
Collection/Component
↓
Drawable
↓
Texture
↓
Clothing Menu

อย่าข้ามไปแก้ Texture ถ้า Server ยังไม่ Start Resource

㉙ ใช้ refresh เมื่อไร

FiveM มีคำสั่ง

refresh

สำหรับ Rescan Resources Folder และโหลด Resource Manifests ใหม่ ทำให้ Resources ที่เพิ่มใหม่พร้อมสำหรับ Start.

จึงเหมาะเมื่อเพิ่ม Clothing Resource ขณะ Server กำลังทำงาน

㉚ หลัง refresh ใช้อะไรต่อ

ใช้

ensure resource_name

ตาม Resource Management Workflow

ensure จะ Start Resource หากยังหยุดอยู่ หรือ Restart หาก Resource ทำงานอยู่แล้วตาม Server Commands ของ FiveM.

ตัวอย่าง

refresh
ensure police_clothes

㉛ Resource Start แล้วแต่เสื้อยังไม่ขึ้น

การที่ Resource Started ไม่ได้ยืนยันว่า Clothing Data ถูกต้องทั้งหมด

ให้ตรวจต่อ

  • Ped Model

  • Collection

  • Component

  • Drawable

  • Texture

  • Clothing Script

ปัญหา Asset และ Index ยังสามารถเกิดได้แม้ Resource Start สำเร็จ

㉜ เสื้อไม่ขึ้นเฉพาะ Male

ตรวจว่า Pack มี Male Asset จริงหรือไม่

หาก Female ทำงาน แต่ Male หาย ให้แยกตรวจ Ped Model/Collection ของ Male

เพราะ Drawables และ Textures สัมพันธ์กับ Ped Model.

㉝ เสื้อไม่ขึ้นเฉพาะ Female

ใช้หลักเดียวกัน

อย่า Copy Male Drawable IDs ไปใช้กับ Female โดยคิดว่าจะตรงกัน

ต้องอ้าง Asset ของ Ped Model ที่ถูกต้อง

㉞ เสื้อขึ้นแต่แขนหาย

ปัญหานี้มักเกี่ยวกับ Combination

Top
+
Torso
+
Undershirt

มากกว่าการที่ Add-on Resource ไม่โหลด

ให้ตรวจ Combination ที่ Creator แนะนำก่อน

㉟ เสื้อขึ้นแต่ทะลุตัว

อาจเกิดจาก

  • Mesh

  • Rigging

  • Weighting

  • Torso

  • Undershirt

  • Body Shape

หากเกิดกับทุก Client และเฉพาะ Asset ตัวเดียว มีโอกาสสูงว่าเป็น Asset/Combination Issue มากกว่า Server Network

㊱ Texture เสื้อผิด

ตรวจ

Texture ID

ก่อน

เพราะ Drawable หนึ่งตัวสามารถมี Texture Variations หลายตัว และ FiveM แยก drawableId กับ textureId ใน Component Variation API.

㊲ Logo คนละอันขึ้น

ตัวอย่าง

Drawable ถูก
แต่ Texture 2 แทน Texture 0

จะทำให้รูปทรงเสื้อถูกต้อง แต่ Logo/สีผิด

จึงควรตรวจ Texture Index ที่ Outfit Database บันทึก

㊳ หมวกไม่ขึ้นแต่เสื้อขึ้น

เสื้อและหมวกอาจอยู่คนละระบบ

เสื้อ = Component

หมวก = Prop ในหลาย Ped Setups

ดังนั้น Clothing Script ต้องโหลดทั้ง Component และ Prop Data ไม่ใช่ Components อย่างเดียว

㊴ Add-on Props ก็มี Collection ได้ไหม

ได้

Cfx.re Collection-based Documentation ครอบคลุมทั้ง Drawable Components และ Props.

นี่สำคัญกับ

  • Hats

  • Glasses

  • Watches

  • Bracelets

ตาม Prop Slots ของ Ped ที่ใช้งาน

㊵ Outfit หลัง Update หมวกเพี้ยนด้วยได้ไหม

ได้ เพราะ Cfx.re ระบุว่า Global Index ของทั้ง Custom Drawable Components และ Props สามารถเปลี่ยนหลัง Title Update.

ดังนั้น Collection-based Architecture มีประโยชน์กับ Props เช่นเดียวกับเสื้อผ้า Components

㊶ Add-on Clothes จำนวนมากทำให้ FPS ตกไหม

จำนวนรายการอย่างเดียวไม่พอจะสรุป

ต้องดู

  • Model Complexity

  • Texture Resolution

  • จำนวนผู้เล่นใน Scene

  • จำนวน Assets ที่กำลังใช้งาน

  • Streaming Memory

FiveM Resources สามารถมี Streaming Assets และ Client ต้องจัดการ Content ของ Resources ที่ใช้งาน.

จึงควรประเมิน Asset Budget รวม

㊷ เสื้อผ้า 4K หลายพันตัวดีไหม

ไม่จำเป็น

หาก Texture Resolution สูงเกินสิ่งที่ผู้เล่นมองเห็นจริง จะเพิ่ม Asset Cost โดยไม่จำเป็น

ควรใช้ความละเอียดตาม

  • ขนาด Item

  • ระยะมอง

  • Logo Detail

  • ความสำคัญต่อ Character

Server ที่มี Maps, Cars และ Clothes จำนวนมากยิ่งควรรักษา Streaming Budget

㊸ ใช้ strmem ตรวจเสื้อผ้าได้ไหม

strmem ของ FiveM แสดง Streaming Memory ของ Streaming Assets รายตัวและภาพรวม.

จึงใช้ช่วยตรวจ Asset Pressure ใน Scene ที่มี Custom Clothes, Cars และ Maps จำนวนมากได้

ใช้

strmem true

ใน Environment ที่เปิดใช้ Developer Commands ตามเงื่อนไขของ FiveM

㊹ Clothing Pack ใหญ่ไม่เท่ากับหนักเสมอไป

Pack 1,000 Items ที่ Optimize ดีอาจจัดการได้ดีกว่า Pack เล็กที่มี

  • Texture ใหญ่เกิน

  • Models หนัก

  • Duplicate Assets

จำนวนรายการจึงเป็นเพียงตัวเลขหนึ่ง

ไม่ใช่คำตอบทั้งหมดของ Performance

㊺ ควรรวม Add-on Clothes ทุก Pack หรือไม่

ไม่จำเป็น

ช่วงแรกควรแยก Resource เช่น

police_clothes
ems_clothes
gang_clothes
business_clothes

เพื่อให้

  • Debug ง่าย

  • Update ง่าย

  • Remove Pack ง่าย

  • หา Conflict ง่าย

การ Merge ควรทำเมื่อเข้าใจ Asset Structure และ Naming แล้ว

㊻ ทำไม Merge Clothes แล้วบางตัวหาย

สาเหตุที่ควรตรวจ

  • Filename ถูก Replace

  • Collection Data หาย

  • Pack Structure เปลี่ยน

  • Asset Name ชน

  • Resource Manifest ผิด

  • Clothing Index เปลี่ยน

ถ้าแต่ละ Pack เดี่ยวทำงานปกติ ให้เปรียบเทียบก่อนและหลัง Merge แทนการแก้ Model ใหม่ทันที

㊼ Copy แล้วกด Replace ทั้งหมดอันตรายไหม

อันตรายสำหรับ Custom Assets

ถ้า

Pack A
file_x

กับ

Pack B
file_x

ชื่อเดียวกันแต่ Content ต่างกัน การกด Replace จะทำให้ Asset หนึ่งชุดหาย

จึงควรตรวจ Filename และ Collection Structure ก่อน Merge

㊽ Add-on Clothes Conflict มีอาการอย่างไร

อาจเกิด

  • เสื้อหาย

  • เสื้อคนละตัวขึ้น

  • Texture ผิด

  • Prop หาย

  • Pack แรกเสียหลังติดตั้ง Pack ใหม่

  • Outfit เก่าเปลี่ยน

  • Female ปกติ Male พัง

ให้ทำ A/B Test ระหว่าง Resources ก่อน

㊾ วิธี A/B Test Clothing Pack

ตัวอย่าง

Pack A ON
Pack B OFF

ทดสอบ

จากนั้น

Pack A OFF
Pack B ON

แล้ว

Pack A ON
Pack B ON

ถ้าสองรอบแรกปกติ แต่รอบสุดท้ายผิด ให้ตรวจ Conflict ระหว่าง Packs

㊿ Add-on Clothes ควรมี Naming Convention ไหม

ควร

ตัวอย่างเชิงแนวคิด

pd_
ems_
gang_a_
business_a_

ช่วยลดความเสี่ยงของชื่อ Asset ชนและทำให้ Developer หาเจ้าของ Asset ได้ง่าย

โดยเฉพาะ Server ที่มี Clothing Packs จากหลาย Creator

51. Collection Name ควรตั้งให้สื่อความหมายไหม

ควร หากคุณควบคุม Asset Pipeline เอง

เช่น

pd_uniforms
ems_uniforms
gang_red
business_clothes

ช่วยให้ Outfit Database และ Clothing Menu อ่านง่ายกว่า Collection Names ที่ไม่สามารถระบุเจ้าของ Content ได้

52. Outfit Database แบบใหม่ควรเก็บอะไร

แนวทางที่มีประโยชน์คือ

Ped Model
Component ID
Collection Name
Local Drawable ID
Texture ID

ส่วน Props อาจเก็บ

Ped Model
Prop Slot
Collection Name
Local Drawable ID
Texture ID

เพราะ Collection-based indexes ถูกออกแบบให้คงที่หลัง Title Updates.

53. ต้องเก็บ Global Index ไว้ด้วยไหม

ระหว่าง Migration อาจเก็บไว้ชั่วคราวเพื่อ Compatibility หรือ Debug

แต่ถ้า Architecture ใหม่ใช้ Collection-based IDs เป็น Source of Truth ก็ไม่ควรพึ่ง Global Index อย่างเดียวต่อไป

เป้าหมายคือหลีกเลี่ยงการ Migration Outfit ทั้ง Server ทุกครั้งที่ GTA เพิ่ม Clothing Content ใหม่

54. Add-on Clothes ต้องตรวจหลังเปลี่ยน Game Build ไหม

ควรเสมอ

แม้ใช้ Collection-based indexes ก็ควร Regression Test

  • Male

  • Female

  • Components

  • Props

  • Saved Outfits

  • Clothing Shop

  • Job Uniforms

เพราะ Index Stability ไม่ได้ป้องกันปัญหา Asset หรือ Script ทุกประเภท

55. Collection-based natives แก้ Clipping ไหม

ไม่

Collection-based APIs ช่วยเรื่องการอ้าง Drawables/Props และ Index Stability

ไม่ได้แก้

  • Mesh

  • Weighting

  • Torso

  • Texture

  • Clipping

  • Rigging

ปัญหาเหล่านี้ต้องแก้ Asset หรือ Clothing Combination แยก

56. Collection-based natives แก้ Texture ขาวไหม

ไม่

ถ้า Drawable ถูกต้องแต่ Texture ขาวหรือเสีย ต้องตรวจ Texture Asset และ Material

Collection ช่วยระบุตัว Drawable ที่ถูกต้อง แต่ไม่ได้สร้าง Texture ที่หายให้

57. Add-on Clothes ต้องทดสอบ Animation ไหม

ควร

เสื้ออาจดูปกติเมื่อยืน แต่พังเมื่อ

  • วิ่ง

  • ยกแขน

  • เล็งปืน

  • นั่งรถ

  • Emote

  • Crouch

  • กระโดด

ดังนั้น Asset QA ต้องทดสอบ Character Movement จริง

58. Job Uniform ควรเก็บเป็น Outfit Preset ไหม

ควร หาก Clothing System รองรับ

ตัวอย่าง

Police Patrol
Police SWAT
EMS
Mechanic

แต่ Preset ควรเก็บข้อมูลในรูปแบบเดียวกับ Clothing Architecture หลัก เพื่อไม่ให้ Job Uniform ใช้ Global IDs ขณะที่ Player Outfits ใช้ Collection IDs คนละระบบ

59. Gang Clothes หลาย Texture ควรทำอย่างไร

หาก Geometry เหมือนกันแต่เปลี่ยนเพียง

  • สี

  • Logo

  • Pattern

การใช้ Texture Variations ภายใต้ Drawable เดียวสามารถจัด Content ได้เป็นระบบกว่า Duplicate Model หลายตัว

เพราะ FiveM Ped Variation API แยก Drawable และ Texture IDs ออกจากกันอยู่แล้ว.

60. Add-on Clothes ต้องใช้ Asset Escrow ไหม

ไม่จำเป็นสำหรับ Free หรือ Internal Asset

แต่ Commercial Resources อาจใช้ Asset Escrow

Cfx.re ระบุว่า Asset Escrow รองรับ File Types บางประเภท เช่น Lua, YFT, YDD และ YDR ในระบบปัจจุบัน.

หากซื้อ Clothing Resource มา ควรปฏิบัติตาม License และ Installation Guide ของ Creator ไม่ควรพยายาม Bypass Protection

61. Add-on Clothes ติดตั้งแล้ว Server หาไม่เจอ

ตรวจ Nested Folder

ตัวอย่างผิด

resources/
└── custom_clothes/
    └── custom_clothes/
        ├── fxmanifest.lua
        └── stream/

หาก Resource Root จริงอยู่ชั้นใน แต่ ensure ชี้ชั้นนอก FiveM อาจไม่พบ Manifest

Resource Manifest ต้องอยู่ใน Resource Folder ที่ Server ใช้เป็น Resource จริง.

62. วิธี Debug FiveM Add-on Clothes แบบเร็วที่สุด

ใช้ลำดับนี้

ขั้นที่ 1 — ตรวจ Resource Root

หา

fxmanifest.lua

ให้เจอ

ขั้นที่ 2 — ถ้าเพิ่งเพิ่ม Resource

ใช้

refresh

FiveM จะ Rescan Resource Manifests.

ขั้นที่ 3 — Start Resource

ensure resource_name

ขั้นที่ 4 — ตรวจ Ped Model

Drawable IDs สัมพันธ์กับ Ped Model.

ขั้นที่ 5 — ตรวจ Component หรือ Prop

ขั้นที่ 6 — ตรวจ Collection

ถ้า Pack ใช้ Collection Architecture

ขั้นที่ 7 — ตรวจ Local Drawable

ขั้นที่ 8 — ตรวจ Texture

ขั้นที่ 9 — ถ้า Outfit เปลี่ยนหลัง GTA Update

ตรวจว่า Script ยังใช้ Global Index อยู่หรือไม่.

ขั้นที่ 10 — ปิด Clothing Packs อื่น

ทำ A/B Test หา Conflict

63. ตารางสรุปปัญหา FiveM Add-on Clothes

อาการจุดที่ควรตรวจ
Add-on Clothes ไม่ขึ้นResource / Manifest
Resource หาไม่เจอFolder ซ้อน / fxmanifest.lua
เสื้อขึ้นคนละตัวDrawable/Global Index
GTA Update แล้ว Outfit เพี้ยนGlobal Index Shift
Collection ถูกแต่ Item ผิดLocal Drawable
สีหรือ Logo ผิดTexture ID
Male ไม่ขึ้นMale Ped Asset
Female ไม่ขึ้นFemale Ped Asset
เสื้อขึ้นแต่แขนหายTop/Torso Combination
เสื้อทะลุตัวMesh/Weighting
หมวกไม่ขึ้นProp Slot/Collection
Pack A ทำ Pack B พังAsset Conflict
Merge แล้ว Item หายFiles/Collections ถูก Replace
FPS/Streaming หนักAsset/Texture Budget
Resource Start แล้ว Menu ไม่มีClothing Script Integration

Add-on Clothes ที่ดีควรมีลักษณะอย่างไร

ควรมี

  • Male/Female แยกชัด

  • Asset Naming เป็นระบบ

  • Collection Naming ชัด

  • Texture Resolution สมเหตุสมผล

  • ไม่มี Asset ชื่อชน

  • Compatible Torso/Top ชัด

  • Resource Structure ถูก

  • Clothing Menu รองรับ

  • Outfit Persistence ถูก

  • ทดสอบหลัง GTA Update

  • Backup ก่อน Merge

สำหรับ Server ที่พัฒนา Clothing System เอง การรองรับ Collection-based natives เป็นสิ่งที่ควรพิจารณาอย่างจริงจัง เพราะ Cfx.re สร้าง API ชุดนี้เพื่อแก้ปัญหา Global Custom Drawable/Prop Index เลื่อนหลัง Title Updates โดยตรง.

Add-on Clothes กับ Replace แบบสั้นที่สุด

จำแบบนี้

Add-on
=
เพิ่ม Content ใหม่
รักษาของเดิมไว้มากกว่า

Replace
=
นำ Custom Asset ไปแทนของเดิม

และสำหรับ Server ขนาดใหญ่ อย่าดูแค่ Add-on หรือ Replace

ต้องดูต่อว่า Clothing Script ใช้

Global Index

หรือ

Collection + Local Index

เพราะเรื่องนี้มีผลโดยตรงต่อความเสถียรของ Saved Outfits หลัง GTA Title Updates.

สรุป FiveM Add-on Clothes คืออะไร

FiveM Add-on Clothes คือแนวทางเพิ่มเสื้อผ้าและเครื่องแต่งกายใหม่เข้าไปใน Ped Clothing Content โดยไม่เน้นการเขียนทับ Variation เดิมเหมือน Replace Clothes

โครงสร้างพื้นฐานยังคงเป็น

Ped
↓
Component / Prop
↓
Drawable
↓
Texture

แต่สำหรับ FiveM ปัจจุบันควรเข้าใจอีก Layer หนึ่งคือ

Collection
↓
Local Drawable Index

Cfx.re ระบุว่า GTA V เก็บ Drawable Components และ Props ใน Named Collections และ Global Index ของ Custom Content สามารถเปลี่ยนหลัง Title Update ขณะที่ Collection-based Local Index ถูกออกแบบให้คงที่.

ดังนั้นหาก Add-on Clothes ไม่ขึ้น ให้ตรวจ Resource, Ped Model, Collection, Component และ Drawable

ถ้า เสื้อขึ้นแต่สีหรือ Logo ผิด ให้ตรวจ Texture

ถ้า หลัง GTA Update Outfit กลายเป็นคนละชุด ให้ตรวจ Global Index ก่อน Reinstall Pack

ถ้า Male ปกติแต่ Female หาย ให้ตรวจ Asset ของ Ped Model นั้นโดยเฉพาะ

และถ้า เพิ่ม Clothing Pack ใหม่แล้ว Pack เดิมพัง ให้แยก Resources ทำ A/B Test ก่อน Merge Files

แนวทางของ comsiam คือสำหรับ Server ที่ตั้งใจมี Custom Clothes หลายร้อยหรือหลายพันรายการ ควรวางระบบ Collection, Naming และ Outfit Database ให้ถูกตั้งแต่ต้น เพราะการแก้ Index ของผู้เล่นทั้ง Server หลัง GTA Update ยากกว่าการออกแบบ Clothing Architecture ที่รองรับการขยายตัวตั้งแต่วันแรกมาก

Comments

Popular posts from this blog

FiveM ยังน่าเล่นไหม? Enhanced เปลี่ยน FiveM แค่ไหน

FiveM คืออะไร เล่นอย่างไร สำหรับมือใหม่ เริ่มต้นตั้งแต่ศูนย์

วิธีตั้ง Admin Permission ด้วย add_ace และ add_principal FiveM แบบละเอียด