iamthejarha
Landlubber
I'd like to create a small mod that allows me to change my main ship's name through a text file, the way build 11 uses BuildSettings.h to change the main character's name. Why do I want to do it that way? Simple; I want to have characters like apostrophes, which aren't available from the `in-game` 'keyboard.' I've been digging through code for hours, and the only things I've found on the `name-change` function are these small bits of code:
<i>In PROGRAMBuildSettings.h:</i>
#define FIRSTNAME ""
#define LASTNAME ""
<i>In PROGRAMCONTROLSinit_pc.c:</i>
CI_CreateAndSetControls( "", "NK_NameChange", CI_GetKeyCode("KEY_N"), 0, false );
<i>In PROGRAMseadogs.c:</i>
if(ControlName == "NK_NameChange") { ChangeName(GetMainCharacter()); }
<i>In PROGRAMCharacterscharacters_init.c:</i>
ChangeName(GetMainCharacter()); // NK, this sets mainchar name to name in ..BuildSettings.h
I haven't found a reference to the "ChangeName()" function <i>anywhere</i>. Is it built into the game engine or something? How does it reference the globals in BuildSettings.h? Essentially, <i>how does it work?</i> If anybody can help me figure this out, I'd greatly appreciate it. I want to use essentially the same process to change my ship name, but I'm having a rough go at it, to put it mildly.
<i>In PROGRAMBuildSettings.h:</i>
#define FIRSTNAME ""
#define LASTNAME ""
<i>In PROGRAMCONTROLSinit_pc.c:</i>
CI_CreateAndSetControls( "", "NK_NameChange", CI_GetKeyCode("KEY_N"), 0, false );
<i>In PROGRAMseadogs.c:</i>
if(ControlName == "NK_NameChange") { ChangeName(GetMainCharacter()); }
<i>In PROGRAMCharacterscharacters_init.c:</i>
ChangeName(GetMainCharacter()); // NK, this sets mainchar name to name in ..BuildSettings.h
I haven't found a reference to the "ChangeName()" function <i>anywhere</i>. Is it built into the game engine or something? How does it reference the globals in BuildSettings.h? Essentially, <i>how does it work?</i> If anybody can help me figure this out, I'd greatly appreciate it. I want to use essentially the same process to change my ship name, but I'm having a rough go at it, to put it mildly.