Forgewright wrote:Is there a simple way to have the clothes be (worn) at game start and have the inventory pane show them as (worn)?
The DoWear function in the library sets several attributes when an object is worn:
object.worn = True
object.original_drop = object.drop --- the attribute original_drop is created here
object.original_alias = object.alias --- the attribute original_alias is created here
object.drop = false
object.display = GetDisplayName(object) --- the attribute original_display is created here
object.alias = GetDisplayAlias(object) + " (worn)" <-------------This is what you are missing.
(And I was just wondering how to create attributes by script)
So if you set all those at the start, plus putting it in the players inventory, it should be the same as if the object was put on.
I stuck this in the game start script and it seems to work perfectly:
object = pants <----or whatever clothing item you have
AddToInventory (object)
object.worn = True
object.original_drop = object.drop
object.original_alias = object.alias
object.drop = false
object.display = GetDisplayName(object)
object.alias = GetDisplayAlias(object) + " (worn)"
Or I guess you could set them manually.
Or make that a function with a REALLY long name, to be called from the game start script:
<function name="Silent_Initialization_of_Wear_Mode_Bypassing_Wear_Slot_Checks_for_Single_Wearable_Object" parameters="object">
AddToInventory (object)
object.worn = True
object.original_drop = object.drop
object.original_alias = object.alias
object.drop = false
object.display = GetDisplayName(object)
object.alias = GetDisplayAlias(object) + " (worn)"
</function>
In the start script, for each item:
Silent_Initialization_of_Wear_Mode_Bypassing_Wear_Slot_Checks_for_Single_Wearable_Object (boxer_shorts)
Etc.