Author Topic: SetDescription troubles  (Read 652 times)

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
SetDescription troubles
« on: August 02, 2010, 02:28:07 pm »


               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!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
SetDescription troubles
« Reply #1 on: August 02, 2010, 03:38:35 pm »


               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    

               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
SetDescription troubles
« Reply #2 on: August 02, 2010, 03:50:34 pm »


               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 .
                     
                  


            

Legacy_AnAnya

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
SetDescription troubles
« Reply #3 on: August 02, 2010, 05:43:37 pm »


               I'm pretty sure there is an AssignCommand missing.

Try this,

AssignCommand(OBJECT_SELF, SetDescription(OBJECT_SELF, "Your text"));
               
               

               


                     Modifié par AnAnya, 02 août 2010 - 04:48 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
SetDescription troubles
« Reply #4 on: August 02, 2010, 07:19:40 pm »


               

AnAnya wrote...

I'm pretty sure there is an AssignCommand missing.

Try this,

AssignCommand(OBJECT_SELF, SetDescription(OBJECT_SELF, "Your text"));

nope this wont change anything. Only difference is that if you add assigncommand setdescription will be postphoned  by cca 0.1sec
               
               

               
            

Legacy_AnAnya

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
SetDescription troubles
« Reply #5 on: August 03, 2010, 01:13:25 am »


               

nope this wont change anything. Only difference is that if you add assigncommand setdescription will be postphoned  by cca 0.1sec

 You lost me there...'Posted

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 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
SetDescription troubles
« Reply #6 on: August 03, 2010, 08:39:25 pm »


               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!
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
SetDescription troubles
« Reply #7 on: August 06, 2010, 01:13:31 pm »


               there must be a catch somwhere, both setname and setdescription works without assign when object_self is module...