Author Topic: NPC walks to a chair where they will sit and converse with PC  (Read 583 times)

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0


               I would like the following:
1. the PC's mother enters their room
2. tells them that they'd like to sit at the table for a conversation
3. walks to their chair
4. sits
5. initiates conversation with the PC

I can get everything up to 4, but then the NPC was actively sitting so they would not intiate the conversation. So I adjusted the scripts so that they walk up to their chair then intiate conversation, but the onconversation script tells them to sit down. All that works ok except for the fact that the NPC runs away from tehir chair toward the PC to start the conversation, and then sometimes walks back to their chair to sit.

I have created the following scripts to handle this. The first is the scene script, a script which programs the NPC to do the 1-3, and 5. The second is their OnConversation event which tells them to do 4 the moment conversation begins. But as I said above the NPC runs toward the PC to initiate the conversation which is precisely what I would like to avoid.

Scene Script (Snippet)
DelayCommand( 3.0, AssignCommand( oMother, ActionMoveToLocation(lDoorway) ) );
DelayCommand( 4.5, AssignCommand(oPC, PlaySound("as_sw_genericlk1")) );
DelayCommand( 4.5, AssignCommand( oMother, ActionSpeakString(q+"Hello, son. Please join me at the table. I want to talk."+q) ) );
DelayCommand( 5.5, AssignCommand( oMother, ActionMoveToLocation(GetLocation(oChair)) ) );
DelayCommand( 8.5, AssignCommand( oMother, ActionStartConversation(oPC) ) );

