// plcbl_onuse
/*
So far i have noted that, if inventory open to invy panel that the
book is in, examine of book is correct.
I also noticed you can Read description of placeable, so we may be able to
change description based on book with SetDescription() / GetDescription()
functions. All though this brings up the string length issue. It Worked..
*/
void main()
{
object oTome_plc =OBJECT_SELF;
object oPC = GetLastUsedBy();
//reset var
SetLocalObject(oPC,"le_item046",oPC);
//Define book
object oBook = CreateItemOnObject("le_item046", oPC);
SetLocalString(oPC,"Book",GetTag(oBook));
SetLocalObject(oPC,"le_item046",oBook);
// possible discreption fix...
//string sBook_Dis=GetDescription(oBook,TRUE,TRUE);
string sBook_Dis = GetDescription(oBook,TRUE,FALSE);
SetDescription(oTome_plc,sBook_Dis);
// give text
FloatingTextStringOnCreature("You blow the dust off the cover as you pick up the journal.", oPC, TRUE);
// Examine place ....
AssignCommand(oPC,ClearAllActions(TRUE));
AssignCommand(oPC,ActionExamine(oTome_plc));
// with this, makes pc read book via ExecuteScript still resulted in blank window
//AssignCommand(oPC,ClearAllActions(TRUE));
//DelayCommand(1.0,AssignCommand(oPC,ExecuteScript("pcread_bk",oPC)));
// destroy placeable
DelayCommand(1.0,DestroyObject(OBJECT_SELF, 0.0));
}
Ok here is result of work. Just one script. I commented the issues that i had found. A little strange the blank happens always if no invy open, or if invy open to tab other then the one the book is in. if inv opened and tab the one book is put in when created the examin is correct. I hadn't noticed this when I tested the early script.
This new script uses get/set discription it gets discript from book and sets it on the placeable, then you get your floaty text, and you examine getting book discription...no blank window
This is a work around, I will keep looking into why this happens. As I said in above comments of script I am able to examine book and get book discript if inventory open and on tab book is in Strange I never noticed it, probly because I was droping old books making sure it only examined new book
Modifié par Greyfort, 15 juin 2011 - 11:09 .