Yes it's a quest. Hmm the special item could be a datapad but how do i create a trigger when i enter a module if my item is a datapad?
If you wanted to use the datapad (we'll say its tag is "sekan_datapad") and you were not using Journal entries you could do something like:
void main() {
// First check to see if the entering object is the PC
if (!GetIsPC(GetEnteringObject)) {
return;
}
// Now check if the sekan_datapad exists
if (!GetIsObjectValid( GetObjectByTag("sekan_datapad") ) {
return;
}
// So far so good, now check to make sure we haven't spawned already
// let's assume the NPC to spawn isn't going to get killed, so we can just
// check for his presence
if (!GetIsObjectValid( GetObjectByTag("sekan_npc") ) {
CreateObject( OBJECT_TYPE_CREATURE, "sekan_npc_resref", GetLocation(GetEnteringObject) );
}
}
The cleaner way would be to use Journal entries because you can keep track of when its time to spawn more easily. If your quest was 'sekan_quest', you could do something like
// First check to see if the entering object is the PC
if (!GetIsPC(GetEnteringObject)) {
return;
}
// Now see our quest is at the point where we want to spawn
int nQuest = GetJournalEntry("sekan_quest");
// let's pretend that in your quest, step 20 is when you to spawn
if (nQuest == 20) {
CreateObject( OBJECT_TYPE_CREATURE, "sekan_npc_resref", GetLocation(GetEnteringObject) );
//now that we've spawned him, we'll change our quest number
AddJournalQuestEntry("sekan_quest", 25);
}
}With this second code snippet, you don't even check for the presence of the datapad. That way if the PC decided he wanted to stash the datapad in one of the Ebon Hawk's plastisteel containers, he would still get the guy to spawn, whereas in the first script, he would not. The only thing is that you'll have to make sure when the datapad is first acquired, you set the Journal entry correctly (to 20 in this example).
See also Darth333's Quest tutorial (Journal Entries) here (
http://www.lucasforums.com/showthread.php?t=143372).