I have recently been working on the ransom dialogs, I have so far attempted to make it possible to take their money and kill them (very piratey -6 rep though) and I intend to include a small quest to claim ransom from the governor if the prisoner does not have as much money as the ransom amount (The governor will be as backstabbing as a pirate though)
However whenever I run the game, I encountered and coders nightmare! The cannot load dialog bug. My error.log reports this.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->COMPILE ERROR - file: dialogs\English\Prisoned_dialog.h; line: 1
Invalid array 'DLG_TEXT' initialization parameters list
COMPILE ERROR - file: dialogs\Prisoned_dialog.c; line: 465
invalid case syntax<!--c2--></div><!--ec2-->
I have been unable to figure out whats wrong with the top one and here is the offending code and down (if I comment out the bad code it moves down and complains about the next case, and the next case was a copy paste from previous cases.)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case "exit_ransom_conform";
if(prisonRansomCost>sti(NPChar.Money))
{
PlayStereoSound("INTERFACE\took_item.wav");
AddMoneyToCharacter(PChar,sti(NPChar.Money));
}
else
{
PlayStereoSound("INTERFACE\took_item.wav");
AddMoneyToCharacter(PChar,prisonRansomCost);
}
dialog.Text = DLG_TEXT[57];
Link.l1 = DLG_TEXT[58];
Link.l1.go = "exit_ransom";
Link.l2 = DLG_TEXT[59];
Link.l2.go = "exit_ransom_denied";
break;
case "exit_ransom_denied";
dialog.Text = DLG_TEXT[60];
Link.l1 = DLG_TEXT[61];
Link.l1.go = "exit_ransom_sharks";
break;
case "exit_ransom_sharks";
ChangeCharacterReputation(pchar, -6);
Lai_SetActorType(NPChar);
LAi_ActorTurnToCharacter(NPChar, PChar);
LAi_ActorAnimation(NPChar, "afraid","", 10);
DeleteAttribute(NPChar,"prisoned");
DeleteAttribute(NPChar,"status");
RemovePassenger(PChar,NPChar);
if(CheckAttribute(NPChar,"ransom")) DeleteAttribute(NPChar,"ransom");
ChangeCharacterAddressGroup(NPChar, "None", "", "");
object SharksFader;
CreateEntity(&SharksFader, "fader");
SendMessage(&SharksFader, "lfl", FADER_IN, 0.5, true);
StartVideo("Sharks_attack");
DialogExit();
break;<!--c2--></div><!--ec2-->
If anyone could cast their code eye over this snippet and tell me why its moaning at me would be appreciated (I even offered it Rum! But It still didn't work)
<i>(Note to the original author, I have changed as little of your code as posible, mine is encluded in if() statements burred within yours)</i>
However whenever I run the game, I encountered and coders nightmare! The cannot load dialog bug. My error.log reports this.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->COMPILE ERROR - file: dialogs\English\Prisoned_dialog.h; line: 1
Invalid array 'DLG_TEXT' initialization parameters list
COMPILE ERROR - file: dialogs\Prisoned_dialog.c; line: 465
invalid case syntax<!--c2--></div><!--ec2-->
I have been unable to figure out whats wrong with the top one and here is the offending code and down (if I comment out the bad code it moves down and complains about the next case, and the next case was a copy paste from previous cases.)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case "exit_ransom_conform";
if(prisonRansomCost>sti(NPChar.Money))
{
PlayStereoSound("INTERFACE\took_item.wav");
AddMoneyToCharacter(PChar,sti(NPChar.Money));
}
else
{
PlayStereoSound("INTERFACE\took_item.wav");
AddMoneyToCharacter(PChar,prisonRansomCost);
}
dialog.Text = DLG_TEXT[57];
Link.l1 = DLG_TEXT[58];
Link.l1.go = "exit_ransom";
Link.l2 = DLG_TEXT[59];
Link.l2.go = "exit_ransom_denied";
break;
case "exit_ransom_denied";
dialog.Text = DLG_TEXT[60];
Link.l1 = DLG_TEXT[61];
Link.l1.go = "exit_ransom_sharks";
break;
case "exit_ransom_sharks";
ChangeCharacterReputation(pchar, -6);
Lai_SetActorType(NPChar);
LAi_ActorTurnToCharacter(NPChar, PChar);
LAi_ActorAnimation(NPChar, "afraid","", 10);
DeleteAttribute(NPChar,"prisoned");
DeleteAttribute(NPChar,"status");
RemovePassenger(PChar,NPChar);
if(CheckAttribute(NPChar,"ransom")) DeleteAttribute(NPChar,"ransom");
ChangeCharacterAddressGroup(NPChar, "None", "", "");
object SharksFader;
CreateEntity(&SharksFader, "fader");
SendMessage(&SharksFader, "lfl", FADER_IN, 0.5, true);
StartVideo("Sharks_attack");
DialogExit();
break;<!--c2--></div><!--ec2-->
If anyone could cast their code eye over this snippet and tell me why its moaning at me would be appreciated (I even offered it Rum! But It still didn't work)
<i>(Note to the original author, I have changed as little of your code as posible, mine is encluded in if() statements burred within yours)</i>