I've used this function plenty of times before but it's just not working in the example provided below.
-----
1. Create a placeable and make it useable. (I'm using the Invisible Object placeable).
2. Set the placeable's TAG to BB_TWR1ABC123.
3. Give your placeable a description "Testing ABC 123".
4. For the placeables OnClick, place the following code:
void main()
{
object oPC = GetPlaceableLastClickedBy();
object oHelp = GetNearestObjectByTag("BB_TWR1ABC123", OBJECT_SELF);
PlaySound("gui_button");
AssignCommand(oPC, ClearAllActions());
// ATTEMPT ONE
SetDescription(GetNearestObjectByTag("BB_TWR1ABC123", OBJECT_SELF),
"Pinned to this part of the bulletin board is a small piece of worn
paper. Seeking skilled locksmith or Weaver. Payment offered. Speak with
the owner of Drips and Brews located on The Narrow Slice.");
// ATTEMPT TWO
SetDescription(oHelp, "Pinned to this part of the bulletin board is a
small piece of worn paper. Seeking skilled locksmith or Weaver. Payment
offered. Speak with the owner of Drips and Brews located on The Narrow
Slice.");
// FORCE EXAMINE THE OBJECT
DelayCommand(0.5, AssignCommand(oPC, ActionExamine(GetNearestObjectByTag("BB_TWR1ABC123", OBJECT_SELF))));
FloatingTextStringOnCreature("DEBUG: FIRED!", oPC);
}
No matter what, the description is never set and I don't know why. I'm missing the obvious somehwere.
Thanks,
FP!
SetDescription troubles
Débuté par
Fester Pot
, août 02 2010 01:28
#1
Posté 02 août 2010 - 01:28
#2
Posté 02 août 2010 - 02:38
I think you are running into the same problem that I had when making a widget to check the properties on a creatures hide. The engine has it own ideas of what the PC can see and not see. It may be that you have an invisibility effect on the creature. Or that the creature is out of range an can not be seen. I would try making the object static with an invisible model and no effects of invis on it. Currently at work so can not check it out myself.
Best of luck
L8
Best of luck
L8
#3
Posté 02 août 2010 - 02:50
Well I dont know why the description is not changed, however if the object will be static, it will behave exactly like this - the object description will be loaded only when PC enters area. But your placeable is useable, so it cannot be static.
Modifié par ShaDoOoW, 02 août 2010 - 02:52 .
#4
Posté 02 août 2010 - 04:43
I'm pretty sure there is an AssignCommand missing.
Try this,
AssignCommand(OBJECT_SELF, SetDescription(OBJECT_SELF, "Your text"));
Try this,
AssignCommand(OBJECT_SELF, SetDescription(OBJECT_SELF, "Your text"));
Modifié par AnAnya, 02 août 2010 - 04:48 .
#5
Posté 02 août 2010 - 06:19
nope this wont change anything. Only difference is that if you add assigncommand setdescription will be postphoned by cca 0.1secAnAnya wrote...
I'm pretty sure there is an AssignCommand missing.
Try this,
AssignCommand(OBJECT_SELF, SetDescription(OBJECT_SELF, "Your text"));
#6
Posté 03 août 2010 - 12:13
You lost me there...nope this wont change anything. Only difference is that if you add assigncommand setdescription will be postphoned by cca 0.1sec
Perhaps I am mistaken, though if the intent was to make the clicking player see the SetDescription string on the placeable they clicked, this script worked for me. As far as I'm aware, I commented out attempt two and added the AssignCommand.
void main()
{
object oPC = GetPlaceableLastClickedBy();
object oHelp = GetNearestObjectByTag("BB_TWR1ABC123", OBJECT_SELF);
PlaySound("gui_button");
AssignCommand(oPC, ClearAllActions());
// ATTEMPT ONE
AssignCommand(OBJECT_SELF, SetDescription( OBJECT_SELF, "Pinned to this part of the bulletin board is a small piece of worn paper. Seeking skilled locksmith or Weaver. Payment offered. Speak with the owner of Drips and Brews located on The Narrow Slice."));
// ATTEMPT TWO
/*SetDescription(oHelp, "Pinned to this part of the bulletin board is a
small piece of worn paper. Seeking skilled locksmith or Weaver. Payment
offered. Speak with the owner of Drips and Brews located on The Narrow
Slice.");*/
// FORCE EXAMINE THE OBJECT
DelayCommand(0.5, AssignCommand(oPC, ActionExamine(GetNearestObjectByTag("BB_TWR1ABC123", OBJECT_SELF))));
FloatingTextStringOnCreature("DEBUG: FIRED!", oPC);
}
I take back that last statement. I also changed GetNearestObjectByTag to OBJECT_SELF.
Modifié par AnAnya, 03 août 2010 - 12:16 .
#7
Posté 03 août 2010 - 07:39
That's really odd that an AssignCommand needs to be placed before the SetDescription but as mentioned, this does work.
Thanks AnAnya and everyone for the guidance. This also work with SetName too for the GetPlaceableLastClickedBy() function.
FP!
Thanks AnAnya and everyone for the guidance. This also work with SetName too for the GetPlaceableLastClickedBy() function.
FP!
#8
Posté 06 août 2010 - 12:13
there must be a catch somwhere, both setname and setdescription works without assign when object_self is module...





Retour en haut







