Jump to content

Home

Qui-Gon's Script Shack


Qui-Gon Glenn

Recommended Posts

  • Replies 352
  • Created
  • Last Reply
  • 4 weeks later...

void main () {

if(GetModuleName == "ebo_m12aa") {

CreateObject(OBJECT_TYPE_PLACEABLE, "object resref", location vector, FALSE);

Location(x, y, z), xorientation, yorientation

}

}

 

coordinates are 53.23, 60.37 and 1.80 (x,y,z in order)

 

I kind user gave me this script, and I was wondering if this would work if I wanted to:

 

See if I was on the Ebon Hawk and if yes spawn the tur_arc (res ref)

At the space specified by the coordinates. Could you help?What needs to be done?

Link to comment
Share on other sites

just to clarify, the script I gave DJW, with the values he's just posted, would be:

 

void main () {
 if(GetModuleName == "ebo_m12aa") {
   CreateObject(OBJECT_TYPE_PLACEABLE, "tur_arc", Location(53.23, 60.37, 1.80), xorientation, yorientation, FALSE);
 }
}

 

I know for a fact that it's wrong, but I wasn't sure how to make it right. Sorry about that DJW :)

Link to comment
Share on other sites

I think you've pretty much got it there Kuai-Donn, maybe:

 

void main() {

if ((GetModuleName() == "ebo_m12aa")) {
   CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), xx.x, yy.y) FALSE);
   }
}

 

Id give that a go DJW, see what happens.

 

Also, if your doing this for K1, I seem to remember that the whereami cheat doesn't give orientation values. I'm not sure how you would get them but for now just put 0 in each, sort it out later :)

Link to comment
Share on other sites

void main() {

if ((GetModuleName() == "ebo_m12aa")) {

CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0, 0.0), FALSE);

}

}

 

It now sais too many arguments specified in cell "location"

And required argument missing in cell "CreateObject"

What do I do?

(Do I need OBJECT_TYPE_PLACEABLE inserted somewhere?

Link to comment
Share on other sites

void main() {

if ((GetModuleName() == "ebo_m12aa")) {

CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0, 0.0), FALSE);

}

}

 

It now sais too many arguments specified in cell "location"

And required argument missing in cell "CreateObject"

What do I do?

(Do I need OBJECT_TYPE_PLACEABLE inserted somewhere?

 

No, you just need to close twice after FALSE and not the vector..

oh wait...reading that wrong.. (edit 1 I dont know I bow out..)

 

Edit again)...no I stand by that actually...and you dont even need the FALSE anyway. tell me if Im wrong.

 

Hassat, the reason I put two (( in now is because when I complied scripts with one, then decomplied the same script, it was putting two there anyway, and it never gave me any problems..

Link to comment
Share on other sites

I'm a little embaresed but for some reason (maybe because I've just woken up) and I'm getting a little confused so could anyone go through the changes I need to do. Or even better, and example script. But thanks for helping me so far,

 

-DJW

 

EDIT: It sais tur_arc1.nss(2) syntax error at ")"

With this script. Am I on the right tracks?

void main() {

if (GetModuleName() == "ebo_m12aa")) {

CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80, 0.0, 0.0), FALSE));

}

}

Link to comment
Share on other sites

try this..

 

void main() {

if (GetModuleName() == "ebo_m12aa") {

CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.00, 0.00));

}

}

 

see if that works..

 

The script sais

Required argument missing in call to "CreateObject"

and

To many arguments specified in call to "Location"

What should I do?

 

Thanks for the help so far

-DJW

Link to comment
Share on other sites

void main() { 
 if (GetModuleName() == "ebo_m12aa") { 
 CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0));
 } 
}

 

This compiled the *first time* I tried it.

It should work, my mistake was putting x and y after the vector

 

Yay it compiled. Thanks so much! You'll be credited. As well as everyone else who helped. Time to test- Ill post how it goes later

 

Cheers again

-DJW

Link to comment
Share on other sites

To do this, you need to set a boolean which will return true when you've talked to the character. Then create a conditional script for the line of dialog you want available after you've talked.

 

This script will set the boolean,

 

void main () {
 SetLocalBoolean(HAS_TALKED,0,TRUE);
}

 

This script will check to see if you've talked yet,

 

int StartingConditional() {
 int nTalked = GetLocalBoolean(HAS_TALKED,0);
 return nTalked;
}

 

In the dialog file, put the dialog node you want the character to say AFTER you've talked before at the top. Then, in the conditional field, put the name of the second script.

 

In the node of dialog you want the character to say the first time you talk, you need to put the first script in the script field. You can put it on any line of dialog but you need to decide where it would be best suited.

 

Depending on the situation, you can make this as complicated or simple as you want, with many different conditional scripts.

Link to comment
Share on other sites

Thought I'd add it dosn't compile. It sasis:

Undeclared Indentifier "HAS_TALKED:

And

Required Argument missing in call to "SetLocalBoolean"

Here is the script:

void main () { 
SetLocalBoolean(HAS_TALKED,0,TRUE); 
}

Same errors with the second script:

 

int StartingConditional() {
     int nTalked = GetLocalBoolean(HAS_TALKED,0); return nTalked; 
}

Link to comment
Share on other sites

If you want to have a check wether the person has been talked to just use in-game resources.

 

k_con_talkedto checks if you've talked to a person, and k_act_talktrue makes it so that the game recognizes that you've talked to the person, basically this:

 

void main () { 
SetLocalBoolean(HAS_TALKED,0,TRUE); 
}

 

 

Anyway, I use that a lot in KotOR 1, I don't know if it works in KotOR 2.

Link to comment
Share on other sites

Archived

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


×
×
  • Create New...