lfnetwork.com mark read register faq members calendar

Thread: [TSL]Appearance.2da: Locking NPC Equipment slots
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 09-18-2005, 09:49 PM   #1
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
original thread

Remember that this will only prevent the item from being unequipped/equipped on the inventory screen. A script calling ActionUnequipItem() will still remove it, and using ActionEquipItem() will put an item in that slot anyway.

Preventing an equipment slot from being changed by the player is done in the appearance.2da file on a per appearancetype basis by setting bitflags in the equipslotslocked column.

Add together the numbers in the Value column below for the slots you wish to lock and put the resulting sum in that column, where:
Code:
Slot:           Value:  Bitflag:
--------------  ------  --------------
Head            1       0000 0000 0001
Body            2       0000 0000 0010
Unknown         4       0000 0000 0100
Hands           8       0000 0000 1000
Right Weapon    16      0000 0001 0000
Left Weapon     32      0000 0010 0000
Unknown         64      0000 0100 0000
Left forearm    128     0000 1000 0000
Right forearm   256     0001 0000 0000
Implant         512     0010 0000 0000
Belt            1024    0100 0000 0000
Advanced:
As seen in the Bitflag column above the numbers are actually, when converted to binary, used to toggle on (1) and off (0) the different slots, where each slot is represented by a single bit in the value. When that particular bit is set to 1, the equipment slot it represents is locked. When it's set to 0, the slot can be changed.

So, in order to see which slots are locked for a particular appearance type you can use the standard Windows calculator (set to advanced mode in the menu), type in the value found in the colum and then click the "bin" radio button. The value will be shown in binary like above (with any leading zeroes stripped out), and you can check which bits are set to 1 against the above table.

Example: Locking both weapon slots (bit 5 and 6 from the right) would require the value 16+32 (0000 0001 0000 + 0000 0010 0000), resulting in the sum 48 (0000 0011 0000), where bits 5 and 6 are set to 1.


Last edited by stoffe -mkb-; 07-25-2006 at 06:12 AM.
stoffe is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Tutorials: .2da Editing > [TSL]Appearance.2da: Locking NPC Equipment slots

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:41 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.