Ritualistic Forums

Go Back   Ritualistic Forums > Ritual Entertainment Games > Star Trek Elite Force II > EF2 Editing Forum

Reply
 
Thread Tools Display Modes
Old 03-26-2004, 01:19 AM   #1
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default To walk or not to walk...

that is the strange question - or problem - I am running into.

I am working on a room with multiple scripted npcs. To make certain I am making their scripts correctly, I first make their scripts individually and run them individually to confirm they work. Then I add the additional thread into the big script, ie - I create a void npc(); for it, put a 'thread npc();' in void main(), and then make a void npc() for it.

In my latest script, I have this function: $npc.walkto( "node" ); In the single npc map, this works perfectly. The npc walks to the node as it should. However, when put into the main script (as I described in the above paragraph), the walkto does not work. The npc simply stands there.

I thought the npc might be named incorrectly. However, I inserted a .remove function, and - at the appointed time - the npc disappeared.

So - I cant figure this out. Any ideas what might be going wrong??
6of1 is offline   Reply With Quote
Old 03-26-2004, 02:25 AM   #2
Asdfga3
Experienced
 
Join Date: Feb 2004
Location: Tacoma, WA USA
Posts: 104
Default Re: To walk or not to walk...

While you where checking to see if you missnamed the entity, did you check if you misnamed the node? [img]/forums/images/graemlins/crazy.gif[/img]
Asdfga3 is offline   Reply With Quote
Old 03-26-2004, 03:28 AM   #3
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: To walk or not to walk...

I did, though in both cases I really didnt have to, because the map is exactly the same. I just duplicate it and rename it to match the name of the individual small script I am working on at the time. So the problem has to be in the way the small code is sometimes interacting with the rest. I have posted the script below. The problem is with the 'departer' section of the script. Without the transop_welcome, the departer, well, departs. [img]/forums/images/graemlins/wink.gif[/img] However, with the transop_welcome, the departer simply stands there.

Any clues?

void main();
void playerbeamin();
void departer();

//--all transop conversations
void transop_welcome();

//--- common functions
void commonAnimateStance( entity entAI, float fltNumCycles, string strAnim1, float boolLoop1, string strAnim2, float boolLoop2, string strAnim3, float boolLoop3, string strAnim4, float boolLoop4 );

void commonRandomlyAnimateActor( entity actorToAnimate, string animationToUse );

//---includes - ie references other script files
#include "maps/global_scripts/global_common.scr"



//===========================
// MAIN
//===========================

void main()
{
thread playerbeamin();
thread departer();
thread transop_welcome();
}


void playerbeamin()
{
$player.immobilize ( 1 );
$player.displayEffect ( "TransportIn" , "Federation" );
wait ( 1 );

}

void departer()
{


$departer.ai_off();
$departer.walkto( "departer-pathnode" );
waitFor( $departer );
//$departer.remove();

trigger( "$swish_speaker" );
$swish_speaker.playsound( "sound/doors/shipdoor1.wav" , 3, 0.25, 100 );
wait( 2 );
trigger( "$swish_speaker" );
$swish_speaker.playsound( "sound/doors/shipdoor1.wav" , 3, 0.25, 100 );

}


void transop_welcome()
{

//Transop acts
$transop.ai_off();
$transop.pushable ( 0 );

$transop.anim( "ent-vchair-gesture1" );
waitForAnimation( $transop, "ent-vchair-gesture1" );

$transop.anim( "ent-vchair-idle-look" );
$transop.headWatchTarget( "player", 5 );
waitForAnimation( $transop, "ent-vchair-idle-look" );

$transop.anim( "ent-vchair-idle-scan" );
waitForAnimation( $transop, "ent-vchair-idle-scan" );

wait( .5 );

//Transop speaks to player
$transop.playdialog( "sound/dialog/welcome.mp3", 1, 200, 0 );
$transop.anim( "ent-table-idle-look" );
wait( 2.5 );

waitForDialog( $transop );

$transop.playdialog( "sound/dialog/just_missed.mp3", 1, 200, 0 );
$transop.anim( "ent-table-gesture2" );
waitForAnimation( $transop, "ent-table-gesture2" );
$transop.anim( "ent-table-idle-look" );
waitForDialog( $transop );

$transop.playdialog( "sound/dialog/until_then.mp3", 1, 200, 0 );
$transop.anim( "ent-table-gesture1" );
waitForAnimation( $transop, "ent-table-gesture1" );
$transop.anim( "ent-table-gesture" );
waitForAnimation( $transop, "ent-table-gesture" );
$transop.anim( "ent-table-idle" );
waitForAnimation( $transop, "ent-table-idle" );
waitForDialog( $transop );

$transop.anim( "ent-vchair-gesture" );
$transop.headWatchTarget( "none", 5 );
waitForAnimation( $transop, "ent-vchair-gesture" );

//--- Random animation for transop
thread commonRandomlyAnimateActor( $transop, "ent-vchair" );

}

6of1 is offline   Reply With Quote
Old 03-26-2004, 12:02 PM   #4
Tempest
Fanatic
 
Tempest's Avatar
 
Join Date: Aug 2003
Location: A rift in space and time running through Cardiff
Posts: 1,829
Send a message via MSN to Tempest
Default Re: To walk or not to walk...

OK, I know what your doing wrong.

1) the use of
thread blah blah();
thread blah blah2();

will cause bothe of them to near enough run at the same time.

to overcome this, either use
blah blah();
blah blah2();

this will cause the script to run through the 1st function and will not start the 2nd until the first is finished.