OnConversation Event (Snippet)
int nChair = 1;
string sMyTagName = GetTag(OBJECT_SELF);
string sSittableTagName = "chair_" + sMyTagName;
object oChair = GetNearestObjectByTag(sSittableTagName, OBJECT_SELF, nChair);
if (nMatch == -1){
   if (GetCommandable(OBJECT_SELF))
   {
      ClearActions(CLEAR_NW_C2_DEFAULT4_29);
      BeginConversation();
      ActionSit(oChair);
}

--note: no matter how many times I try to color the text it just don't ****g work. These boards really suck.
               
               

               


                     Modifié par henesua, 09 avril 2011 - 02:43 .
                     
                  


            

Legacy_Ryuhi2000

  • Full Member
  • ***
  • Posts: 159
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #1 on: April 09, 2011, 03:50:46 am »


               

henesua wrote...
--note: no matter how many times I try to color the text it just don't ****g work. These boards really suck.


remember these boards are provided free by bioware for a game out of devlopment for like 3 years that they dont even support that game or its sequel anymore so what if some cool flashy stuff like color text might not always work?
               
               

               


                     Modifié par Ryuhi2000, 09 avril 2011 - 03:01 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #2 on: April 09, 2011, 04:04:41 am »


               Ryuhi, your point is taken, but the same problem exists in the Dragon Age portion of the forum too. And it is very difficult to read the code if it blends in with the rest of the post. Granted these forums are not geared towards developers, but come on its just text formatting. It should work.
               
               

               


                     Modifié par henesua, 09 avril 2011 - 03:07 .
                     
                  


            

Legacy_Ryuhi2000

  • Full Member
  • ***
  • Posts: 159
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #3 on: April 09, 2011, 04:34:09 am »


               

henesua wrote...

Ryuhi, your point is taken, but the same problem exists in the Dragon Age portion of the forum too. And it is very difficult to read the code if it blends in with the rest of the post. Granted these forums are not geared towards developers, but come on its just text formatting. It should work.


your point is also taken but rememebr the forums are free and usualy free forums have bugs like that in them from my personal experience as a web developer which i started learning 5 years ago when i was a sophmore in highschool.

and i would say the easiest end user workaround if it doesn't work the proper way  to rectify that would be throw a [ q u o t e ] around it and a [  / q u o t e ] i myself just figured out how to do this on here but i keep forgeting to most of the time but without spacing i just had it so you would be able to see the bbcode for it.

btw color works for me on quick reply you just need to click the icon to the left of the eraser after selecting the section you want displayed in a different color 

edit: ok i see what you mean it shows up as having green on my screen around a few works i picked then on the displayed post it does not have color
               
               

               


                     Modifié par Ryuhi2000, 09 avril 2011 - 03:35 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #4 on: April 09, 2011, 04:38:50 am »


               Question: What Object is the first code snipit running on ? Is it oMother?
I see no reason for all the delay commands.  It would be better to just place all the actions into the action Que of oMother.
When you give your  ActionStartConversation(oPC) to oMother it is going to fire the OnConversation Event, It appeares you know that part, But nMatch will equal -1 at that point since the event did not fire from a listening pattern. There is a good chance there to clear your action command to sit.   I would advoid the ActionStartConversation all together and use StartConversation(oPC)  Instead. 
It also would not hurt to make her uncommandable during all of this to Protect the Que from being cleared. 
Following snippet assumes that the script is running on oMother.

 

ActionMoveToLocation(lDoorway);
ActionDoCommand(AssignCommand(oPC, PlaySound("as_sw_genericlk1")) );
ActionSpeakString(q+"Hello, son. Please join me at the table. I want to talk."+q);
ActionMoveToLocation(GetLocation(oChair);
ActionDoCommand(BeginConversation(oPC));
ActionSit(oChair);
ActionDoCommand(SetCommandable(TRUE);
SetCommandable(FALSE);
 


use [ color=####] [  /color]    where #### =    color code

A lot of the color names also work like
Cornflower Blue

or

 deep pink 
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #5 on: April 09, 2011, 04:42:32 am »


               You got me wondering about what names work and wich ones don't.  So here is a quick test of all the names on the list.  

I will remove this from your thread upon request if you feel it clutters it up.

EDIT: added the numbers also for when the color name does not work.

Number   #000000   Name    Black
Number   #150517   Name    Gray0
Number   #250517   Name    Gray18
Number   #2B1B17   Name    Gray21
Number   #302217   Name    Gray23
Number   #302226   Name    Gray24
Number   #342826   Name    Gray25
Number   #34282C   Name    Gray26
Number   #382D2C   Name    Gray27
Number   #3b3131   Name    Gray28
Number   #3E3535   Name    Gray29
Number   #413839   Name    Gray30
Number   #41383C   Name    Gray31
Number   #463E3F   Name    Gray32
Number   #4A4344   Name    Gray34
Number   #4C4646   Name    Gray35
Number   #4E4848   Name    Gray36
Number   #504A4B   Name    Gray37
Number   #544E4F   Name    Gray38
Number   #565051   Name    Gray39
Number   #595454   Name    Gray40
Number   #5C5858   Name    Gray41
Number   #5F5A59   Name    Gray42
Number   #625D5D   Name    Gray43
Number   #646060   Name    Gray44
Number   #666362   Name    Gray45
Number   #696565   Name    Gray46
Number   #6D6968   Name    Gray47
Number   #6E6A6B   Name    Gray48
Number   #726E6D   Name    Gray49
Number   #747170   Name    Gray50
Number   #736F6E   Name    Gray
Number   #616D7E   Name    SlateGray4
Number   #657383   Name    SlateGray
Number   #646D7E   Name    LightSteelBlue4
Number   #6D7B8D   Name    LightSlateGray
Number   #4C787E   Name    CadetBlue4
Number   #4C7D7E   Name    DarkSlateGray4
Number   #806D7E   Name    Thistle4
Number   #5E5A80   Name    MediumSlateBlue
Number   #4E387E   Name    MediumPurple4
Number   #151B54   Name    MidnightBlue
Number   #2B3856   Name    DarkSlateBlue
Number   #25383C   Name    DarkSlateGray
Number   #463E41   Name    DimGray
Number   #151B8D   Name    CornflowerBlue
Number   #15317E   Name    RoyalBlue4
Number   #342D7E   Name    SlateBlue4
Number   #2B60DE   Name    RoyalBlue
Number   #306EFF   Name    RoyalBlue1
Number   #2B65EC   Name    RoyalBlue2
Number   #2554C7   Name    RoyalBlue3
Number   #3BB9FF   Name    DeepSkyBlue
Number   #38ACEC   Name    DeepSkyBlue2
Number   #357EC7   Name    SlateBlue
Number   #3090C7   Name    DeepSkyBlue3
Number   #25587E   Name    DeepSkyBlue4
Number   #1589FF   Name    DodgerBlue
Number   #157DEC   Name    DodgerBlue2
Number   #1569C7   Name    DodgerBlue3
Number   #153E7E   Name    DodgerBlue4
Number   #2B547E   Name    SteelBlue4
Number   #4863A0   Name    SteelBlue
Number   #6960EC   Name    SlateBlue2
Number   #8D38C9   Name    Violet
Number   #7A5DC7   Name    MediumPurple3
Number   #8467D7   Name    MediumPurple
Number   #9172EC   Name    MediumPurple2
Number   #9E7BFF   Name    MediumPurple1
Number   #728FCE   Name    LightSteelBlue
Number   #488AC7   Name    SteelBlue3
Number   #56A5EC   Name    SteelBlue2
Number   #5CB3FF   Name    SteelBlue1
Number   #659EC7   Name    SkyBlue3
Number   #41627E   Name    SkyBlue4
Number   #737CA1   Name    SlateBlue
Number   #737CA1   Name    SlateBlue
Number   #98AFC7   Name    SlateGray3
Number   #F6358A   Name    VioletRed
Number   #F6358A   Name    VioletRed1
Number   #E4317F   Name    VioletRed2
Number   #F52887   Name    DeepPink
Number   #E4287C   Name    DeepPink2
Number   #C12267   Name    DeepPink3
Number   #7D053F   Name    DeepPink4
Number   #CA226B   Name    MediumVioletRed
Number   #C12869   Name    VioletRed3
Number   #800517   Name    Firebrick
Number   #7D0541   Name    VioletRed4
Number   #7D0552   Name    Maroon4
Number   #810541   Name    Maroon
Number   #C12283   Name    Maroon3
Number   #E3319D   Name    Maroon2
Number   #F535AA   Name    Maroon1
Number   #FF00FF   Name    Magenta
Number   #F433FF   Name    Magenta1
Number   #E238EC   Name    Magenta2
Number   #C031C7   Name    Magenta3
Number   #B048B5   Name    MediumOrchid
Number   #D462FF   Name    MediumOrchid1
Number   #C45AEC   Name    MediumOrchid2
Number   #A74AC7   Name    MediumOrchid3
Number   #6A287E   Name    MediumOrchid4
Number   #8E35EF   Name    Purple
Number   #893BFF   Name    Purple1
Number   #7F38EC   Name    Purple2
Number   #6C2DC7   Name    Purple3
Number   #461B7E   Name    Purple4
Number   #571B7e   Name    DarkOrchid4
Number   #7D1B7E   Name    DarkOrchid
Number   #842DCE   Name    DarkViolet
Number   #8B31C7   Name    DarkOrchid3
Number   #A23BEC   Name    DarkOrchid2
Number   #B041FF   Name    DarkOrchid1
Number   #7E587E   Name    Plum4
Number   #D16587   Name    PaleVioletRed
Number   #F778A1   Name    PaleVioletRed1
Number   #E56E94   Name    PaleVioletRed2
Number   #C25A7C   Name    PaleVioletRed3
Number   #7E354D   Name    PaleVioletRed4
Number   #B93B8F   Name    Plum
Number   #F9B7FF   Name    Plum1
Number   #E6A9EC   Name    Plum2
Number   #C38EC7   Name    Plum3
Number   #D2B9D3   Name    Thistle
Number   #C6AEC7   Name    Thistle3
Number   #EBDDE2   Name    LavenderBlush2
Number   #C8BBBE   Name    LavenderBlush3
Number   #E9CFEC   Name    Thistle2
Number   #FCDFFF   Name    Thistle1
Number   #E3E4FA   Name    Lavender
Number   #FDEEF4   Name    LavenderBlush
Number   #C6DEFF   Name    LightSteelBlue1
Number   #ADDFFF   Name    LightBlue
Number   #BDEDFF   Name    LightBlue1
Number   #E0FFFF   Name    LightCyan
Number   #C2DFFF   Name    SlateGray1
Number   #B4CFEC   Name    SlateGray2
Number   #B7CEEC   Name    LightSteelBlue2
Number   #52F3FF   Name    Turquoise1
Number   #00FFFF   Name    Cyan
Number   #57FEFF   Name    Cyan1
Number   #50EBEC   Name    Cyan2
Number   #4EE2EC   Name    Turquoise2
Number   #48CCCD   Name    MediumTurquoise
Number   #43C6DB   Name    Turquoise
Number   #9AFEFF   Name    DarkSlateGray1
Number   #8EEBEC   Name    DarkSlateGray2
Number   #78c7c7   Name    DarkSlateGray3
Number   #46C7C7   Name    Cyan3
Number   #43BFC7   Name    Turquoise3
Number   #77BFC7   Name    CadetBlue3
Number   #92C7C7   Name    PaleTurquoise3
Number   #AFDCEC   Name    LightBlue2
Number   #3B9C9C   Name    DarkTurquoise
Number   #307D7E   Name    Cyan4
Number   #3EA99F   Name    LightSeaGreen
Number   #82CAFA   Name    LightSkyBlue
Number   #A0CFEC   Name    LightSkyBlue2
Number   #87AFC7   Name    LightSkyBlue3
Number   #82CAFF   Name    SkyBlue
Number   #79BAEC   Name    SkyBlue2
Number   #566D7E   Name    LightSkyBlue4
Number   #6698FF   Name    SkyBlue
Number   #736AFF   Name    LightSlateBlue
Number   #CFECEC   Name    LightCyan2
Number   #AFC7C7   Name    LightCyan3
Number   #717D7D   Name    LightCyan4
Number   #95B9C7   Name    LightBlue3
Number   #5E767E   Name    LightBlue4
Number   #5E7D7E   Name    PaleTurquoise4
Number   #617C58   Name    DarkSeaGreen4
Number   #348781   Name    MediumAquamarine
Number   #306754   Name    MediumSeaGreen
Number   #4E8975   Name    SeaGreen
Number   #254117   Name    DarkGreen
Number   #387C44   Name    SeaGreen4
Number   #4E9258   Name    ForestGreen
Number   #347235   Name    MediumForestGreen
Number   #347C2C   Name    SpringGreen4
Number   #667C26   Name    DarkOliveGreen4
Number   #437C17   Name    Chartreuse4
Number   #347C17   Name    Green4
Number   #348017   Name    MediumSpringGreen
Number   #4AA02C   Name    SpringGreen
Number   #41A317   Name    LimeGreen
Number   #4AA02C   Name    SpringGreen
Number   #8BB381   Name    DarkSeaGreen
Number   #99C68E   Name    DarkSeaGreen3
Number   #4CC417   Name    Green3
Number   #6CC417   Name    Chartreuse3
Number   #52D017   Name    YellowGreen
Number   #4CC552   Name    SpringGreen3
Number   #54C571   Name    SeaGreen3
Number   #57E964   Name    SpringGreen2
Number   #5EFB6E   Name    SpringGreen1
Number   #64E986   Name    SeaGreen2
Number   #6AFB92   Name    SeaGreen1
Number   #B5EAAA   Name    DarkSeaGreen2
Number   #C3FDB8   Name    DarkSeaGreen1
Number   #00FF00   Name    Green
Number   #87F717   Name    LawnGreen
Number   #5FFB17   Name    Green1
Number   #59E817   Name    Green2
Number   #7FE817   Name    Chartreuse2
Number   #8AFB17   Name    Chartreuse
Number   #B1FB17   Name    GreenYellow
Number   #CCFB5D   Name    DarkOliveGreen1
Number   #BCE954   Name    DarkOliveGreen2
Number   #A0C544   Name    DarkOliveGreen3
Number   #FFFF00   Name    Yellow
Number   #FFFC17   Name    Yellow1
Number   #FFF380   Name    Khaki1
Number   #EDE275   Name    Khaki2
Number   #EDDA74   Name    Goldenrod
Number   #EAC117   Name    Gold2
Number   #FDD017   Name    Gold1
Number   #FBB917   Name    Goldenrod1
Number   #E9AB17   Name    Goldenrod2
Number   #D4A017   Name    Gold
Number   #C7A317   Name    Gold3
Number   #C68E17   Name    Goldenrod3
Number   #AF7817   Name    DarkGoldenrod
Number   #ADA96E   Name    Khaki
Number   #C9BE62   Name    Khaki3
Number   #827839   Name    Khaki4
Number   #FBB117   Name    DarkGoldenrod1
Number   #E8A317   Name    DarkGoldenrod2
Number   #C58917   Name    DarkGoldenrod3
Number   #F87431   Name    Sienna1
Number   #E66C2C   Name    Sienna2
Number   #F88017   Name    DarkOrange
Number   #F87217   Name    DarkOrange1
Number   #E56717   Name    DarkOrange2
Number   #C35617   Name    DarkOrange3
Number   #C35817   Name    Sienna3
Number   #8A4117   Name    Sienna
Number   #7E3517   Name    Sienna4
Number   #7E2217   Name    IndianRed4
Number   #7E3117   Name    DarkOrange3
Number   #7E3817   Name    Salmon4
Number   #7F5217   Name    DarkGoldenrod4
Number   #806517   Name    Gold4
Number   #805817   Name    Goldenrod4
Number   #7F462C   Name    LightSalmon4
Number   #C85A17   Name    Chocolate
Number   #C34A2C   Name    Coral3
Number   #E55B3C   Name    Coral2
Number   #F76541   Name    Coral
Number   #E18B6B   Name    DarkSalmon
Number   #F88158   Name    [color=Salmon1]Salmon1[/color]
Number   #E67451   Name    [color=Salmon2]Salmon2[/color]
Number   #C36241   Name    [color=Salmon3]Salmon3[/color]
Number   #C47451   Name    [color=LightSalmon3]LightSalmon3[/color]
Number   #E78A61   Name    [color=LightSalmon2]LightSalmon2[/color]
Number   #F9966B   Name    LightSalmon
Number   #EE9A4D   Name    SandyBrown
Number   #F660AB   Name    HotPink
Number   #F665AB   Name    [color=HotPink1]HotPink1[/color]
Number   #E45E9D   Name    [color=HotPink2]HotPink2[/color]
Number   #C25283   Name    [color=HotPink3]HotPink3[/color]
Number   #7D2252   Name    [color=HotPink4]HotPink4[/color]
Number   #E77471   Name    LightCoral
Number   #F75D59   Name    [color=IndianRed1]IndianRed1[/color]
Number   #E55451   Name    [color=IndianRed2]IndianRed2[/color]
Number   #C24641   Name    [color=IndianRed3]IndianRed3[/color]
Number   #FF0000   Name    Red
Number   #F62217   Name    [color=Red1]Red1[/color]
Number   #E41B17   Name    [color=Red2]Red2[/color]
Number   #F62817   Name    [color=Firebrick1]Firebrick1[/color]
Number   #E42217   Name    [color=Firebrick2]Firebrick2[/color]
Number   #C11B17   Name    [color=Firebrick3]Firebrick3[/color]
Number   #FAAFBE   Name    Pink
Number   #FBBBB9   Name    [color=RosyBrown1]RosyBrown1[/color]
Number   #E8ADAA   Name    [color=RosyBrown2]RosyBrown2[/color]
Number   #E7A1B0   Name    [color=Pink2]Pink2[/color]
Number   #FAAFBA   Name    LightPink
Number   #F9A7B0   Name    [color=LightPink1]LightPink1[/color]
Number   #E799A3   Name    [color=LightPink2]LightPink2[/color]
Number   #C48793   Name    [color=Pink3]Pink3[/color]
Number   #C5908E   Name    [color=RosyBrown3]RosyBrown3[/color]
Number   #B38481   Name    RosyBrown
Number   #C48189   Name    [color=LightPink3]LightPink3[/color]
Number   #7F5A58   Name    [color=RosyBrown4]RosyBrown4[/color]
Number   #7F4E52   Name    [color=LightPink4]LightPink4[/color]
Number   #7F525D   Name    [color=Pink4]Pink4[/color]
Number   #817679   Name    [color=LavenderBlush4]LavenderBlush4[/color]
Number   #817339   Name    [color=LightGoldenrod4]LightGoldenrod4[/color]
Number   #827B60   Name    [color=LemonChiffon4]LemonChiffon4[/color]
Number   #C9C299   Name    [color=LemonChiffon3]LemonChiffon3[/color]
Number   #C8B560   Name    [color=LightGoldenrod3]LightGoldenrod3[/color]
Number   #ECD672   Name    [color=LightGolden2]LightGolden2[/color]
Number   #ECD872   Name    LightGoldenrod
Number   #FFE87C   Name    [color=LightGoldenrod1]LightGoldenrod1[/color]
Number   #ECE5B6   Name    [color=LemonChiffon2]LemonChiffon2[/color]
Number   #FFF8C6   Name    LemonChiffon
Number   #FAF8CC   Name    LightGoldenrodYellow
               
               

               


                     Modifié par Lightfoot8, 09 avril 2011 - 05:14 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #6 on: April 09, 2011, 06:11:52 am »


               For the record, my color tags were getting wiped in that post and I'm not clear why. It looks like you discovered the same weirdness, Ryuhi.

Thanks for the help, Lightfoot8. The first script is running on oPC because the script creates oMother. Does that matter?

With regards to where I put the code in the OnConversation script: I think you found my problem. I didn't pay close attention to the entire OnConversation script. I'll dig into that more carefully tomorrow. I suspect that that is the best way to solve this problem.

I will also try your code to see if it helps me crack this problem from a different angle.

BTW, the delays are important because they allow me to precisely control the pacing of the scene and thus how it feels. BeginConversation() does not seem to work in DelayCommand(). I assume that is why you have a problem with my using them.  Is there a way to control the timing of actions without using DelayCommand()?
               
               

               


                     Modifié par henesua, 09 avril 2011 - 05:13 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #7 on: April 09, 2011, 06:37:07 am »


               As soon as one action finishes the next one starts.  So with the script running on oMother non of the actions that are are for her will not need to be assigned.  since most of them run on her, It would be better for the script to run on her. It cuts down on a lot of overhead.  

I also find it eaiser to time out actions over delayed command.  With delayed command you are always guessing at how long it will take someone to get somewhere.   Since the next action in the Que does not happen untill the one before it is done, they are eaiser to time.  If you have two NPC to controll, well just place all of the actions of one of the NPC into to others action Que as ActionDoCommand(AssignCommand(oNpc2, Action to do).  That  way you have one director who has the critical timming.   The last thing you place in your action que is the ActionDoCommand(SetCommandable(TRUE)); to have the NPC return himself back to a commandable state after he finishes alll of his actions.  

You place a SetComandable(FALSE); in the script after the actionQue is loaded to make sure nothing clears out the Que.   This line is in the script after the ActionDoCommand (SetCommandable(TRUE));  but will be exicuted befor the script finishes running.  Where the action will be ran as the last action in the Que.  

As far a fine timming the action.  You add ActionWait( fDelay); Between any actions you want a pause between.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #8 on: April 10, 2011, 12:13:22 am »


               The big difference between your code and mine, Lightfoot8, was use of BeginConversation() instead of ActionStartConversation(). However BeginConversation() does not meet the parameters of an "action". So I have the following problem:

This line:
        
ActionDoCommand(BeginConversation("gc_mother",oPC));


Results in:
        ERROR: DECLARATION DOES NOT MATCH PARAMETERS

As soon as I remove the wrapping function ActionDoCommands() and let BeginConversation() stand on its own there the script compiles. However, at that point it is not part of the action Queue as far as I can tell. ActionStartConversation() seems to be the only action that I can use for initiating conversation and that often results in the NPC running toward the PC. I'll have to look into solving that particular problem elsewhere. Perhaps changing my OnConversation script, or delving into the conversation file itself to see if it is causing the running action through one of the default attached scripts.

-- by the way: the editor window keeps dropping my formatting. Anytime you jump between BBCode and WYSIWYG it drops some bbcode.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #9 on: April 10, 2011, 12:20:55 am »


               Screw it. I'll just change the scene. She'll run up to you to request that you join her at the table then sit down.

I'll just write this off as another quirk of NWN.

However the ActionWait() does enable me to time the actions in the scene the way I want them to play out. Thanks for that suggestion. Its much less tedious than delaying every command.
               
               

               


                     Modifié par henesua, 09 avril 2011 - 11:23 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #10 on: April 10, 2011, 01:46:23 am »


               Sorry I never noticed that  the function returned anything.    To get it to work you just need a wraper around the function so that it does not return anything.  Instead of making one you can do something like this.  It looks dumb but it works.

 ActionDoCommand( SetLocalInt(OBJECT_SELF,"DD",BeginConversation("gc_mother",oPC)) );

Yes the SetLocalInt is only there for a warpper on the function.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #11 on: April 10, 2011, 01:58:42 am »


               Interesting. I've since changed the way I am orchestrating the scene however.

Your mother enters, approaches you, then initiates conversation.
If you are at the table sitting, she joins you.
else, she asks you to join her at the table.
if you agree to sit at the table, a script directs you both to sit at the table and resume conversation, otherwise conversation continues where she first engages you.

It feels more natural. The trick is to keep the conversation active while you both sit. I'm currently trying pause and resume.
               
               

               


                     Modifié par henesua, 10 avril 2011 - 12:59 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NPC walks to a chair where they will sit and converse with PC
« Reply #12 on: April 10, 2011, 02:41:49 am »


                Yeah. Works well. I have to pause the conversation until just before your mother sits instead of after, but its close enough for jazz.
Here's the script fired from the conversation:

[color="#00ff00"]    object oPC          =   GetPCSpeaker();
    object oArea        =   GetArea(oPC);
    object oMother      =   OBJECT_SELF;
    object oChairMa     =   GetObjectByTag("chair_mother");
    object oChairPC     =   GetObjectByTag("chair_pc");
    ActionPauseConversation();
    ActionMoveToLocation(GetLocation(oChairMa));
    AssignCommand(oPC, ActionWait(2.0));
    ActionResumeConversation();
    ActionSit(oChairMa);
    AssignCommand(oPC, ActionMoveToLocation(GetLocation(oChairPC)));
    AssignCommand(oPC, ActionSit(oChairPC));[/color]

               
               

               


                     Modifié par henesua, 10 avril 2011 - 01:42 .