He should more properly have a section in
quests_reaction.c
and things regarding him would be an interplay between that file and his C and H files, and the file where he is defined - if you used Rys Bloom as a template I assume that is
Officers.c
. Speaking of which, here is a suggestion for his code block:
Code:
makeref(ch,Characters[n]); //Rex Hathaway
ch.name = "Rex";
ch.lastname = "Hathaway";
ch.id = "Rex Hathaway";
ch.model = "soldier_eng5";
ch.sex = "man";
ch.sound_type = "soldier";
ch.location = "Redmond_tavern";
ch.location.group = "goto";
ch.location.locator = "goto16";
ch.Dialog.Filename = "Rex Hathaway_dialog.c";
//ch.greeting = "Gr_Rex Hathaway";
ch.rank = 10;
ch.reputation = "45";
ch.experience = CalculateExperienceFromRank(10) + (CalculateExperienceFromRank(10)/10 + rand(10000));
ch.skill.Leadership = "5";
ch.skill.Fencing = "7";
ch.skill.Sailing = "1";
ch.skill.Accuracy = "1";
ch.skill.Cannons = "1";
ch.skill.Grappling = "1";
ch.skill.Repair = "1";
ch.skill.Defence = "1";
ch.skill.Commerce = "1";
ch.skill.Sneak = "1";
ch.money = "0";
LAi_SetHP(ch, LAI_DEFAULT_HP + (makeint(sti(ch.rank)-1)*5), LAI_DEFAULT_HP_MAX + (makeint(sti(ch.rank)-1)*5));
ch.perks.list.BasicDefense = true;
ch.perks.list.AdvancedDefense = true;
ch.perks.list.CriticalHit = true;
ch.perks.list.SwordplayProfessional = true;
ch.perks.list.Gunman = true;
ch.perks.list.GunProfessional = true;
GiveItem2Character(ch, "blade1");
ch.equip.blade = "blade1";
GiveItem2Character(ch, "pistol2");
ch.equip.gun = "pistol2";
LAi_SetStayType(ch);
n = n + 1;
You mentioned that he should be an elite soldier so it makes sense that he starts at a higher level and with a Melee skill of at least 7. Maybe his Leadership skill should be a bit higher than 1 as well. Accuracy only affects ship cannons, not pistols. Defense only affects ship combat, not melee combat. The other ship skills and the Commerce skill might not be relevant for him, and from your description of him he does not seem to be very lucky (Luck is "Sneak" in the code).
His HP is set to calculate according to his level.
As an elite soldier he should not only have a high Melee skill but also the Professional Fencer and Professional Gunman abilities, and thus their prerequisites. This gives him six abilities so his level should at least be 6 - I've set it to 10 here so per the game mechanic rules he could have four more but since no other abilities might be relevant for him the rules can be bent here a little so that he only has these. Maybe he could also have the Rush ability. You could also give him some other abilities or give him available ability points for the rest of the levels to assign in-game.
He has a standard Saber, and also a Long pistol as that might be appropriate for a soldier in this game. Remove the lines for the pistol if you don't want him to start with one.
This might be an appropriate code block for him. Adjust it to your liking.
For how to give him more functionality we can look at Rys Bloom as an example again. For example this in
Rys Bloom_dialog.c
:
Code:
case "exit_hire":
Diag.TempNode = "empty";
Diag.CurrentNode = Diag.TempNode;
DialogExit();
AddDialogExitQuest("rys_becomes_officer");
break;
Does this in
quests_reaction.c
:
Code:
case "rys_becomes_officer":
AddMoneyToCharacter(pchar, -500);
AddPassenger(Pchar, characterFromID("Rys Bloom"), 0);
LAi_SetOfficerType(characterFromID("Rys Bloom"));
characters[getCharacterIndex("Rys bloom")].location = "none";
break;
You would then add things to the dialog file and quest file as appropriate. For moving location and resuming the conversation it would look something like this in the files:
Code:
case "somedialognode":
Diag.CurrentNode = "someotherdialognode";
DialogExit();
AddDialogExitQuest("somequestcase");
break;
Code:
case "somequestcase":
ChangeCharacterAddress(characterFromID("Rex Hathaway"), "somelocation", "somelocator");
DoQuestReloadToLocation("somelocation", "somelocatorgroup", "somelocator", "someotherquestcase");
break;
case "someotherquestcase":
LAi_ActorDialogNow(characterFromID("Rex Hathaway"), pchar, "anotherquestcase", -1);
break;
You can look at existing cases to get an idea of what to do. It's been a while since I've done this so I might be forgetting something, but this should generally be how to make a character work.