or simply use this.

void main();
void playerbeamin();
void departer();

//--all transop conversations
void transop_welcome();

//--- common functions
void commonAnimateStance( entity entAI, float fltNumCycles, string strAnim1, float boolLoop1, string strAnim2, float boolLoop2, string strAnim3, float boolLoop3, string strAnim4, float boolLoop4 );

void commonRandomlyAnimateActor( entity actorToAnimate, string animationToUse );

//---includes - ie references other script files
#include "maps/global_scripts/global_common.scr"



//===========================
// MAIN
//===========================

void main()
{
thread playerbeamin();
}


void playerbeamin()
{
$player.immobilize ( 1 );
$player.displayEffect ( "TransportIn" , "Federation" );
wait ( 1 );
thread departer();
}

void departer()
{


$departer.ai_off();
$departer.walkto( "departer-pathnode" );
waitFor( $departer );
//$departer.remove();

trigger( "$swish_speaker" );
$swish_speaker.playsound( "sound/doors/shipdoor1.wav" , 3, 0.25, 100 );
wait( 2 );
trigger( "$swish_speaker" );
$swish_speaker.playsound( "sound/doors/shipdoor1.wav" , 3, 0.25, 100 );
thread transop_welcome();
}


void transop_welcome()
{

//Transop acts
$transop.ai_off();
$transop.pushable ( 0 );

$transop.anim( "ent-vchair-gesture1" );
waitForAnimation( $transop, "ent-vchair-gesture1" );

$transop.anim( "ent-vchair-idle-look" );
$transop.headWatchTarget( "player", 5 );
waitForAnimation( $transop, "ent-vchair-idle-look" );

$transop.anim( "ent-vchair-idle-scan" );
waitForAnimation( $transop, "ent-vchair-idle-scan" );

wait( .5 );

//Transop speaks to player
$transop.playdialog( "sound/dialog/welcome.mp3", 1, 200, 0 );
$transop.anim( "ent-table-idle-look" );
wait( 2.5 );

waitForDialog( $transop );

$transop.playdialog( "sound/dialog/just_missed.mp3", 1, 200, 0 );
$transop.anim( "ent-table-gesture2" );
waitForAnimation( $transop, "ent-table-gesture2" );
$transop.anim( "ent-table-idle-look" );
waitForDialog( $transop );

$transop.playdialog( "sound/dialog/until_then.mp3", 1, 200, 0 );
$transop.anim( "ent-table-gesture1" );
waitForAnimation( $transop, "ent-table-gesture1" );
$transop.anim( "ent-table-gesture" );
waitForAnimation( $transop, "ent-table-gesture" );
$transop.anim( "ent-table-idle" );
waitForAnimation( $transop, "ent-table-idle" );
waitForDialog( $transop );

$transop.anim( "ent-vchair-gesture" );
$transop.headWatchTarget( "none", 5 );
waitForAnimation( $transop, "ent-vchair-gesture" );

//--- Random animation for transop
thread commonRandomlyAnimateActor( $transop, "ent-vchair" );

}
Tempest is offline   Reply With Quote
Old 03-26-2004, 01:04 PM   #5
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: To walk or not to walk...

But I WANT the two npcs to be working AT THE SAME TIME. I do NOT want one them to wait for the next, which then waits for the next. In other words - at the SAME TIME the player beams in, I WANT one npc to be walking in the background WHILE the other works, then speaks to the player.

And this isnt a problem when I beam in the player with the departer, or when I beam in the player with the transop. But when I beam in the player with both the transop and the departer ONLY the departer has an issue.

Why?

(Oh - and please dont tell me just to put them all in one thread then. There is going to be so much going on over the course of this level that there is NO way to keep them all straight if they are in one thread.)
6of1 is offline   Reply With Quote
Old 03-26-2004, 05:58 PM   #6
Tempest
Fanatic
 
Tempest's Avatar
 
Join Date: Aug 2003
Location: A rift in space and time running through Cardiff
Posts: 1,829
Send a message via MSN to Tempest
Default Re: To walk or not to walk...

Whoops my mistake i thought that was just for 1npc.
Tempest is offline   Reply With Quote
Old 03-26-2004, 06:06 PM   #7
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: To walk or not to walk...

ok - so now that you know it is for more than one npc, do you see anything wrong with the script - something I am leaving out - or something which is interfering with something else - which would explain why I am hafing trouble with the departer npc?
6of1 is offline   Reply With Quote
Old 03-26-2004, 08:33 PM   #8
Tempest
Fanatic
 
Tempest's Avatar
 
Join Date: Aug 2003
Location: A rift in space and time running through Cardiff
Posts: 1,829
Send a message via MSN to Tempest
Default Re: To walk or not to walk...

have you tried removing the waitfor after the walk to?
Tempest is offline   Reply With Quote
Old 03-26-2004, 09:38 PM   #9
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: To walk or not to walk...

I had tried that, yes. And it did not solve the problem. Furthermore, Im curious why that would work in a script by itself, but not in a script with other voids.

BTW - is there another way to get an npc to walk from its start point to a node beside the walkto function?
6of1 is offline   Reply With Quote
Old 03-27-2004, 12:13 AM   #10
Tempest
Fanatic
 
Tempest's Avatar
 
Join Date: Aug 2003
Location: A rift in space and time running through Cardiff
Posts: 1,829
Send a message via MSN to Tempest
Default Re: To walk or not to walk...

Yes im wondering why its not working, im not sure if there is, you could try runto see if that helps.
Tempest is offline   Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:02 AM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.