Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Scripts and Their Devious Ways

Page: 1 of 1
 Fallen Guardian
11-24-2011, 5:43 PM
#1
So I made two scripts giving out a command to make an NPC run, and then a command to execute another script. Here they are:

void main()
{
ActionPauseConversation();

object oNPC = GetObjectByTag("n_dohad");

float x=466.74640;
float 7=83.11619;
float z=9.96480;


int bRun=TRUE;

vector vDohadrun=Vector(x,y,z);
location lFirststop=Location(vDohadrun,0.0f);

DelayCommand(1.0, AssignCommand(oNPC, ActionForceMoveToLocation(lFirststop,bRun)));

DelayCommand(4.0, ExecuteScript("14ab_fadein3", OBJECT_SELF));

ActionResumeConversation();
}



void main()
{
ActionPauseConversation();


object oNPC = GetObjectByTag("n_dohaw");


float x=465.80499;
float 7=84.91311;
float z=10.26097;


int bRun=TRUE;

vector vDohawrun=Vector(x,y,z);
location lFirststop=Location(vDohawrun,0.0f);

AssignCommand(oNPC, ActionForceMoveToLocation(lFirststop,bRun));

ActionResumeConversation();
}


Now I keep on getting a syntax error at "integer constant". I would assume that this has something to do with this: int bRun=TRUE; but I can't for the life of me figure it out. For it is pretty much the same as this script:

void main()
{
ActionPauseConversation();

SetGlobalFadeIn(0.0, 4.0);

object oNPC = GetObjectByTag("n_doha");


float x=467.35056;
float y=79.96013;
float z=9.69549;


int bRun=TRUE;

vector vDoharun=Vector(x,y,z);
location lFirststop=Location(vDoharun,0.0f);

DelayCommand(4.0, AssignCommand(oNPC, ActionForceMoveToLocation(lFirststop,bRun)));

DelayCommand(7.0, ExecuteScript("14ab_fadein2", OBJECT_SELF));

ActionResumeConversation();
}


Which compiled perfectly. Do you guys have any ideas?
 Qui-Don Jorn
11-24-2011, 5:52 PM
#2
well, just asking I don't know, but why put actionFORCEmoveto object? wouldn't it be fine with actionmovetolocation, soandso, 1) ?
or is that a k1 thing i dont know about?
no wouldnt be a k1 thing...that was dumb.
 Fastmaniac
11-24-2011, 6:12 PM
#3
The Script actually compiles fine if you correct the typo at the y-coords ;) you wrote 7=.... And (as mathematics suggests) 7=7 and not 7=83 ;). Just change it to y=83....
 Fallen Guardian
11-24-2011, 6:48 PM
#4
The Script actually compiles fine if you correct the typo at the y-coords ;) you wrote 7=.... And (as mathematics suggests) 7=7 and not 7=83 ;). Just change it to y=83....

Oh wow....Thanks Fastmaniac.
 Fallen Guardian
11-25-2011, 4:11 PM
#5
Alright, here's another script that's troubling me. This time it compiles correctly and looks fine, but when it is used in the dialog the dialog cuts out at that node. The dialog just exits, but the script continues. The attacker shoots, but doesn't kill the person he's shooting at. I made sure the NPC that's supposed to die had 1 HP as well.

void main ()

{

ActionPauseConversation();

object oNPC = GetObjectByTag("scared");

object oShooter = OBJECT_SELF;
object oTarget = GetNearestObjectByTag("killed", OBJECT_SELF, 1);

ActionPauseConversation();

ChangeToStandardFaction(oShooter, 2);

ChangeToStandardFaction(oTarget, 4);

ApplyEffectToObject(1, EffectAssuredHit(), oShooter, 0.3);
DelayCommand(0.3, AssignCommand(oShooter, ActionAttack(oTarget, 0)));

DelayCommand(1.0, AssignCommand(oNPC, ActionPlayAnimation(18, 1.0, (-1.0))));

DelayCommand(4.0, ChangeToStandardFaction(oShooter, 4));

ActionResumeConversation();
}

Any ideas?

EDIT: I've fixed the problem, no need to reply to this question.
Page: 1 of 1