View Single Post
Old 03-29-2013, 11:00 PM   #8
Fair Strides 2
Junior Member
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 495
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by arsenalforever View Post
Okay, I've managed to write this piece of code thanks to zbyl2 on the Deadly Stream forums:

Code:
void main()
{
object oNPC = CreateObject(OBJECT_TYPE_CREATURE, "g_gammorean", Location(Vector(25.0,34.0,65.0), 0.0f));
DelayCommand(5.0, AssignCommand(oNPC, ActionStartConversation(GetFirstPC(),"Gamorrean")));
}
Now how do I get it to run once I'm on Onderon and go anywhere near the gammorean?
You can make a custom OnHeartbeat script which will check if you are X meters away from him, and if so, execute the script.

Code:
void main() {
    ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_DEFAULT_EVENT_ON_HEARTBEAT);

if(GetLastPerceived() == GetFirstPC) {
    ExecuteScript("convstart", OBJECT_SELF);
}
}
That code should work if placed as the OnHeartbeat script. All you have to do is replace "convstart" with the name of your and Zybl's script, while still being in quotes. If it son't work, come back and I'll try to help.


Always remember modders: "Quality= Effort*Time"

Quote:
Originally Posted by Jae Onasi
Hi! I messaged him on Facebook and got this answer: "Sure if he wants to release a new KSE, no problem. I'm surprised he was able to find all the perl modules. I released them a long time ago but they were buried somewhere in the KSE thread." So, go for it--please give him credit for the original work, though!
KSE 3.3.4 is LIVE!!! Check it out here.

12/13/13 -- Fixed KSE 3.3.4 bugs. Please check the above link.
Fair Strides 2 is offline   you may: quote & reply,