So I have given up on adapting the AOP1 code for AOP2 surrender. It messes up too many things. I was really wanting surrendered ships to display a white flag like they did in AOP1 Caribbean Tales.
However, I have been thinking about another possibility that I think could work but need help with the command.
In AIShips I have successfully written code that will make the enemy ship strike his flag completely, but I used DeleteClass to achieve this which has the bad effect of deleting all flags on all ships in the area when one enemy ship surrenders.
There has got to be some other item I can insert there that will work. I tried delete entity and delete object already, but the game won't start when I put those in. I may have written them wrong.
Anyone have any ideas? This would be so great if I can get it to work. It looked so cool when the enemy flag disppeared with the alarm and dialogue "Captain she's struck her colors."
Here's the pertinent piece of code. The last line is the magic one I'm looking for. Help. MK
// boal 20.08.06 ïåðåðèñîâêà ôëàãà -->
void Ship_FlagRefresh(ref rCharacter)
{
if (bSeaLoaded)
{
if (CheckAttribute(rCharacter,"surrendered")) {
int iOldNat = sti(rCharacter.nation);
rCharacter.nation = NEUTRAL_NATION;
}
SendMessage(rCharacter, "l", MSG_SHIP_FLAG_REFRESH);
if (CheckAttribute(rCharacter,"surrendered")) {
rCharacter.nation = iOldNat;
rCharacter = DeleteClass(&Flag, "Flag");
}
}
}
However, I have been thinking about another possibility that I think could work but need help with the command.
In AIShips I have successfully written code that will make the enemy ship strike his flag completely, but I used DeleteClass to achieve this which has the bad effect of deleting all flags on all ships in the area when one enemy ship surrenders.
There has got to be some other item I can insert there that will work. I tried delete entity and delete object already, but the game won't start when I put those in. I may have written them wrong.
Anyone have any ideas? This would be so great if I can get it to work. It looked so cool when the enemy flag disppeared with the alarm and dialogue "Captain she's struck her colors."
Here's the pertinent piece of code. The last line is the magic one I'm looking for. Help. MK
// boal 20.08.06 ïåðåðèñîâêà ôëàãà -->
void Ship_FlagRefresh(ref rCharacter)
{
if (bSeaLoaded)
{
if (CheckAttribute(rCharacter,"surrendered")) {
int iOldNat = sti(rCharacter.nation);
rCharacter.nation = NEUTRAL_NATION;
}
SendMessage(rCharacter, "l", MSG_SHIP_FLAG_REFRESH);
if (CheckAttribute(rCharacter,"surrendered")) {
rCharacter.nation = iOldNat;
rCharacter = DeleteClass(&Flag, "Flag");
}
}
}