• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Does this look right or does it need to be fixed?

LordDrow

Pirate Geek Extraordinaire
Staff member
Storm Modder
Storm Modeller
Does this following code snippet look right, or does there appear to be a semi-colon out of place in it?

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void WriteAdditionalLocators(int locIdx)
{
    string loadFilePath = FindFile("Locations", "*_locators.c", "MAXIMUS_locators.c");
    if(loadFilePath=="") return;
    if(LoadSegment(loadFilePath))
    {
        characters[GetMainCharacterIndex()].locIndex = locIdx;
        InitAdditionalLocators();
        if(CheckAttribute(GetMainCharacter(),"newGameStart") && sti(characters[GetMainCharacterIndex()].newGameStart)==1) { AddNewLocators(); DeleteAttribute(GetMainCharacter(),"newGameStart"); }
        UnloadSegment(loadFilePath);
        DeleteAttribute(GetMainCharacter(),"locIndex");
    }
}<!--c2--></div><!--ec2-->

Thanks!

Cap'n Drow
 
Looks good to me. What semicolon are you referring to? <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
The stuff in the following line:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if(CheckAttribute(GetMainCharacter(),"newGameStart") && sti(characters[GetMainCharacterIndex()].newGameStart)==1) { AddNewLocators(); DeleteAttribute(GetMainCharacter(),"newGameStart"); }<!--c2--></div><!--ec2-->

I think having all those extra brackets in there is throwing me off, but wanted to be sure.

Cap'n Drow
 
Here's the same code with some enters added:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if(CheckAttribute(GetMainCharacter(),"newGameStart") && sti(characters[GetMainCharacterIndex()].newGameStart)==1)
{
      AddNewLocators();
      DeleteAttribute(GetMainCharacter(),"newGameStart");
}<!--c2--></div><!--ec2-->Looks pretty normal now. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

BTW: How come you're posting some of Maximus' code on the AoP modding forum? Are you working on something you're not telling us? <img src="style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" />

BTW 2: If you really are working on porting (parts of) the PotC code to AoP, you really should contact Maximus himself, because he is in fact working on just that. <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
I could answer your first question, but then I'd have to kill ya. **grins**

As to contacting Maximus, I didn't realize he was still active in the community.

I'll have to give him a shout.

Cap'n Drow
 
You might want to try Notepad++ as an editor. It does a nice job of bracket matching. It is also free.

Though, after updating to the newest version I have to go find the function list plug-in, and others again.

Greg.
 
I'm using Notepad++ back home for PotC modding; indeed works perfectly fine.

We don't frequently hear from Maximus anymore, but he does occasionally PM Pirate_KK or me to say he's still modding.
And right now he has made it his project to port the Build Mod to Age of Pirates. Apparently he has had some success with that.
He actually asked Pirate_KK for help, but he already has a lot on his plate.
So I'm pretty sure he'll be quite happy to hear from you if you're doing what I think you're doing. <img src="style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" />
 
Back
Top