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

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« on: July 27, 2010, 12:20:34 am »


               Here is my script to start conversation with memorycrystal.

#include "x2_inc_switches"
void main()
{
object oPC;
oPC = GetItemActivator();
//The PC will technically start a conversation with himself
//You should add some odd little sound to the first line in the
//conversation file, or the PC will give his normal voicegreeting.
object oTarget;
oTarget = oPC;
AssignCommand(oTarget, ActionStartConversation(oPC, "memorycrystal"));
}
I added sound oPc wont say hello to them seld but the text box that appears has player name ..

My question is ..how do I actually have the conversation with the item instead of oPC themself?'Posted
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #1 on: July 27, 2010, 12:39:50 am »


               you must create invisible placeable under PC and assign conversation to it (you will want to rename its name)

btw that placeable may be static, yet is good idea to destroy it when pc exits conversation
               
               

               


                     Modifié par ShaDoOoW, 26 juillet 2010 - 11:40 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #2 on: July 27, 2010, 02:49:51 am »


               Ok got it to work here it is.

void main()
{
object oPC;
object oTarget;
object oSpawn;
location lTarget;
oPC = GetItemActivator();
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "invisobj001", lTarget);
AssignCommand(oTarget, ActionStartConversation(oSpawn, "memorycrystal"));
}

How do I destroy the object now ?'Posted
               
               

               


                     Modifié par Knight_Shield, 27 juillet 2010 - 01:50 .
                     
                  


            

Legacy_Knight_Shield

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


               Maybe a DelayCommand?
               
               

               
            

Legacy_Shadooow

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


               Its called OnAbortConversation event, but its hidden very well '<img'>



open conversation, in right down corner there are actions for given line, and there is hidden one more "Current File" you must use > arrow near Coments.



Now there is Normal and Aborted field



make new script in aborted which will destroy nearest "invisobj001" and you are fine. (Well might be better to store oSpawn into local variable on player)
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #5 on: July 27, 2010, 04:15:09 am »


               ':blush:'
void main()
{
object oPC = GetPCSpeaker();
object oTarget;
oTarget = GetNearestObjectByTag("invisible");
DestroyObject(oTarget, 0.0);
}

This look good to you ?
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #6 on: July 27, 2010, 04:26:28 am »


               EDIT: ':whistle:'

void main()
{
object oPC = GetPCSpeaker();
object oTarget = GetNearestObjectByTag("invisible", oPC);
DestroyObject(oTarget, 0.0);
}

You left out one of the parameters for GetNearestObjectByTag. Needed oPC in there.
               
               

               


                     Modifié par GhostOfGod, 27 juillet 2010 - 03:30 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #7 on: July 27, 2010, 04:42:59 am »


               Thank you very much ..I can cut n paste pretty good but making scripts or using the gen I dont do to good.'Posted
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #8 on: July 27, 2010, 04:49:57 am »


               Activate:

void main()
{
object oTarget = GetItemActivator();
object oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "invisobj001", GetLocation(oTarget));
SetLocalObject(oTarget,"INVISIBLE_SPEAKER",oSpawn);
AssignCommand(oTarget, ActionStartConversation(oSpawn, "memorycrystal"));
}


Abort:

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

getnearest will work too, but there is possible gap in script which could do mess...
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #9 on: July 27, 2010, 04:54:59 am »


               Question:  If in the On Actvate script he had oSpawn start the conversation with oTarget(the PC ) would he be able to then just destroy OBJECT_SELF from the conversation?



               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #10 on: July 27, 2010, 05:13:08 am »


               

Lightfoot8 wrote...

Question:  If in the On Actvate script he had oSpawn start the conversation with oTarget(the PC ) would he be able to then just destroy OBJECT_SELF from the conversation?


I was kinda thinking that too. Should just be able to use if that got changed?:

void main()
{
DestroyObject(OBJECT_SELF);
}

I think.
               
               

               


                     Modifié par GhostOfGod, 27 juillet 2010 - 04:14 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
oPC starts conversatiom with themself?
« Reply #11 on: July 27, 2010, 05:25:04 am »


               

Lightfoot8 wrote...

Question:  If in the On Actvate script he had oSpawn start the conversation with oTarget(the PC ) would he be able to then just destroy OBJECT_SELF from the conversation?

yea good point
               
               

               
            

Legacy_Knight_Shield

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


               OK guys *grabs the football* which way do I run?
               
               

               
            

Legacy_Knight_Shield

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


               Yeah with my last script in place it is not destroying static object which i made something different so I could see if it was disappearing or not ...so need more help
               
               

               
            

Legacy_KooKoo88

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


               This is a placeable, yes?

Go to properties, In the advanced tab, put the conversation you want.  Make the placeable useable.  In the script tab, go to the 'On Used' event and add this script:

void main()
{
object oPC = GetLastUsedBy();
ActionStartConversation(oPC);
PlaySound("al_mg_crystalnt1");
}

That should work the way you want it to. The placeable will start its conversation and most don't have a default hello, so you should be fine. (writing this at work, so if I make a mistake, I apologize)
The sound is a neutral magic crystal.  You can look in the Lexicon for other sounds.  You can also place the sound on the first thread of the conversation in the other actions tab. '<img'>

good gaming.  'Posted
               
               

               


                     Modifié par KooKoo88, 27 juillet 2010 - 02:01 .