lfnetwork.com mark read register faq members calendar

Thread: Scripting Mishap
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 09-17-2011, 05:02 PM   #1
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Scripting Mishap

So I have a script where in a dialogue file when a node is passed over this script will run:

Code:
void main() 
{
ActionPauseConversation();

object oDoor=GetObjectByTag("man26ad_door02");

object oNPC = GetObjectByTag("p_avix");

object oNPC1 = GetObjectByTag("Bastila");

object oPC=GetFirstPC();

SetCommandable(TRUE,oNPC);

SetCommandable(TRUE,oNPC1);

SetCommandable(TRUE,oPC);

AssignCommand(oPC, ActionForceMoveToLocation (Location(Vector(420.65048, 164.75064, 8.00), 0.0)));

AssignCommand(oNPC, ActionForceMoveToLocation (Location(Vector(423.07117, 163.83559, 8.00), 0.0)));

AssignCommand(oNPC1, ActionForceMoveToLocation (Location(Vector(419.32086, 165.04903, 8.00), 0.0)));


AssignCommand(oDoor, ActionOpenDoor(oDoor));

ActionWait(3.5);

DelayCommand(3.5, AssignCommand(oDoor, ActionCloseDoor(oDoor)));


ActionResumeConversation();
}
Now, the problem is.....no one moves. They just stand there stupidly, I added in the makenpc commandable line (I think I did that wrong) just in case they were set not to be and still no luck.

Anyone else know why?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-17-2011, 06:03 PM   #2
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by NWNLexicon
location: A location has three components- the object ID of the area, a vector representing the position within the area, and a floating point number representing the facing.
Are you missing something in your Location call... it seems to be missing a parameter, namely the object ID of the area. If this is indeed the case (I really don't know) then that would explain the NPC's failing to follow orders. The call is going out to the ether!


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-17-2011, 06:05 PM   #3
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
As far as I can tell it's good. I actually used the move commands from another script which worked fine, but then again that script was executed out of dialogue. I know this type of script works:

Code:
void main() 
{

ActionPauseConversation();

object oPC=GetFirstPC();

float x=420.65048;
float y=164.75064;
float z=8.00;

int bRun=FALSE;

vector vPCcoor=Vector(x,y,z);
location lSpot=Location(vPCcoor,0.0f);

AssignCommand(oPC, ActionForceMoveToLocation(lSpot,bRun));

ActionResumeConversation();
}
But is there a way to make it so that I can address multiple people to move to different places with a script like this?


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-17-2011, 06:19 PM   #4
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
It should work fine... sorry about that FG, I got ahead of myself, there was nothing wrong with how you used location.

I am playing with it right now... it seems that it should all work ok. I guess it would help me to know this... are these people walking through the door that is opening and closing. What part in all of this does the door play?

EDIT: If you can, give me a little screenplay version... If I can follow what is supposed to happen from the story side, I think I can better work out how to get the script dialed-in.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa

Last edited by Qui-Gon Glenn; 09-17-2011 at 06:25 PM.
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-17-2011, 06:23 PM   #5
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Yeah they walk through the door, and then it closes after it passes through. I made an estimate on the delay command because I never got to see how long it took for them to make it through the door. Also, there's another character that has a script to move him almost identical to the one I posted the second time and it doesn't work either.


EDIT: Could you go on Hssiss chat? It might prove to be more time saving.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version

Last edited by Fallen Guardian; 09-17-2011 at 06:36 PM.
Fallen Guardian is offline   you may: quote & reply,
Old 09-17-2011, 06:55 PM   #6
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Just a little reorganizing of your code, may change nothing, and I will look for you in the chat-box shortly, but this may be helpful:

Code:
void main() 
{

   object oPC=GetFirstPC();
   object oNPC=GetObjectByTag("p_avix");
   object oNPC1=GetObjectByTag("Bastila");
   object oDoor=GetObjectByTag("man26ad_door02");
   
   ActionPauseConversation();
   SetCommandable(TRUE,oNPC);
   SetCommandable(TRUE,oNPC1);
   SetCommandable(TRUE,oPC);
   AssignCommand(oDoor, ActionOpenDoor(oDoor));
   ActionWait(1.0);
   AssignCommand(oPC, ActionForceMoveToLocation (Location(Vector(420.65048, 164.75064, 8.00), 0.0)));
   AssignCommand(oNPC, ActionForceMoveToLocation (Location(Vector(423.07117, 163.83559, 8.00), 0.0)));
   AssignCommand(oNPC1, ActionForceMoveToLocation (Location(Vector(419.32086, 165.04903, 8.00), 0.0)));
   DelayCommand(5.0, AssignCommand(oDoor, ActionCloseDoor(oDoor)));
   ActionResumeConversation();
}


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-17-2011, 06:55 PM   #7
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Alright, I'll try it.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-20-2011, 08:31 AM   #8
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Any luck?


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-20-2011, 11:06 PM   #9
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Nope, I think I may try it another way and get back to you. Thanks for the help so far Glenn.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-21-2011, 01:07 AM   #10
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
I am screwing around on the endar spire a bit. I will see if I can test this on a door or two in there. I will just need to make a dummy convo...


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 09-21-2011, 01:34 AM   #11
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Okay, thanks.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-22-2011, 01:04 AM   #12
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,465
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Hey Fallen Guardian -

I have been thinking and searching. I wonder if you have looked at this thread by Dak Vesser? Specifically this portion:

Quote:
Originally Posted by Dak Vesser View Post
~snip

This next one I created is an On Blocked Script. Added "Picked Lock Routine" for the Holo Droid just in case a locked door gets in its Pathway, it can unlock or attempt to unlock and open it. That way, the player won't have to Deactivate/reactivate the droid to get it back to within float range.

The reason for this is because when I added the “PC Location Jump” options in the planetary Debug section of the "g_cheatbot01" dialogue, I needed to make sure the Holo Droid could follow and or catch up.

Code:
#include "k_inc_debug"
#include "k_inc_generic"
#include "k_inc_switch"
#include "k_inc_utility"

void main()
{
    object oDoor = GetBlockingDoor();
    if(!GN_GetSpawnInCondition(SW_FLAG_AI_OFF))
    {
        if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)
        {
            if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_OPEN) && 
               GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 7 )
            {
                DoDoorAction(oDoor, DOOR_ACTION_OPEN);
                SendMessageToPC(GetFirstPC(), "Debug Message: Henchmen just executed the -door open- routine...");
            }
            if(GetLocked(oDoor))
            {
                DoDoorAction(oDoor, DOOR_ACTION_UNLOCK);
                SendMessageToPC(GetFirstPC(), "Debug Message: Henchmen just executed the -picked lock- routine...");
            }
            else if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_BASH))
            {
                DoDoorAction(oDoor, DOOR_ACTION_BASH);
                SendMessageToPC(GetFirstPC(), "Debug Message: Henchmen just executed the -door bash- routine...");
            }
        }
    }
    if(GN_GetSpawnInCondition(SW_FLAG_EVENT_ON_BLOCKED))
    {
        SignalEvent(OBJECT_SELF, EventUserDefined(1009));
    }
}
This is a good script if you wanna create a creature with a custom pathway through a locked door..
Now, it is important to note that this is a TSL script, so not all of the functions are available in KotOR's nwscript.nss. However, there might be something helpful here


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Scripting Mishap

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:44 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.