PDA

View Full Version : [K1] Yet even more scripting issues!


ForeverNight
06-26-2008, 04:11 PM
After deciding (once again) to get back to working with my mod... one of these days months years I'll finally be finished with it!

But, anyway, as the title says, I ran into a small snag with a trigger... its supposed to fire a dialog and then disappear. Well, its not compiling... I have next to no knowledge about scripting, so here it is.

"Dacen" refers to a NPC in the module, I don't know if it works in this scenario, so if somebody could help?

void main()
{
object oEntering = GetEnteringObject();
object oPC=GetFirstPC();
if (GetIsPC(oEntering) && (GetIsObjectValid(GetObjectByTag("Dacen"))))
{
ActionStartConversation(oPC,"mffdlg");
DestroyObject(OBJECT_SELF);
}
Else

DestroyObject(OBJECT_SELF);
}

If somebody who understands this could help, it would be greatly appreciated...

Silveredge9
06-26-2008, 04:47 PM
After deciding (once again) to get back to working with my mod... one of these days months years I'll finally be finished with it!

But, anyway, as the title says, I ran into a small snag with a trigger... its supposed to fire a dialog and then disappear. Well, its not compiling... I have next to no knowledge about scripting, so here it is.

"Dacen" refers to a NPC in the module, I don't know if it works in this scenario, so if somebody could help?

void main()
{
object oEntering = GetEnteringObject();
object oPC=GetFirstPC();
if (GetIsPC(oEntering) && (GetIsObjectValid(GetObjectByTag("Dacen"))))
{
ActionStartConversation(oPC,"mffdlg");
DestroyObject(OBJECT_SELF);
}
Else

DestroyObject(OBJECT_SELF);
}

If somebody who understands this could help, it would be greatly appreciated...
The reason it wasn't compiling was because "Else" should be "else". But even if it did compile, it still wouldn't work in game,

The problem lies in the fact that you are commanding the trigger to initiate the dialogue with the player, and then to destroy itself - Which in turn is also preventing the dialogue from continuing.

Perhaps you could use the NPC Dacen as the other participant in the conversation?

Something like this would work.

void main()
{
object oEntering = GetEnteringObject();
object oPC=GetFirstPC();
if (GetIsPC(oEntering) && (GetIsObjectValid(GetObjectByTag("Dacen"))))
{
object oNPC=GetObjectByTag("Dacen");
AssignCommand(oNPC,ActionStartConversation(GetFirs tPC(),"mffdlg"));
DestroyObject(OBJECT_SELF);
}
else

DestroyObject(OBJECT_SELF);
}

ForeverNight
06-26-2008, 04:53 PM
Thanks, I'll test that out.