randydg Posted December 3, 2005 Share Posted December 3, 2005 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 More sharing options...
randydg Posted December 3, 2005 Author Share Posted December 3, 2005 Also would like to know how to give a player starting clothes without the player having to pick some up. where a certin clothes/armor was already worn. Link to comment Share on other sites More sharing options...
randydg Posted December 7, 2005 Author Share Posted December 7, 2005 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 More sharing options...
stoffe Posted December 7, 2005 Share Posted December 7, 2005 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 More sharing options...
randydg Posted December 7, 2005 Author Share Posted December 7, 2005 that worked, but some reason the pc isn't walking to the npc just stands there then starts conversation from across the ship. Link to comment Share on other sites More sharing options...
Darth333 Posted December 7, 2005 Share Posted December 7, 2005 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 More sharing options...
randydg Posted December 7, 2005 Author Share Posted December 7, 2005 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 More sharing options...
randydg Posted December 7, 2005 Author Share Posted December 7, 2005 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 More sharing options...
Det. Bart Lasiter Posted December 8, 2005 Share Posted December 8, 2005 Did you re-package the *.are file with the rest of the module files as a *.mod or *.rim? That script looks like it should work, so you might try checking the NPC tag as well. Link to comment Share on other sites More sharing options...
randydg Posted December 8, 2005 Author Share Posted December 8, 2005 can't be cause npc tag is same for walk and talk and talk works. and yes i pack everything into a .mod file Link to comment Share on other sites More sharing options...
randydg Posted December 9, 2005 Author Share Posted December 9, 2005 i guess nobody has the answer why the idest or the forcemove commands won't work. i'll be patient and wait a little longer before i give up. Link to comment Share on other sites More sharing options...
randydg Posted December 9, 2005 Author Share Posted December 9, 2005 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 More sharing options...
Pavlos Posted December 9, 2005 Share Posted December 9, 2005 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 More sharing options...
Darth333 Posted December 9, 2005 Share Posted December 9, 2005 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 More sharing options...
randydg Posted December 9, 2005 Author Share Posted December 9, 2005 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 More sharing options...
randydg Posted December 10, 2005 Author Share Posted December 10, 2005 i tried the above without the opc, and it compiled and the npc walked to the npc but didn't start converation. Link to comment Share on other sites More sharing options...
Darth333 Posted December 10, 2005 Share Posted December 10, 2005 Try: void main() { object oPC = GetFirstPC(); object oTalker = GetObjectByTag("lucas"); AssignCommand(oPC, ActionForceMoveToObject(oTalker)); AssignCommand(oPC, ActionDoCommand(ActionStartConversation(oTalker))); } Link to comment Share on other sites More sharing options...
randydg Posted December 10, 2005 Author Share Posted December 10, 2005 That worked perfectly!!! but 1 problem, the user can inturupt the script by moving the direction keys and throw it off! anyway to like set it to disable the user input untill script has finished? Link to comment Share on other sites More sharing options...
randydg Posted December 10, 2005 Author Share Posted December 10, 2005 Is there anyway to add an extra line such as: object odlg = Startdlgfile(lucasdlg); That way the npc can still have its own dlg file within the utc and have a sepearate one for this begining. Link to comment Share on other sites More sharing options...
Darth333 Posted December 11, 2005 Share Posted December 11, 2005 Yes you can: ActionStartConversation(oTalker, "my_dlg"); But why can't you set a variable instead of this? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.