• 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!

Wikki tutorials(adding characters)Errors

There can be as many as you have memory for. Beyond a certain point (it may be 196, I dunno) you'll just have to expand the characters array.
The current limit btw (total, not free slots) is 1000, minus fantoms.
 
There should be a better way to put characters into the game because if we're all modding at once, someone could use slot 151, for instance, and then someone else could come along and use the same slot - thus when the mod is installed, the other will be overwritten...
 
Characters operate based on IDs, rather than slots. The actual slot number is never referenced directly. So yeah, it does what you want it to in that regard. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Do you mean I don't really have to list my characters THERE in order for my characters to work in the game?

If the slot # is never referenced directly, why is it there? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

(I swear, I'm going to make more "confused" icons for this forum!) (HA!)
 
Hi, I'm bit confused with this myself, i know a little about programming but i'm probably just not spotting the obvious.

In the error.log its saying the variable Character (line 22) is repeated, it is in the first function, but this is what the tutorial said to do if your not using a post build version.

BTW where might i find a post build version? might be helpful to save on coding time, thanks. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Catalina, i think what is meant by not referencing the slot directly, is its an array slot, you just need to act on the id thats placed in it at the time, not a fixed location in the array. I believe in this context it means you can have varying character id's placed into the array when it is loaded.

Below is a sample of the code i'm entering, its just changing the second instances of character to something else that i need to do i think. Character being the defining variable name for that specific character at the time. I'll investigate a bit tomorrow.


void InitMARKEXTRAENCOUNTERS()

ref GetNewCharacter(string Fullname)
{
int i;
ref Character;
for(i=0; i<TOTAL_CHARACTERS; i++)
{
makeref(Character,Characters);
if(Character.fullname == Fullname || Character.id == "0")
{
break;
}
}
return Character;
}

{

ref Character = GetNewCharacter("Bartholomew Roberts");
character.name = "Bartholomew";
character.lastname = "Roberts";
character.id = "Bartholomew Roberts";
character.model = "blaze";
character.sex = "man";
character.sound_type = "seaman";
character.location = "Oxbay_port";
character.location.group = "goto";
character.location.locator = "goto1";
character.Dialog.Filename = "Oxbay citizen_dialog.c";
character.greeting = "Gr_Oxbay Citizen";
character.quest.area = "Oxbay";
character.nation = ENGLAND;
facemaker(character);
LAi_SetCitizenType(character);
LAi_group_Movecharacter(character, "ENGLAND_CITIZENS");
}




Thx for any help.
 
Cat: Um, where do you mean by "there"? Or by slot, for that matter. {confused}
You can create (well, one never _creates_ a character, one overwrites a blank one...that's what charinit*.* does FTM) a character anywhere you like; reinit.c, quests_reactions.c, a new file, whatever.

Maran: I think the problem is that your function declaration has to be in one piece. I.e. put the void InitMA.... line right above the { that starts your code.
 
Thanks for the help nathan, i should of seen that obvious point.

Unfortunately its not that simple as ref character is still called twice. I’ve been fiddling around for several hours using other people's code as a template but i've had no joy yet <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

I can get the game to run but no NPC to appear, best code I can come up with is:

void InitMARKEXTRAENCOUNTERS()

{
int i;
ref Character;
for(i=0; i<TOTAL_CHARACTERS; i++)
{
makeref(Character,Characters);
}

character.name = "Bartholomew";
character.lastname = "Roberts";
character.id = "Bartholomew Roberts";
character.model = "blaze";
character.sex = "man";
character.sound_type = "seaman";
character.location = "Oxbay_port";
character.location.group = "goto";
character.location.locator = "goto1";
character.Dialog.Filename = "Oxbay citizen_dialog.c";
character.greeting = "Gr_Oxbay Citizen";
character.quest.area = "Oxbay";
character.nation = ENGLAND;
facemaker(character);
LAi_SetCitizenType(character);
LAi_group_Movecharacter(character, "ENGLAND_CITIZENS");
}


Which seems like its stripped down to its bare bones and should work.

I haven’t had a whole lot of time last couple of days but I’m off tomorrow so I’ll crack it then or finish my coffee store trying <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

Cheers anyway, love what you guys are doing here btw, really have made a fairly good game, a great game <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> I'm still confused... But that's okay... I'll muddle through, not terribly important right now... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin-->There can be as many as you have memory for. Beyond a certain point (it may be 196, I dunno) you'll just have to expand the characters array.
The current limit btw (total, not free slots) is 1000, minus fantoms.[/quote]

thx for upgrading my "damm memory", as it is .... it haults sometimes ....
 
<!--`QuoteBegin-jack_sparrow_jr`+--><div class='quotetop'>QUOTE(jack_sparrow_jr)</div><div class='quotemain'><!--QuoteEBegin-->thx for upgrading my "damm memory", as it is .... it haults sometimes ....[/quote] <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> I know *exactly* what you mean!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
The problem i was refering to was that it was called gGetNewCharacter back when i was running through the tutorial, anyways other than that typo I didn't run into any other problems with scheffnow's tutorial. Well any problems getting a character to show up.

and as for my tutorial it basically says copy another NPC, change what you will.

You'll have to get the error logging to work and post that for us to know what the problem is.
 
Back
Top