Problems with clothing

I don't know if this topic has already been discussed; I have no time to browse all this forum and the search function has given me nothing useful. There are some problems I noticed with wearable items.
a) Layers and slots are not taken into account; I can wear anything over anything else and remove garments without removing higher layers first.
b) In inventory, an item that is worn appears with a "(worn)" after its name. I'd want to modify it (i.e., it has to be translated in Italian) or remove it completely.
c) Even if I disable the "removeable" option I can remove the item.
d) Even if I remove all display and inventory verbs from a wearable item, when I click on it in the inventory it shows some verbs; in my interface I need inventory to be a simple list, because I put all commands elsewhere.

Thanks.


a) Layers and slots are not taken into account; I can wear anything over anything else and remove garments without removing higher layers first.
c) Even if I disable the "removeable" option I can remove the item.

This should not happen. Can you share an example game so we can see the problem?

b) In inventory, an item that is worn appears with a "(worn)" after its name. I'd want to modify it (i.e., it has to be translated in Italian) or remove it completely.

In the file Italiano.aslx (the language pack) there should be a line:
<template name="wornmodifier">whatever the Italian word for "worn" is</template>
This seems to be missing for the Italian one.

d) Even if I remove all display and inventory verbs from a wearable item, when I click on it in the inventory it shows some verbs; in my interface I need inventory to be a simple list, because I put all commands elsewhere.

You mean like if you set:
JS.eval("verbButtonCount = 0")
?


Regarding a) and c): may it be because I make my player wear and remove things by script, using functions WearGarment() and RemoveGarment() instead of verbs "wear" and "remove"? Shouldn't these functions take into account layers and slots as well? (I can't share my game; at the moment it's an utter mess with many other things I have to fix.)
Regarding b): Yeah, The Pixie himself said Italian language pack is not complete. I could contribute to it, if I knew where to put my hands.
Regarding d): I didn't think to that javascript command. I'll try it; right now, all I have done is removing display and inventory verbs from any object I create. This is not working. Verbs for garments keep appearing when I select them in the inventory, and don't disappear when I select something else.


Solved d) by creating a function that is been called every time I update my interface (i.e., every turn and whenever I enter a room); it gets an object as parameter and does this:

doomedVerbs = NewStringList()
if (obj.inventoryverbs <> null) {
  foreach (dVerb, obj.inventoryverbs) {
    list add (doomedVerbs, dVerb)
  }
  foreach (dVerb, doomedVerbs) {
    list remove (obj.inventoryverbs, dVerb)
  }
}

(damn this foreach glitch that compels me to use two loops.)


I'm not sure why you need 2 loops. In that case, it might be easier just to do obj.inventoryverbs = NewStringList().

Or if you're using the desktop version of Quest, it would be possible to override the function GetDisplayVerbs to return an empty list right away if the object is in your inventory.

Alternatively, overriding the function _SetVerbsForGarment could prevent the clothing library from adding verbs.

Regarding a) and c): may it be because I make my player wear and remove things by script, using functions WearGarment() and RemoveGarment() instead of verbs "wear" and "remove"? Shouldn't these functions take into account layers and slots as well?

No. Those functions allow you to override normal checks; because an event where an NPC forces you to wear an item (for example) normally wouldn't want to back off and force you to adjust your clothing before continuing. If you want to test the garment (and give an error message if the slot is already full, for example) you want to use the functions _DoWear() and _DoRemove().


2 loops are needed because of the glitch reported here, i.e. you can't modify a list inside a foreach loop referring to the same list. Overriding these functions would require more code, I think; this loop is simple enough. I was unsure about setting it to a NewStringList() because it's a built-in attribute, but it worked, and that's simplier.
Do _DoWear() and _DoRemove() take the same parameter as WearGarment() and RemoveGarment()?


No, you don't need 2 loops.
obj.inventoryverbs = NewStringList() does the same thing without using a loop at all.


Agreed. What I meant was: before trying to use obj.inventoryverbs = NewStringList() and finding it successful, the only choice I had was using the double loop. Have pity on me; too many times I can't phrase my concepts the way I'd want to.


(I have used the double loop method before, in a situation where simply replacing the list with an empty one wouldn't work. Not really relevant, but you might be interested to know there's still a more efficient way to do it in one loop:

while (ListCount(somelist) > 0) {
  list remove (items, ListItem(items, 0))
}

This can also be tweaked to only remove some items from a list:

i = 0
while (ListCount(somelist) > i) {
  item = ListItem(somelist, i)
  if (ShouldIRemoveThis(item)) {
    list remove (somelist, item)
  }
  else {
    i = i + 1
  }
}

)


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums