Jump to content

Home

[K1] Yet even more scripting issues!


ForeverNight

Recommended Posts

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);
}[/Code]

 

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

Link to comment
Share on other sites

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);
}[/Code]

 

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.

 

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

DestroyObject(OBJECT_SELF);
}[/Code]

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...