PDA

View Full Version : Script Assistance Needed


brwarner
10-15-2005, 01:15 PM
Is there a way to find the position of an object like your cuurent position in a script. I know you can because of the Where am i armband does it.

kdsphantom
10-15-2005, 01:46 PM
Hiya brwarner,
Im not so good at this scripting and modding myself, but maybe we can figure this out. But what is it your trying to do not sure about?

Is there a way to find the position of an object like your cuurent position in a script. I know you can because of the Where am i armband does it.

Do you mean while your in game? or while your using the KT tools ? or something else to mod with ?

brwarner
10-15-2005, 02:03 PM
while in game i want to find position of object and say it in dialog.

kdsphantom
10-15-2005, 02:16 PM
Aye the whereami armband, darth333 script angel is a genius too )

well ya this thread
http://www.lucasforums.com/showthread.php?t=144260
it has all you want, the armband that is ) right ?

brwarner
10-15-2005, 02:51 PM
i meant the code function to return the pos of an object.

Det. Bart Lasiter
10-16-2005, 12:01 AM
You use the 'GetPosition()' function in a manner similar to this:


vector vVec = GetPosition(oCreature)

Dak Vesser
10-17-2005, 11:43 AM
while in game i want to find position of object and say it in dialog.

I sent Darth333 the source scripts, plus a small beta version of an armband that shows the postion vector coordenants in a dialogue one liner. She'll implement it into her next whereami armband, and should have it ready for the public real soon...

Det. Bart Lasiter
10-18-2005, 05:46 PM
^^^^
I didn't see that part, so try this:

void main()
{
vector vVec = GetPosition(oCreature); // Don't forget to declare oCreature

// Edit
string sVec = "(" + FloatToString(vVec.x)+ ", " + FloatToString(vVec.y)+ ", " + FloatToString(vVec.z) + ")";
SendMessageToPC(GetFirstPC(), sVec);
}

***Edit***
Does anyone know if 'ActionSpeakString()' works in KotOR?

Dak Vesser
10-19-2005, 12:31 AM
^^^^
I didn't see that part, so try this:

void main()
{
vector vVec = GetPosition(oCreature); // Don't forget to declare oCreature

// Edit
string sVec = "(" + FloatToString(vVec.x)+ ", " + FloatToString(vVec.y)+ ", " + FloatToString(vVec.z) + ")";
SendMessageToPC(GetFirstPC(), sVec);
}

***Edit***
Does anyone know if 'ActionSpeakString()' works in KotOR?

No, ActionSpeakString() will not work because of int ShipBuild() was used to disable all debug output messaging for the retail build of SWkotor and Unfortunantly there is no known function command in nwscript that can set or re-enable debugging. The developers didn't want any debug message showing up from AI scripts by accident and of course instead of going into each script from every module and commenting out the speakstrings, barks, posts,and logging, they just created "int ShipBuild()" an arguement that would redifine the debug mode as disabled in the executable file.

The Source
10-19-2005, 02:54 PM
Just a suggestion:

Use Darth333's 'Where am I Band'!

1. In game, goto a location close to the object in question, click on the 'Where am I Band'.
2. Write down the X and Y coordinates.
3. Use a .git editor, and open the module's .git file.
4. Go into the placeable's catagory, and try to match up the X and Y coordinates.
5. When you find a matching set, that is your object in question.

Crude but effective...

Darth333
10-19-2005, 02:58 PM
Wait until you see the new version ;) Dak Vesser has added some cool and useful stuff to the armband. It will be up this weekend at the latest.

The Source
10-19-2005, 02:59 PM
NICE!!!! :)