Anyway to explain I have a book placeable that when a player clicks on will add a relevant book item into their inventory. The book placeable then destroys itself as if it had been picked up. This I got working fine, however I also wanted the Examine Window to pop up automatically so that the player could start to read the books description, ie the text written on the pages. Now I get the examine window popping up but for some reason it is totally blank and is not displaying the descriptive text of the book the PC has only just aquired.
Now does anybody have any insight as to why this might be? I will include my script which is on the OnUsed handle of the Book placeable.
void main()
{
object oPC = GetLastUsedBy();
CreateItemOnObject("le_item046", oPC);
FloatingTextStringOnCreature("You pick up the dusty tome and open the cover", oPC, TRUE);
ActionWait(2.0);
AssignCommand(oPC, ActionExamine(GetItemPossessedBy(oPC, "LE_ITEM046")));
DestroyObject(OBJECT_SELF, 0.0);
}
Revised Script that works.
void main()
{
object oTome = OBJECT_SELF;
object oPC = GetLastUsedBy();
object oBook = CreateItemOnObject("le_item046", oPC);
string sBookDis = GetDescription(oBook, TRUE, FALSE);
//Add description of oBook to oTome.
SetDescription(oTome, sBookDis);
//Floating Text above oPC
FloatingTextStringOnCreature
("You blow dust off the cover as you pick up the journal.", oPC, TRUE);
// Examine oTome
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, DelayCommand(1.0, ActionExamine(oTome)));
// Destroy oTome
DelayCommand(2.0, DestroyObject(OBJECT_SELF, 0.0));
}
Modifié par Grieyls, 16 juin 2011 - 03:31 .





Retour en haut






