Author Topic: oPC starts conversatiom with themself?  (Read 1668 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #15 on: July 27, 2010, 03:12:52 pm »


               Just tried your scripts ShaDoOow ...but they are not detroying the object either.

Just seen yuor post KooKoo88.. Im not clicking on the object ..Im activating object and spawning the invisobject to automaticly start conversation. I dont want to click on the spawned object to start conversation.Hope I explained it properly.':blink:'
               
               

               


                     Modifié par Knight_Shield, 27 juillet 2010 - 02:17 .
                     
                  


            

Legacy_KooKoo88

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #16 on: July 27, 2010, 03:27:42 pm »


               I see.  I misunderstood.  '<img'>
               
               

               
            

Legacy_KooKoo88

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #17 on: July 27, 2010, 03:47:38 pm »


               Try unclicking the static button.  if that doesn't work, try SetIsDestroyable(TRUE); on it before you destroy it.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #18 on: July 27, 2010, 03:53:34 pm »


               

Knight_Shield wrote...

Just tried your scripts ShaDoOow ...but they are not detroying the object either.

I believe it does, but your placeable is static. Static placeables are loaded once per player when he enters area (which is their advantage, server dont send informations about them to the clients until they reenter area). So it may look your placeable is still there however its not, its destroyed. Try removing static flag, if you see it works then you can set it back and use invisible placeable to totally hide how it works from PC.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #19 on: July 27, 2010, 04:39:50 pm »


               Ok  checked box usable . Did converstion..then left area ..came back in a minute later and still seen it .Should I wait longer?
               
               

               
            

Legacy_KooKoo88

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #20 on: July 27, 2010, 04:44:53 pm »


               Hmmm, nope.  It should be destroyed instantly.



*ponders*
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #21 on: July 27, 2010, 04:46:26 pm »


               Here is the ABort conversation script so far .

void main()
{
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC,"INVISIBLE_SPEAKER");
SetIsDestroyable(TRUE);
DestroyObject(oTarget);
}

I set it to usable to see but not plot .


Just was looking at lexicon ..it says something abut it works better with the Delay function. Does this make sense?
               
               

               


                     Modifié par Knight_Shield, 27 juillet 2010 - 03:56 .
                     
                  


            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #22 on: July 27, 2010, 05:58:02 pm »


               

Knight_Shield wrote...

Here is the ABort conversation script so far .

void main()
{
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC,"INVISIBLE_SPEAKER");
SetIsDestroyable(TRUE);
DestroyObject(oTarget);
}

I set it to usable to see but not plot .


Just was looking at lexicon ..it says something abut it works better with the Delay function. Does this make sense?


Yes, it does. DestroyObject is often better done with a short delay, like this, on a terminal node of the conversation:
  • DelayCommand(2.0,DestroyObject(oTarget));
(EDIT: As lighftoot8 reminded me there's a delay parameter built into the DestroyObject command itself, so you don't need to use DelayCommand. I just checked the Lexicon and discovered that object destruction via DestroyObject automatically waits until the script completes anyway. So the delay precautions I've been taking weren't needed after all. Learn something new every day. '<img'>

When you start a conversation between the PC and a character or object, the conversation's scripts run on that character or object (as OBJECT_SELF). You don't want to run a script that immediately destroys the object that's running the script and the conversation until you give both a chance to end gracefully first.
               
               

               


                     Modifié par AndarianTD, 28 juillet 2010 - 12:39 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #23 on: July 27, 2010, 09:35:40 pm »


               all DestroyObject commands are already delayed. There is not reason for the delay command.

// Destroy oObject (irrevocably).
// This will not work on modules and areas.

void DestroyObject(object oDestroy, float fDelay=0.0f)



But i can see reason to increase the delay to longet then the script just ending.
               
               

               


                     Modifié par Lightfoot8, 27 juillet 2010 - 08:41 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #24 on: July 28, 2010, 03:17:27 am »


               Try this in Abort

void main()
{
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(oPC,"INVISIBLE_SPEAKER");
SendMessageToPC(oPC,"OnConversationAbort script fired, oTarget: "+GetName(oTarget)+", id: "+ObjectToString(oTarget));
DestroyObject(oTarget);
}

and tell us if you get any message
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #25 on: July 28, 2010, 08:22:31 pm »


               Note - If you want the placeable just so you can have a portrait of the npc, eg - to simulate them speaking to you from another area eg  - Telepathy,

You dont need to assign the Conversation command to the player, telling them to converse with the placeable.

You can instead, Do what you were doing originally, then in Toolset, open the area the placeable is in, and then open the conversation.

In the conversation editor, you are able to select the NPC Tag/name from the dropdown, which allows you to select the person who speaks that line.



This is for instances where your conversation may be expected to jump from one npc to another.

However, in this case, you can simply have it set so that the chat lines for your NPC/Placeable, all direct as such, to the placeable.



This way, your player will still assign the conversation command to themselves, to converse with themselves, however, when the conversation begins, they will find that the Placeable will be happy to take over for the Lines it has been assigned.



(I only know this, because I recently had to do this myself.

Eg - Telepathic communication from an NPC in another area - I needed her Portrait to appear in conversation to maintain the effect)
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #26 on: July 28, 2010, 09:38:11 pm »


               Baaleos, yes this is very good solution, im using that for sitting NPCs, however he wanted to start conversation with item in players inventory so I think its not usable there.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #27 on: July 28, 2010, 09:48:13 pm »


               Hmm..that could still work though. Put a placeable in an inaccessible part of the game and that will represent the item that the players activate in the conversation. Beats having to create and destroy objects maybe?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #28 on: July 28, 2010, 09:53:22 pm »


               Well im not sure what is it, but if this item behave like option tool for players, then you need to create/destroy placeable because there may be more than one player in area at once (you cant talk with object that is in conversation). Well I wont guess anymore, lets wait for OP.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #29 on: July 28, 2010, 10:44:40 pm »


               Thanks guys for all the help ..I will try these by the weekend and see what happens.