The quest is simple: place a silk carpet inventory item in a pre-determined spot on the floor and the carpet will appear. To accomplish that, I created an invisible container on the floor which will be destroyed upon successful carpet placement, then I will spawn a bodybag where the placeable used to be.
The pleaceable script (in part) is below:
case EVENT_TYPE_INVENTORY_ADDED:
{
// add IF statement here to ensure that item inserted is
// a silk carpet:
object[] oInventory = GetItemsInInventory(OBJECT_SELF, GET_ITEMS_OPTION_ALL,
0,"gen_im_treas_silcarp");
object oCarpet = GetObjectByTag("gen_im_treas_silcarp");
// IF item is silk carpet
WR_SetPlotFlag(PLT_INTERIOR_DECORATION, CARPET1_PLACED, TRUE);
Safe_Destroy_Object(OBJECT_SELF);
SpawnBodyBag(OBJECT_SELF,TRUE);
break;
}
The problem is twofold. The easy part ought to be determining if the correct item is placed in the container. But while I have tried comparing oInventory and oCarpet, I seem to get weird compiler errors, so I need some way to determine if the case is "true," i.e. if gen_im_treas_silcarp was placed in the container's inventory.
The second problem is harder. Bodybags are defined in APR_base.XLS, and there is no bodybag defined for the placeable (let's call it "spot_on_the_floor".) So how do I create an override of APR_base.XLS without actually changing the file?
Any help (even to tell me this is a stupid idea that will never work) would be appreciated.
Modifié par BillHoyt, 16 avril 2010 - 08:48 .





Retour en haut






