Jump to content

Home

scripting help please


randydg

Recommended Posts

I am trying to do several things in this script. i want the following:( I know the script bellow is not correct, i just wanted to put what i needed so i could get help)

void main() 
{ 
Player walk to x,y,z
start dlg file ( small greeting dialog)
on end of dlg file all npcs and players walk to x,y,z
once at x,y,z start new dialg.
on end of dialog load:
SetGlobalFadeOut(); 
QueueMovie("HypMov01")
QueueMovie("NarMov01")
PlayMovieQueue(TRUE);
Load "301nar";

Link to comment
Share on other sites

no help on this? actualy i need it changed a little bit

 

void main() 
{ 
Player walk to x,y,z from x,y,z
start dlg file ( small greeting dialog)
on end of dlg file all npcs and players walk to x,y,z
once at x,y,z start new dialg.
on end of dialog load:
SetGlobalFadeOut(); 
QueueMovie("HypMov01")
QueueMovie("NarMov01")
PlayMovieQueue(TRUE);
Load "modfile";

 

can anyone help me fix this code? i know some of it is right but the top part not sure how to script that.

thanks.

Link to comment
Share on other sites

no help on this? actualy i need it changed a little bit

(snip)

can anyone help me fix this code? i know some of it is right but the top part not sure how to script that.

thanks.

 

It would certainly help to be a bit more specific if you expect to get any meaningful help with this. That description didn't leave much to work with. :)

 

Anyway, here's a quick take on a skeleton script from what you described. You'll have to change the coordinates and facings of the locations, and tags of the NPCs to talk with.

 

You'd need to make it into 3 scripts and not just one (or, if you must have it as one script, use dialog parameters to divide it into 3 separate paths of execution).

 

 

The first script. Make player move from lStart to lDest and start conversation between player and oTalker.

 

void main() {
   object oPC      = GetFirstPC();
   object oTalker  = GetObjectByTag("Tag_of_NPC_to_Converse_with");
   location lStart = Location(Vector(0.0, 0.0, 0.0), 0.0);
   location lDest  = Location(Vector(0.0, 0.0, 0.0), 0.0);

   // ST: Position player at starting position
   AssignCommand(oPC, JumpToLocation(lStart));

   // ST: Make player move to destination position
   AssignCommand(oPC, ActionForceMoveToLocation(lDest));

   // ST: Make talking NPC start conversation with player
   AssignCommand(oPC, ActionStartConversation(oTalker));
}

 

The second script, fired at end of the dialog started above. Make all NPCs move to lDest, then start dialog between player and oTalker.

 

void main() {
   location lDest  = Location(Vector(0.0, 0.0, 0.0), 0.0);
   object oTalker  = GetObjectByTag("Tag_of_NPC_to_Converse_with");

   // Make all NPCs walk to the destination location.
   object oNPC = GetFirstObjectInArea();
   while (GetIsObjectValid(oNPC)) {
       AssignCommand(oNPC, ActionForceMoveToLocation(lDest));
       oNPC = GetNextObjectInArea();
   }

   // Start conversation with player.
   AssignCommand(oTalker, ActionStartConversation(GetFirstPC()));
}

 

The third script, fired at end of the dialog started above. Fade, play movies and do module transition.

 

void main() {
   // Fade out and stay faded during movies and area transition.
   SetGlobalFadeOut();
   SetFadeUntilScript();

   // Play movie fils.
   QueueMovie("HypMov01")
   QueueMovie("NarMov01")
   PlayMovieQueue(TRUE);   

   // Move to another module.
   StartNewModule("modfile");
}

Link to comment
Share on other sites

Did you specified what lDest is or did you left the coordinates to 0.00 ? You could also make the pc move towards the npc if you don't want to use fixed coordinates:

 

Just replace this line:

   location lDest  = Location(Vector(0.0, 0.0, 0.0), 0.0);

 

by this one:

   AssignCommand(oPC, ActionForceMoveToObject(oTalker));

Link to comment
Share on other sites

Did you specified what lDest is or did you left the coordinates to 0.00 ? You could also make the pc move towards the npc if you don't want to use fixed coordinates:

 

Just replace this line:

   location lDest  = Location(Vector(0.0, 0.0, 0.0), 0.0);

 

by this one:

   AssignCommand(oPC, ActionForceMoveToObject(oTalker));

 

yes, for the location idest i have:

 

  location lDest  = Location(Vector(x,y,z), 0.0);

 

replace the x,y,z with the cords i put in. i left the last 2 0's

Link to comment
Share on other sites

void main() { 
object oPC = GetFirstPC(); 
object oTalker = GetObjectByTag("lucas"); 
AssignCommand(oPC, ActionForceMoveToObject(oTalker)); 
// ST: Make talking NPC start conversation with player 
AssignCommand(oPC, ActionStartConversation(oTalker)); 
}

 

This is what i have and it still doesn't walk the pc to the npc but it does start the converation. this script is in the onenter= part of the are file.

Link to comment
Share on other sites

void main() { 
object oPC = GetFirstPC(); 
object oTalker = GetObjectByTag("lucas"); 
AssignCommand(oPC, ActionForceMoveToObject(oTalker));

// AssignCommand(oPC, ActionStartConversation(oTalker));
}

 

the script will make you walk to them if you leave off the conversation part of the script but as soon as you add back in the conversation part it starts the dialog from the start and not walk. i even tried the noclicks thing and that did't work.

Link to comment
Share on other sites


void main() {
object oPC = GetFirstPC();
object oTalker = GetObjectByTag("lucas");
AssignCommand(oPC, ActionForceMoveToObject(oTalker));
DelayCommand(13.0, ActionStartConversation(oTalker));
}
[/Code]

 

I tried this out in a dialogue situation with Kreia just quickly and I don't know if it does what you would like, because it is in a dialogue and not starting a dialogue, but the player certainly walks towards the NPC. I'll test it out in a different situation but for now... it should work. I'm no scripting genius like the others who have replied to your thread above me but if I can help I will.

 

Edit: I tried it out by having it as an end dialogue on a console I spawned in and it works. Adjust the 13.0 to the time you want.

Link to comment
Share on other sites

This should work without having to specify a delay:

 

void main() { 
object oPC = GetFirstPC(); 
object oTalker = GetObjectByTag("lucas"); 
AssignCommand(oPC, ActionForceMoveToObject(oTalker));
[b]ActionDoCommand[/b](oPC, ActionStartConversation(oTalker));
}

 

ActionDoCommand will insert the action in the action queue. Otherwise, other actions will be executed immediately.

Link to comment
Share on other sites

Darth333:

That comes back with a compile error:

 

C:\Program Files\la\swkotor2\override>compile -c -g 2 autowalkntalk.nss

Lookup path root set to: C:\Program Files\la\SWKotOR2\

Loaded nwscript.nss via key file lookup

Compiling: autowalkntalk.nss

autowalkntalk.nss(5): Error: Type mismatch in parameter 1 in call to "ActionDoCommand"

Compilation aborted with errors

Total Execution time = 40 ms

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...