v2.3
=Fixed a significant bug where you could not wear something if a non-wearable item was in your inventory.
v2.2
=Fixed an issue where the custom remove message doesn't play if the item cannot be removed.
v2.1
=Fixed an issue of an error being thrown when trying to wear something that is not wearable. It never occurred to me someone would try to wear like.. I dunno, a briefcase.
v2.0
+Rewrite
+Added wear layer support
-Known: Not compatible with v1.0 (shouldn't be a big issue)
v1.4
=Fixed an issue with wearing multiple blank items (should make it quicker too)
=Fixed the issue with wearing items without aliases
=Was some minor code cleanup, should most other issues that cropped up in v1.03
v1.3
+Added configurable wear/remove messages
-Removed redundant events
v1.2
+Added Event Handlers
+Fixed drop bug
v1.1
+Fixed a small typo, should work now.
v1.0
=Initial Release
foreach(item, ScopeReachableInventory()) {
if(item.worn = true and HasAttribute(item,"wear_slots")) {
foreach(item, ScopeReachableInventory()) {
if (HasAttribute(item,"worn")and HasAttribute(item,"wear_slots")){
if(item.worn = true) {
if(GetBoolean(item, "worn") = true and HasAttribute(item,"wear_slots")) {
if(GetBoolean(item, "worn") and HasAttribute(item,"wear_slots")) {
jaynabonne wrote:Is the "= true" part actually necessary for a boolean value? "if (((x = true) = true) = true)" ad infinitum
On Wearing an item
If the item is not wearable, print an error message telling the player off. Then exit the function.
If the item is already worn, print an error message telling the player off. Then exit the function.
For every item in the inventory,
check if the item is wearable,
if so, check if it is on an equal or higher layer to what we are trying to wear,
if so, check if any of its wear locations match the item we are trying to wear,
if so, then print an error message telling the player off and exit the function.
(if not continue to next item)
If there are no conflicts with anything else the player is wearing then,
print a message telling the player the item is now worn,
update the inventory title of the item to show its worn,
run any scripts on the item in question.
On Removing an item
If the item is not wearable, print an error message telling the player off. Then exit the function.
If the item is not worn, print an error message telling the player off. Then exit the function.
If the item is cursed, print an error message telling the player off. Then exit the function.
For every item in the inventory,
check if the item is worn,
if so, check if it is on a higher layer to what we are trying to remove,
if so, check if any of its wear locations match the item we are trying to remove,
if so, then print an error message telling the player off and exit the function.
(if not continue to next item)
If there are no conflicts with anything else the player is wearing then,
print a message telling the player the item has been removed,
update the inventory title of the item back to its original title,
run any scripts on the item in question.
rfrijhoff wrote:It seems that the wearable library only works with 'player', but not with other created actors (player or not). If i'm doing something wrong, please tell me, otherwise can and will you fix this problem?
DoEquip:
if (HasScript(object, "onafterwear")) {
do(object, "onafterwear")
} else if(HasString(object, "onafterwear")) {
msg(object.onafterwear)
}
DoRemove:
if (HasScript(object, "onafterremove")) {
do(object, "onafterremove")
} else if(HasString(object, "onafterremove")) {
msg(object.onafterremove)
}
Tags for being able to use the Editor:
<control>
<mustinherit>wearable</mustinherit>
<selfcaption>After wearing the object</selfcaption>
<controltype>multi</controltype>
<attribute>onafterwear</attribute>
<types>null=None; string=Text; script=Run script</types>
<editors>string=textbox</editors>
<expand/>
</control>
<control>
<mustinherit>wearable</mustinherit>
<selfcaption>After removing the object</selfcaption>
<controltype>multi</controltype>
<attribute>onafterremove</attribute>
<types>null=None; string=Text; script=Run script</types>
<editors>string=textbox</editors>
<expand/>
</control>
Error running script: Error compiling expression 'not object.parent = player or not object.worn or not object.removeable': NotElement: Operation not defined for type 'Object'
in Quest 5.3 the object 'player' is replaced with 'game.pov' so if you are working with Q 5.3 or higher replace 'player' with 'game.pov'
Grainger wrote:Hmmm... while I'm at it: is there a way to expand "wearables" to have special attributes, such as armor points or some such? I'd like to add up all the armor points eventually
Originally, I had thought I could make a new object type "armor" that derives from "wearable", but that seems to be stretching Quest a bit...
<type name="equipment_object_type">
// equip, unequip, etc functionality code lines
</type>
<type name="two_handed_object_type">
<attr name="equipment_slots" type="simplestringlist">left_hand;right_hand</attr>
</type>
<type name="sword_object_type">
<inherit name="equipment_object_type" />
<attr name="physical_damage" type="int">50</attr>
<attr name="attack_rating" type="int">25</attr>
</type>
<object name="claymore_sword_1">
<inherit name="sword_object_type" />
<inherit name="two_handed_object_type" />
<alias>claymore</alias>
</object>
Silver wrote:There's currently an error in its present state as I explained in the post above. If you ask to remove an item you're not wearing it prints an ugly game error instead of simply saying 'you're not wearing *object*'.
> take boots
You pick them up.
> remove boots
You can't remove them.
Silver wrote:... So your example may not reproduce the problem (I haven't tried it yet, but I will) because the player IS the parent even though the object isn't being worn. ...
> drop boots
You drop them.
> remove boots
You can't remove them.
Grainger wrote:
I don't know why, but it seems to work anyways:
> drop boots
You drop them.
> remove boots
You can't remove them.
That's more or less what I'd expect.
Not sure it's my fix or just a different version of the library.
Silver wrote:Ok tried that and it hasn't fixed anything.
... I'm talking about the player trying to remove something that they are neither carrying and isn't wearable. In fact they can't even pick it up. But they may try to 'remove' it in a different sense. But instead of the game saying "You're not wearing it" or similar, it says:
Error running script: Error compiling expression 'not object.parent = game.pov or not object.worn or not object.removeable': NotElement: Operation not defined for type 'Object'
Which is a bug. I'm now thinking it might just be easier to set it up using commands as it's not imperative that the wearables library handles this in my game. I just happened to be testing it out when I started writing this so kept it in.
Silver wrote:Anyone know how I remove a library from the game? Please say it can be done!
<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="wearables.aslx" />
<include ref="LiftLib5-4.aslx" />
<game name="...">
if (not object.parent = player or not GetBoolean(object, "worn") or not GetBoolean(object, "removeable")) {
You need to compare numbers not strings, as you have a greater than in there, so:
if (player.weight_as_int >= 10) {
What I would do is change the command in the library to check for size, and have two new attributes on each garment, one naming the attribute, "weight" in this case, the other the maximum value, 10. It might go like this:
handled = false
if (HasString(garment, "size_attribute") and HasInt(garment, "size_value")) {
if (GetInt(player, garment.size_attribute + "_as_int") >= garment.size_value) {
msg ("<br/>You simply cannot fit into this at the moment.<br/>")
handled = true
}
}
if (not handled) {
msg("You put it on")
garment.worn = true
}
I have not looked in the wearables library, you will need to adapt that code to fit the existing code (for example, changing garment to whatever it is called in the library).
You will also need to check the effect on clothing when the player changes size...
<object name="player">
<attr name="inventory" type="simpleobjectlist">object1;object2;object3</attr>
// or (if I remember the vertical format~syntax correctly, lol):
<attr name="inventory" type="objectlist">
<value>object1</value>
<value>object2</value>
<value>etc etc</value>
</attr>
</object>
list add (ScopeInventory(), fists)
list remove (ScopeInventory(), fists)
list add (ScopeInventory(), knife)
list remove (ScopeInventory(), knife)
list add (ScopeInventory(), machete)
list remove (ScopeInventory(), machete)
list add (ScopeInventory(), fire_spellbook)
list remove (ScopeInventory(), fire_spellbook)
list add (ScopeInventory(), shirt)
list remove (ScopeInventory(), shirt)
if (player.weight>="obese") {
List remove (ScopeInventory(), plain_black_shirt)
msg ("You're too big to wear this!")
}
// And that will remove the "worn" status?
HegemonKhan wrote:the 'player's inventory' is an Objectlist Attribute called 'inventory':
(as code scripting, it looks like this, I think):
player.inventory = split ("object1, object2, etc", ";") ...
object1.parent = player
if (object1.parent = player) {
objectlist = GetDirectChildren(player)
if (player.weight_as_int>=1) {
list remove (ScopeInventory(), plain_black_shirt)
msg ("You're too big to wear this!")
plain_black_shirt.worn = false
}
The problem with the code is that it is testing for size too late. You need the alias update and the putting-on message inside the if block.
if (player.weight_as_int>=1) {
list remove (ScopeInventory(), plain_black_shirt)
plain_black_shirt.worn = false
msg ("You're too big to wear this!")
}
I guess the problem is that the item is not actually getting its "worn" attribute set to true because something is failing between changing the alias and setting the flag. You may have to look inside the library file to find where that is. There is probable a "wear" script in there you can search for, or maybe a line like this:
this.alias = this.alias + " (worn)"
The problem with the code is that it is testing for size too late. You need the alias update and the putting-on message inside the if block.
The problem is on the "Wearables Library" is that the only place I can put code is in the "Wearables Tab", in the "After Wearing" space, because you can change it to a script. The script I have now is...
if (player.weight_as_int>=1) {
list remove (ScopeInventory(), plain_black_shirt)
plain_black_shirt.worn = false
msg ("You're too big to wear this!")
}
So if this has to be put in "Before Worn" space, I'm not sure where that would be. Any suggestions?
<library>
<!--
Chase's Wearables Library v2.3
Based on: Pixie's Clothing Library (originally)
You may edit this library however you please.
I decided to include a UI, since not having a UI kinda bugged me.
v1.01
-Fixed a typo
v1.02
+Added Event Handlers
+Fixed drop bug
v1.03
+Added configurable wear/remove messages
-Removed redundant events
v1.04
=Fixed an issue with wearing multiple blank items
=Fixed the issue with wearing items without aliases
v2.0
=Rewritten to better support base systems, may have broken older usages
+Added wear layer support
v2.1
=Fixed an issue of an error being thrown when trying to wear something that is not wearable.
v2.2
=Fixed an issue where the custom remove message doesn't play if the item cannot be removed.
v2.3
=Fixed a significant bug where you could not wear something if a non-wearable item was in your inventory.
Chase
chasesan@gmail.com
-->
<dynamictemplate name="WearSuccessful">"You put " + object.article + " on."</dynamictemplate>
<dynamictemplate name="WearUnsuccessful">"You can't wear " + object.article + "."</dynamictemplate>
<dynamictemplate name="AlreadyWearing">"You are already wearing " + object.article + "."</dynamictemplate>
<dynamictemplate name="CannotWearOver">"You cannot wear that over " + object.display + "."</dynamictemplate>
<dynamictemplate name="CannotWearWith">"You cannot wear that while wearing " + object.display + "."</dynamictemplate>
<dynamictemplate name="RemoveSuccessful">"You take " + object.article + " off."</dynamictemplate>
<dynamictemplate name="RemoveUnsuccessful">"You can't remove " + object.article + "."</dynamictemplate>
<dynamictemplate name="RemoveFirst">"You can't remove that while wearing "+object.display+"."</dynamictemplate>
<template name="Wear">Wear</template>
<verbtemplate name="wear">wear</verbtemplate>
<verbtemplate name="wear">put on</verbtemplate>
<template name="Remove">Remove</template>
<verbtemplate name="remove">remove</verbtemplate>
<verbtemplate name="remove">take off</verbtemplate>
<command name="wear" template="wear">
<multiple>
return (ScopeInventory())
</multiple>
<script>
foreach (obj, object) {
DoWear(obj)
}
</script>
</command>
<command name="remove" template="remove">
<multiple>
return (ScopeInventory())
</multiple>
<script>
foreach (obj, object) {
DoRemove(obj)
}
</script>
</command>
<function name="DoWear" parameters="object"><![CDATA[
if(not HasAttribute(object,"worn")) {
msg (DynamicTemplate("WearUnsuccessful", object))
} else if (object.parent = player and object.worn = true) {
msg (DynamicTemplate("AlreadyWearing", object))
} else if (not ListContains(ScopeInventory(), object)) {
msg (DynamicTemplate("WearUnsuccessful", object))
} else {
isLayerProblem = false
conflictedItem = null
if(HasAttribute(object,"wear_slots")) {
foreach(item, ScopeReachableInventory()) {
if(HasAttribute(item,"wear_slots")) {
if(item.worn = true) {
foreach(itemSlot,item.wear_slots) {
if(ListContains(object.wear_slots,itemSlot)) {
if(object.wear_layer < item.wear_layer) {
conflictedItem = item
isLayerProblem = true
} else if(object.wear_layer = item.wear_layer) {
conflictedItem = item
}
}
}
}
}
}
}
if(conflictedItem = null) {
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)"
if(object.wearmsg = null) {
msg (DynamicTemplate("WearSuccessful",object))
} else {
msg(object.wearmsg)
}
//do after
if (HasScript(object, "onafterwear")) {
do(object, "onafterwear")
} else if(HasString(object, "onafterwear")) {
msg(object.onafterwear)
}
} else if(isLayerProblem = true) {
msg(DynamicTemplate("CannotWearOver",conflictedItem))
} else {
msg(DynamicTemplate("CannotWearWith",conflictedItem))
}
}
]]></function>
<function name="DoRemove" parameters="object"><![CDATA[
if (not object.parent = player or not object.worn or not object.removeable) {
if(object.removemsg = null) {
msg (DynamicTemplate("RemoveUnsuccessful",object))
} else {
msg (object.removemsg)
}
} else {
conflictedItem = null
//check if we are wearing anything over it
if(HasAttribute(object,"wear_slots")) {
foreach(item, ScopeReachableInventory()) {
if(HasAttribute(item,"wear_slots")) {
if(item.worn = true) {
foreach(itemSlot,item.wear_slots) {
if(ListContains(object.wear_slots,itemSlot)) {
if(object.wear_layer < item.wear_layer) {
conflictedItem = item
}
}
}
}
}
}
}
if(conflictedItem = null) {
if(object.removemsg = null) {
msg (DynamicTemplate("RemoveSuccessful",object))
} else {
msg(object.removemsg)
}
object.worn = false
object.drop = object.original_drop
object.alias = object.original_alias
object.original_drop = null
object.original_alias = null
object.display = null
//do after
if (HasScript(object, "onafterremove")) {
do(object, "onafterremove")
} else if(HasString(object, "onafterremove")) {
msg(object.onafterremove)
}
} else {
msg (DynamicTemplate("RemoveFirst", conflictedItem))
}
}
]]></function>
<type name="wearable">
<worn type="boolean">false</worn>
<removeable type="boolean">true</removeable>
<wear_layer type="int">2</wear_layer>
<inventoryverbs type="listextend">[Wear];[Remove]</inventoryverbs>
</type>
<!-- Interface -->
<tab>
<parent>_ObjectEditor</parent>
<caption>Wearable</caption>
<mustnotinherit>editor_room; defaultplayer</mustnotinherit>
<control>
<controltype>title</controltype>
<caption>Wearable</caption>
</control>
<control>
<controltype>dropdowntypes</controltype>
<caption>Can be worn?</caption>
<types>*=Cannot be worn; wearable=Can be worn</types>
<width>150</width>
</control>
<control>
<mustinherit>wearable</mustinherit>
<controltype>checkbox</controltype>
<attribute>removeable</attribute>
<caption>Removeable?</caption>
</control>
<control>
<mustinherit>wearable</mustinherit>
<controltype>number</controltype>
<caption>Wear Layer</caption>
<attribute>wear_layer</attribute>
</control>
<control>
<mustinherit>wearable</mustinherit>
<caption>Wear Slot</caption>
<controltype>list</controltype>
<attribute>wear_slots</attribute>
<editprompt>Please enter the name for the wear location</editprompt>
</control>
<control>
<mustinherit>wearable</mustinherit>
<controltype>label</controltype>
<caption>If two objects have the same wear location, they will not be able to be worn at a same time. Any number items without wear locations can be worn.</caption>
<advanced/>
</control>
<!-- snip -->
<control>
<mustinherit>wearable</mustinherit>
<controltype>textbox</controltype>
<attribute>wearmsg</attribute>
<caption>Message to print when wearing (leave blank for default)</caption>
<nullable/>
</control>
<control>
<mustinherit>wearable</mustinherit>
<controltype>textbox</controltype>
<attribute>removemsg</attribute>
<caption>Message to print when removing or trying to remove (leave blank for default)</caption>
<nullable/>
</control>
<!-- Event Handlers from here down none/text/scripts -->
<control>
<mustinherit>wearable</mustinherit>
<controltype>title</controltype>
<caption>After Wearing</caption>
</control>
<control>
<mustinherit>wearable</mustinherit>
<selfcaption>After wearing the object</selfcaption>
<controltype>multi</controltype>
<attribute>onafterwear</attribute>
<types>null=None; string=Text; script=Run script</types>
<editors>string=textbox</editors>
<expand/>
</control>
<control>
<mustinherit>wearable</mustinherit>
<controltype>title</controltype>
<caption>After Removing</caption>
</control>
<control>
<mustinherit>wearable</mustinherit>
<selfcaption>After removing the object</selfcaption>
<controltype>multi</controltype>
<attribute>onafterremove</attribute>
<types>null=None; string=Text; script=Run script</types>
<editors>string=textbox</editors>
<expand/>
</control>
</tab>
</library>
if(conflictedItem = null) {
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)"
if(object.wearmsg = null) {
msg (DynamicTemplate("WearSuccessful",object))
} else {
msg(object.wearmsg)
}
//do after
if (HasScript(object, "onafterwear")) {
do(object, "onafterwear")
} else if(HasString(object, "onafterwear")) {
msg(object.onafterwear)
}
} else if(isLayerProblem = true) {
msg(DynamicTemplate("CannotWearOver",conflictedItem))
} else {
msg(DynamicTemplate("CannotWearWith",conflictedItem))
}
if(conflictedItem = null) {
if(object.removemsg = null) {
msg (DynamicTemplate("RemoveSuccessful",object))
} else {
msg(object.removemsg)
}
object.worn = false
object.drop = object.original_drop
object.alias = object.original_alias
object.original_drop = null
object.original_alias = null
object.display = null
//do after
if (HasScript(object, "onafterremove")) {
do(object, "onafterremove")
} else if(HasString(object, "onafterremove")) {
msg(object.onafterremove)
}
} else {
msg (DynamicTemplate("RemoveFirst", conflictedItem))
}
the bigger problem is between neonayon's usage of it, in figuring out what's going wrong for her in trying to use it for her game, and~or possibly her using any of my erroneous code that has messed up her game even worse from working as it should with Chase's Library, my apologies neonayon and Pixie for any code trouble I've caused with neonayon trying to get this fixed up.
if (player.weight_as_int>=1) {
list remove (ScopeInventory(), plain_black_shirt)
plain_black_shirt.worn = false
msg ("You're too big to wear this!")
plain_black_shirt.alias = Replace(plain_black_shirt.alias, " (worn)", "")
}
doesn't allow you to remove the item, and then be able to drop it. So it can't be dropped or removed now! Almost there. I think it's because we have this...
{if plain_black_shirt.worn:You can't drop it.{once: You have to "<i>Remove</i>" it before you can drop it.}} {if plain_black_shirt.worn:You carelessly toss the black shirt away.}
on the "drop verb"
<function name="DoWear" parameters="object"><![CDATA[
if(not HasAttribute(object,"worn")) {
msg (DynamicTemplate("WearUnsuccessful", object))
<function name="DoWear" parameters="object"><![CDATA[
player.toobigforitem = false
if (HasScript(object, "testplayersize")) {
do(object, "testplayersize")
}
if (player.toobigforitem) {
if (HasString(object, "toobigtowearmsg")) {
msg (object.toobigtowearmsg)
}
else {
msg("You try to put on the " + GetDisplayName(object) + " but it just won't fit!")
}
} else if(not HasAttribute(object,"worn")) {
msg (DynamicTemplate("WearUnsuccessful", object))
<function name="SizeCheck"><![CDATA[
foreach (object, ScopeInventory()) {
if (HasScript(object, "testplayersize")) {
player.toobigforitem = false
do (object, "testplayersize")
if (player.toobigforitem) {
if (HasString(object, "grewtoobigmsg")) {
msg (object.grewtoobigmsg)
}
else {
msg ("The " + Replace(object.alias, " (worn)", "") + " you are wearing is too small for you! It rips to shreds.")
}
destroy (object.name)
}
}
}
]]></function>
if (player.buttsize_as_int > 5) {
player.toobigforitem = true
}
if (player.buttsize_as_int > 5) {
player.toobigforitem = true
}
if (player.bustsize_as_int > 9) {
player.toobigforitem = true
}
if (player.has_a_tail) {
player.toobigforitem = true
}
foreach (object, ScopeInventory()) {
if (HasScript(object, "testplayersize")) {
player.toobigforitem = false
do (object, "testplayersize")
if (player.toobigforitem) {
if (HasString(object, "grewtoobigmsg")) {
msg (object.grewtoobigmsg)
}
else {
msg ("The " + Replace(object.alias, " (worn)", "") + " you are wearing is too small for you! It rips to shreds.")
}
destroy (object.name)
}
}
}
foreach (object, ScopeInventory()) {
if (HasScript(object, "testplayersize")) {
player.toobigforitem = false
do (object, "testplayersize")
}
if (player.toobigforitem) {
if (HasString(object, "grewtoobigmsg")) {
msg (object.grewtoobigmsg)
}
else {
msg ("The " + Replace(object.alias, " (worn)", "") + " you are wearing is too small for you! It rips to shreds.")
}
destroy (object.name)
}
}
Now for any garment you want to check the size of, add a script called "testplayersize", and in that script, set player.toobigforitem to true if the player is too fat or whatever. So a script might look like this:
if (player.buttsize_as_int > 5) {
player.toobigforitem
}
foreach (object, ScopeInventory()) {
if (HasScript(object, "testplayersize")) {
player.toobigforitem = false
do (object, "testplayersize")
}
if (player.toobigforitem) {
if (HasString(object, "grewtoobigmsg")) {
msg (object.grewtoobigmsg)
}
else {
msg ("The " + Replace(object.alias, " (worn)", "") + " you are wearing is too small for you! It rips to shreds.")
}
destroy (object.name)
}
}
player.toobigforitem = false
if (HasScript(object, "testplayersize")) {
do (object, "testplayersize")
}
if (player.toobigforitem) {
if (HasString(object, "toobigtowearmsg")) {
msg (object.toobigtowearmsg)
}
else if ("You try to put on the " + GetDisplayName(object) + " but it just won't fit!") {
}
}
else if (not HasAttribute(object,"worn")) {
msg (DynamicTemplate("WearUnsuccessful", object))
}
else {
isLayerProblem = false
conflictedItem = null
if (HasAttribute(object,"wear_slots")) {
foreach (item, ScopeReachableInventory()) {
if (HasAttribute(item,"wear_slots")) {
if (GetBoolean(item, "worn")) {
foreach (itemSlot, item.wear_slots) {
if (ListContains(object.wear_slots,itemSlot)) {
if (object.wear_layer < item.wear_layer) {
conflictedItem = item
isLayerProblem = true
}
else if (object.wear_layer = item.wear_layer) {
conflictedItem = item
Neonayon wrote:A couple problems are happening...Now for any garment you want to check the size of, add a script called "testplayersize", and in that script, set player.toobigforitem to true if the player is too fat or whatever. So a script might look like this:
if (player.buttsize_as_int > 5) {
player.toobigforitem
}
Maybe I wasn't sure what you said but I went to the attribute of the plain_black_shirt, made testplayersize and then made it a script...
if (player.buttsize_as_int > 1) {
player.toobigforitem
}
but this error happened.
Error running script: Function not found: 'player.toobigforitem'
Neonayon wrote:foreach (object, ScopeInventory()) {
if (HasScript(object, "testplayersize")) {
player.toobigforitem = false
do (object, "testplayersize")
if (player.toobigforitem) {
if (HasString(object, "grewtoobigmsg")) {
msg (object.grewtoobigmsg)
}
else {
msg ("The " + Replace(object.alias, " (worn)", "") + " you are wearing is too small for you! It rips to shreds.")
}
destroy (object.name)
}
}
}
You were missing a } underneath this line <i>do (object, "testplayersize")</i> In case anyone else wanted to use this! ^_^
But other than that, the entire script seems to be running. I just need to test it!
It becomes this.foreach (object, ScopeInventory()) {
if (HasScript(object, "testplayersize")) {
player.toobigforitem = false
do (object, "testplayersize")
}
if (player.toobigforitem) {
if (HasString(object, "grewtoobigmsg")) {
msg (object.grewtoobigmsg)
}
else {
msg ("The " + Replace(object.alias, " (worn)", "") + " you are wearing is too small for you! It rips to shreds.")
}
destroy (object.name)
}
}
I am going to disagree with this one. The two functions I tested fairly well before posting, and they worked okay. The way you have arranged it, if the current item has no script, but the previous item i the list was too small, the current one will be treated as being too small too.
You said a couple of errors; was there something else?
<function name="leveling_function">
if (game.pov.experience >= game.pov.level * 100 + 100) {
game.pov.experience = game.pov.experience - (game.pov.level * 100 + 100)
game.pov.level = game.pov.level + 1
leveling_function
}
</function>
<function name="leveling_function">
if (player.experience >= player.level * 100 + 100) {
player.experience = player.experience - (player.level * 100 + 100)
player.level = player.level + 1
leveling_function
}
</function>