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

Included in Build Joining Ambush/Random_Raid/Rapid_Raid functions together

danitim1

Sanka Da Vinci
Storm Modder
What does the random raid do and where to especify the exact location for it to happen?
 
The only reason I used "Rapid_Raid" is that you suggested it - before then I hadn't even heard of it. ;) "Rapid_Raid" has the advantage of a lot more arguments, so more control over the raiders. In detail, the definition is:
Code:
Rapid_Raid(type, custom_model, bmax, nation, mainrel, npcrel, alert, attackers_name, attackers_skill, attackers_perks, minhp, maxhp, bladetype, guntype, bladecategory, gunchance, armortype, armorchance)
type: general type of model, e.g. "soldiers", "sailors", or in your case "skeletons". Have a look through "initModels.c" for lines saying 'AssignModelType' to get some ideas of what can work here.
custom_model: Normally this will be "None" because you're using a standard model type. But if you put "Custom" as the type then whatever you put as "custom_model" will be used instead. Pick a specific model from "initModels.c" to use here.
bmax: how many attackers you want. You want 3.
nation: Nation of the attackers. Looking through "initModels.c", skeleton models are nation "CURSED", but "PIRATE" is valid. It's probably more significant if "type" is set to "soldiers", then the code knows what uniform to give them.
mainrel: how they react to you and your party. This should be "enemy" if you want them to attack you.
npcrel: how they react to everyone else. If this is "enemy" then they'll attack everyone else in sight which may spoil their fight with you!
alert: whatever you put here will show up on the screen when the raiders appear.
attackers_name: what the attackers will be called. If you kill them and loot their bodies, this is what you will see.
attackers_skill: the attackers' Melee, Accuracy and Defence skills will be set to this.
attackers_perks: ranges from 1 to 5, though 4 and 5 actually give 5 and 6 perks respectively. Look at the definition in "PROGRAM\elrapido.c" to see exactly which perks they get for which number.
minhp, maxhp: attackers will have random hit points (HP) somewhere between these values.
bladetype: if this is 0 then the attackers get random blades. If it's anything else between 1 and 27 then they get "blade1", "blade2",..., "blade27" - look through "initItems.c" to see what each blade is.
guntype: 0 = no gun, 1 = small pistol, 2 = duelling pistol, 3 = grapeshot pistol, 4 = horse pistol, 5 = musketoon, 6 = musket, 7 = grenade, 8 = poisoned throwing knife.
bladecategory: overrides "bladetype" to assign random blades from specific groups. Look through "elrapido.c" to see which groups. But if you're using "Rapid_Raid" rather than "Ambush" or "Random_Raid" then you probably want to control their weapons more closely anyway, so set this to 0 and the attackers will use "bladetype".
gunchance: percentage probability that each attacker will have the gun specified by "guntype".
armortype: 0 = none, 1 = cheap, 2 = battle, 3 = golden, 4 = cheap or battle, 5 = battle or golden.
armorchance: percentage chance that each attacker will have that armour.

So, from "Ardent":
Code:
Rapid_Raid("soldiers", "None", 5, SPAIN, "enemy", "friend", "Run! They're after you!", "Search party", 2, 1, 55, 75, 4, 6, 0, 80, 1, 20);
generates 5 Spanish soldiers who will attack you but leave everyone else alone. When they appear, you see the message "Run! They're after you!". The soldiers will all be named "Search party". They all have skill level 2, the "Basic Defence" perk, HP between 55 and 75, and are armed with cutlasses and muskets. "bladecategory" is 0 so they will have cutlasses. Each soldier has an 80% chance of getting a musket and a 20% chance of getting cheap armour. You can change the numbers to suit whatever you want the skeletons to be.
Code:
PChar.quest.pursuers = "active";
LAi_group_SetRelation("SPAIN_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
LAi_group_FightGroups("SPAIN_SOLDIERS", LAI_GROUP_PLAYER, true);
You probably don't want these. "PChar.quest.pursuers" is part of my code to have the search party follow you around town - the whole idea of the search party was to encourage you to leave town quickly! The "LAi_group..." lines set any normal Spanish guards in the area to attack you as well, just to make you feel really unwelcome in town.
 
I did this, and nothing happens, Why?

case "Pursuers2":
if (PChar.quest.pursuers != "cancel")
{
Ambush("Skeletons", "None", 3, PIRATE, "enemy");
PChar.quest.pursuers = "active";
LAi_group_SetRelation("SPAIN_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
LAi_group_FightGroups("SPAIN_SOLDIERS", LAI_GROUP_PLAYER, true);
}
break;
Here's the definition of "Ambush", from "PROGRAM\CCCFunctions.c":
Code:
Ambush(modeltype, bmax, mainrel, npcrel, locator)
Most of those are the same as "Rapid_Raid", though as you see, you have much less control over the strength of the attackers. But what you have in the brackets makes no sense to "Ambush", so you won't see any skeletons but you might see something in "error.log".

The one thing "Ambush" allows you to do which "Rapid_Raid" does not is specify where the attackers will appear, at "locator", but that locator must exist and it must be in group "reload". You'll need to go round the area with "VISIBLE_LOCATORS" set to 1 in "InternalSettings.h", find a suitable locator whose top line is "reload" and take note of the bottom line (top line is group, bottom line is locator name, "Ambush" assumes the group name to be "reload"). Then you'll probably need something like 'Ambush("Skeletons", 3, "enemy", "friend", "reload1");' - replace "reload1" with whatever locator name you found.

You appear to have copied my code to have the pursuers chase you around town. This consists of four parts:
case "Pursuers": sets a 5 second timer to trigger "Pursuit2", and triggers "pursuit_new_location" if you leave the area
case "pursuit_new_location": changes the status of the pursuers depending on their previous status
case "Pursuers2": unless they've been told to "cancel", either because you moved to a new location and temporarily lost them or because you left town, this is where the "Random_Raid" happens and they attack you
case "left_Havana": gives the pursuers a final "cancel" to prevent them from appearing if the 5 second timer was running when you left town, cancels the trigger from case "pursuers", and basically ends the pursuit. (And then gets on with the next bit of the story.)
Unless you want the skeletons chasing you all over the place, you don't need any of this. Assuming you have something to trigger case "Pursuers" in the first place, all you probably need is:
Code:
case "Pursuers":
    Ambush("Skeletons", 3, "enemy", "friend", "reload1");
break;
 
The only reason I used "Rapid_Raid" is that you suggested it - before then I hadn't even heard of it. ;)
I did? When? I must have mistyped and meant "Ambush" or "Random_Raid".
There being three separate functions to do almost the same thing is really annoying and confusing. :facepalm
 
I did? When? I must have mistyped and meant "Ambush" or "Random_Raid".
There being three separate functions to do almost the same thing is really annoying and confusing. :facepalm
There are already two functions that do that:
The Ambush one from CCCFunctions.c is used quite a lot in various spots of the code.
There is also the Rapid_Raid one from elrapido.c for if you need more control over what happens.
I preferred the extra control. ;) See the definitions above for what "Rapid_Raid" lets you do that "Ambush" doesn't, and vice versa. "Ambush" lets you specify where the attackers will appear, "Rapid_Raid" lets you specify pretty much everything except that.
 
I preferred the extra control. ;) See the definitions above for what "Rapid_Raid" lets you do that "Ambush" doesn't, and vice versa. "Ambush" lets you specify where the attackers will appear, "Rapid_Raid" lets you specify pretty much everything except that.
I can imagine why you'd want to use it. But there being multiple separate functions for the same thing is bad coding.

Ideally we should make ONE function and have the other ones relayed to the "MAIN" one.
That is what I did last weekend for Random_Raid and Ambush, but I didn't do anything for Rapid_Raid.
 
Suggestion 1: since "Rapid_Raid" allows you to specify more choices than the others, make that the one unified function and have the others call it, automatically filling in the things they don't currently let you choose for yourself. This would mean adding the "locator" argument to "Rapid_Raid" so that it can match "Ambush", but since I'm the only one currently using "Rapid_Raid", doing that would probably have less side-effects than modifying any of the others to match the flexibility of "Rapid_Raid".

Suggestion 2: move discussion of the relative merits of "Rapid_Raid", "Random_Raid" and "Ambush" to the "Build Beta and Brainstorming" section to avoid cluttering this thread with stuff not related to the storyline. :)
 
Suggestion 1: since "Rapid_Raid" allows you to specify more choices than the others, make that the one unified function and have the others call it, automatically filling in the things they don't currently let you choose for yourself. This would mean adding the "locator" argument to "Rapid_Raid" so that it can match "Ambush", but since I'm the only one currently using "Rapid_Raid", doing that would probably have less side-effects than modifying any of the others to match the flexibility of "Rapid_Raid".
Agreed; that does indeed sound like the most sensible thing to do.

We might even be able to get rid of the "locator" input altogether as it only really applies for "Ambush" and on that one it is used EXACTLY ONCE.
I think the reason was to avoid the "enemies generated on boat locator" problem in one specific location.
However, that could happen in ALL locations and I already made a more proper fix for that a few months ago.

I already made a start by merging Ambush and Random_Raid.
Next up would be:
1. Check Rapid_Raid to ensure it is equally up-to-date as Ambush is.
2. Consider which of the various input arguments are actually needed
3. Clean up the Rapid_Raid function by getting rid of unnecessary parameters and using intended functions wherever possible
4. Make BOTH other functions point to Rapid_Raid instead.

While I'd like to see this done, I probably won't get to it soon. Anyone else interested in having a look into it?

Suggestion 2: move discussion of the relative merits of "Rapid_Raid", "Random_Raid" and "Ambush" to the "Build Beta and Brainstorming" section to avoid cluttering this thread with stuff not related to the storyline. :)
Good idea again. Done! :cheers
 
So, how am I supposed to do it, like, where do I especify a locator with Rapid_raid for them to spawn??
 
At the moment, if you want to specify a locator then you'll need to use "Ambush" as that's the only one which takes locator as an argument. The others automatically find a locator and spawn the attackers there.
 
Agreed; that does indeed sound like the most sensible thing to do.

We might even be able to get rid of the "locator" input altogether as it only really applies for "Ambush" and on that one it is used EXACTLY ONCE.
I think the reason was to avoid the "enemies generated on boat locator" problem in one specific location.
However, that could happen in ALL locations and I already made a more proper fix for that a few months ago.

I already made a start by merging Ambush and Random_Raid.
Next up would be:
1. Check Rapid_Raid to ensure it is equally up-to-date as Ambush is.
2. Consider which of the various input arguments are actually needed
3. Clean up the Rapid_Raid function by getting rid of unnecessary parameters and using intended functions wherever possible
4. Make BOTH other functions point to Rapid_Raid instead.

While I'd like to see this done, I probably won't get to it soon. Anyone else interested in having a look into it?
I might have a look at updating it (@Jack Rackham has already done a bit of work by correcting the amount of ammo to be found on dead raiders with muskets). There are a lot of blade types which presumably didn't exist when "Rapid_Raid" was written, which is why it only accepts "bladetype" up to 27 and there's now up to "blade51".

The whole point of "Rapid_Raid" is to give maximum flexibility, hence the many input arguments. The only one I can think of which might be redundant is "custom_model"; using that would mean a squad of clones all using that model. If you're going to just have one attacker with your choice of custom model, as suggested in one of the examples in the code for "Rapid_Raid", then you may as well just generate a single fantom using that model and do whatever you like with it. Otherwise, if you want to call a random attack with most of the variables filled in for you, use "Ambush" or "Random_Raid" instead. If anything, "Rapid_Raid" needs one more argument, "locator", if it is to do the job of "Ambush". Preferably "group" as well, so you aren't limited to "reload" locators. And I may have use for that.

I was considering replacing a chunk of code in "Ardent" with an "Ambush" call. At the time when I wrote it, I didn't know "Ambush" took "locator" as an input, and "Rapid_Raid" dumps the attackers on the first available locator - which, due to the shortage of locators in Santiago, was right on top of you! But I wanted them to start off at the gate from port to town. So I did it "Hornblower" style with a load of "LAi_CreateFantomCharacter" commands. And since you're considering deleting the "locator" input from "Ambush", I'd better leave them as they are!
 
I might have a look at updating it (@Jack Rackham has already done a bit of work by correcting the amount of ammo to be found on dead raiders with muskets). There are a lot of blade types which presumably didn't exist when "Rapid_Raid" was written, which is why it only accepts "bladetype" up to 27 and there's now up to "blade51".
'LAi_CreateFantomCharacterEx' does already take care of random weapon assignments.
If we're not happy with how those weapons are assigned, the best solution would be to edit the 'LAi_NPC_Equip' function until we ARE happy with it.
Possibly allow the exact blade/gun ID to be included as an input parameter, but the hard-coded series of weapons in "Rapid_Raid" should be removed.
It is better to have it handled automatically based on whatever is available in initItems.c .
Otherwise it overrides everything and is never updated when new stuff is added.

Likewise, all skill/ability code in there can be skipped; the Levelling system is supposed to take care of all of that.

The whole point of "Rapid_Raid" is to give maximum flexibility, hence the many input arguments. The only one I can think of which might be redundant is "custom_model"; using that would mean a squad of clones all using that model. If you're going to just have one attacker with your choice of custom model, as suggested in one of the examples in the code for "Rapid_Raid", then you may as well just generate a single fantom using that model and do whatever you like with it.
Very true. And since you can read the reference to that character, you can customize the character whichever way you like afterwards.

I was considering replacing a chunk of code in "Ardent" with an "Ambush" call. At the time when I wrote it, I didn't know "Ambush" took "locator" as an input, and "Rapid_Raid" dumps the attackers on the first available locator - which, due to the shortage of locators in Santiago, was right on top of you! But I wanted them to start off at the gate from port to town. So I did it "Hornblower" style with a load of "LAi_CreateFantomCharacter" commands. And since you're considering deleting the "locator" input from "Ambush", I'd better leave them as they are!
I was considering that specifically because it isn't used. But if you DO want to make use of it, we might as well keep that functionality.
No worries there. :doff

So this makes me wonder: What added control DO you need from the "Rapid_Raid" function?
As far as I can tell from the code, you might as well use "Ambush" and "Random_Raid", no?
 
From the newest update:
Code:
void Random_Raid(string modeltype, int bmax, int nation, string mainrel, string npcrel, string alert)
Compared to:
Code:
void Rapid_Raid(string type, string custom_model, int bmax, int nation, string mainrel, string npcrel, string alert, string attackers_name, int attackers_skill, int attackers_perks, int minhp, int maxhp, int bladetype, int guntype, int bladecategory, int gunchance, int armortype, int armorchance)
Control of skill, perks, HP, weapon and armour type, and chances of gun and armour, allows you to make the encounter easier or harder. Case in point, at the moment the "Rapid_Raid" right after you escape prison in "Ardent" is not too tough, meaning they're a source of free muskets and a good way to test @Jack Rackham's musket code. In due time I'm likely to make them tougher - their purpose is to scare you into getting out of town ASAP, not to provide you with free target practice and weapons!

The alert probably isn't needed - if you want to give an on-screen message, a "logit" command right before the "Rapid_Raid" would do the job. But although I haven't had much use for "attackers_name" yet, I can imagine someone wanting to use it as a source of information to the player - if you've just been attacked by a squad whose bodies are identifiable as "Cardinal Richelieu's guard" then you can learn who's after you, for example.

The new "Random_Raid" still takes "nation" as an argument but doesn't seem to do anything with it. So if you're ambushed by soldiers, they have to be soldiers of the nation whose location you're in. You can't be walking through the jungle of Jamaica and be jumped by a French squad, as part of a storyline in which you discover a secret French invasion, for example.

So this makes me wonder: What added control DO you need from the "Rapid_Raid" function?
Pretty much all of it! :D
 
Pretty much all of it! :D
Some alternate thoughts:

- The current Rapid_Raid function sets skills and abilities in such a way that it either overrides the Levelling system OR is overridden by the Levelling system; neither is a very good idea.
The function that actually creates the characters takes an "offset" value as input. With this, you can enter "0" to make their level similar to the player or you can use positive/negative values to make it easier/harder.
I would propose using that single-value input instead of manually setting skills/abilities/HP the way it currently does.
That would make it work with the systems that are already in place. If those systems don't do what is needed, that is a separate issue altogether.

- The same applies for weapons; generally NPCs should be auto-equipped with appropriate weapons. My suggestion would be to let that happen.
IF you indeed want to override that, I'd suggest allowing a single "bladeID", "gunID" and "armourID" as input and then ALL characters generated get to use that same weapon.
When filling "", then the automated one is kept. If filling "none", then their weapons will be taken away.

Eventually we do need to modify the automated equip function to hand out more appropriate weapons in certain cases, but that is for future development.
But what I would prefer to NOT have is the hardcoded situation currently in Rapid_Raid .

- Any specific "attacks_name" seems quite unreleastic to me. The game has always had quite a lot of characters named with their type instead of an actual name.
But we have been moving away from that. I'd suggest to keep moving in that direction, until such time that someone REALLY wants to make use of that.
Which, with a bit of luck, will never happen. Any quest clues can be handled in any other number of ways (dialogs, questbook entries, item descriptions, etc.)

- One additional input that could be added is the "officer type" one. If I recall, @Levis added that as an optional input for the function that generated these temporary characters.
With that, you can determine how their skills are distributed.

You reckon that sounds reasonable?
 
Some alternate thoughts:

- The current Rapid_Raid function sets skills and abilities in such a way that it either overrides the Levelling system OR is overridden by the Levelling system; neither is a very good idea.
The function that actually creates the characters takes an "offset" value as input. With this, you can enter "0" to make their level similar to the player or you can use positive/negative values to make it easier/harder.
I would propose using that single-value input instead of manually setting skills/abilities/HP the way it currently does.
That would make it work with the systems that are already in place. If those systems don't do what is needed, that is a separate issue altogether.
Right now I don't trust the Levelling system to reliably handle the player's and officers' levels, let alone NPC's. Anyway, since the whole idea is to have "Rapid_Raid" as the one in which everything can be specified and then have "Random_Raid" and "Ambush" fill in some of it automatically, you could have it both ways. If skills, abilities and HP aren't specified then they can be done automatically. If someone does need the level of control which is already currently provided, why take it away?

- The same applies for weapons; generally NPCs should be auto-equipped with appropriate weapons. My suggestion would be to let that happen.
IF you indeed want to override that, I'd suggest allowing a single "bladeID", "gunID" and "armourID" as input and then ALL characters generated get to use that same weapon.
When filling "", then the automated one is kept. If filling "none", then their weapons will be taken away.
That seems fair enough. It basically amounts to losing the "bladecategory" argument and the part of the code which allows the attackers a random choice of two armour types. If you need to specify the exact equipment then you'll be specifying it exactly, otherwise auto-equip will do.

- Any specific "attacks_name" seems quite unreleastic to me. The game has always had quite a lot of characters named with their type instead of an actual name.
But we have been moving away from that. I'd suggest to keep moving in that direction, until such time that someone REALLY wants to make use of that.
Which, with a bit of luck, will never happen. Any quest clues can be handled in any other number of ways (dialogs, questbook entries, item descriptions, etc.)
Are you suggesting that the attackers get the same sort of random names that soldiers and boarders currently get? That is what is unrealistic - it never gets the nationality right, which means you're quite likely to be attacked by a French soldier with an English name. Again, why remove a level of control which is already in place?

- One additional input that could be added is the "officer type" one. If I recall, @Levis added that as an optional input for the function that generated these temporary characters.
With that, you can determine how their skills are distributed.
That should not be necessary. The comments in "Rapid_Raid" already indicate that one way to do this is to call it again with 1 attacker, type set to "Captains". It has code built in to give them the "Leadership" and "Gunman" perks as well as some extra loot, and only allowing them pistols, not muskets. Alternatively, just call 'LAi_CreateFantomCharacterEx' and assign your choice of perks and loot to the single commander yourself.

The function which generates temporary "fantom" characters is:
Code:
ref LAi_CreateFantomCharacter(bool isfriend, int offset, bool genrank, bool hasblade, float hasgun, string model, string group, string locator)
Except that this literally does nothing more than call:
Code:
ref LAi_CreateFantomCharacterEx(bool isfriend, int offset, bool genrank, bool hasblade, float hasgun, string model, string ani, string group, string locator)
The input you're probably thinking of is "genrank", which if set causes the fantom to be a level 1 self-propelled target, otherwise creates an officer of type "RANDCHAR", i.e. fighter. If you want attackers who aren't officers but are more capable than level 1 then you have to specify everything yourself, which is what "Rapid_Raid" lets you do.

Alternatively, you just do it "Hornblower" style, which is to have a whole series of blocks of near identical code each of which contains a call on 'LAi_CreateFantomCharacterEx' followed by lines to set the attacker the way you want him. Messy, but then it no longer matters what happens to "Rapid_Raid", "Random_Raid" and "Ambush". ;)
 
Right now I don't trust the Levelling system to reliably handle the player's and officers' levels, let alone NPC's.
That is a different issue altogether. At the moment, fact is that it does handle it.
And I still hope it can be brought to the point where that is actually OK.

If skills, abilities and HP aren't specified then they can be done automatically. If someone does need the level of control which is already currently provided, why take it away?
Because hardcoding them is bad practice?

That seems fair enough. It basically amounts to losing the "bladecategory" argument and the part of the code which allows the attackers a random choice of two armour types. If you need to specify the exact equipment then you'll be specifying it exactly, otherwise auto-equip will do.
:doff

Are you suggesting that the attackers get the same sort of random names that soldiers and boarders currently get? That is what is unrealistic - it never gets the nationality right, which means you're quite likely to be attacked by a French soldier with an English name. Again, why remove a level of control which is already in place?
If the characters get a wrong nation name, then the character nationalities aren't set correctly.
I know the function that does that works fine; I've used it plenty times before.

And removing a level of control that goes completely unused? I see no problem there.

That should not be necessary. The comments in "Rapid_Raid" already indicate that one way to do this is to call it again with 1 attacker, type set to "Captains". It has code built in to give them the "Leadership" and "Gunman" perks as well as some extra loot, and only allowing them pistols, not muskets. Alternatively, just call 'LAi_CreateFantomCharacterEx' and assign your choice of perks and loot to the single commander yourself.
The officer type controls the type of skills and abilities the characters get.
If you generate a bunch of "fighters" they'll probably end up tougher than a bunch of "sailors".

The input you're probably thinking of is "genrank", which if set causes the fantom to be a level 1 self-propelled target, otherwise creates an officer of type "RANDCHAR", i.e. fighter.
That was indeed the variable I was thinking of; it worked fine before.
But it looks like @Levis' work has changed that as now I don't see it used AT ALL.
So probably the code needs changing a bit there so that it IS used like did before.

Your description matches with the 'bool genrank' input variable though, as I could see it having that effect.
But 'int offset' does NOT do what you describe. (Mainly because apparently it now does nothing at all.... :facepalm )

Alternatively, you just do it "Hornblower" style, which is to have a whole series of blocks of near identical code each of which contains a call on 'LAi_CreateFantomCharacterEx' followed by lines to set the attacker the way you want him. Messy, but then it no longer matters what happens to "Rapid_Raid", "Random_Raid" and "Ambush". ;)
True; that always remains an option.

Though of course if we can modify these functions to be able to handle some of that, that would be quite nice.
If you want separate characters generated at specific locators though, I don't see how one single function can handle that anyway.
 
genrank shouldn't do much anymore indeed ...
Offset should still work tough, if not I made a mistake there....
 
@Levis: Looking at the code, that is definitely not the case.
Genrank is still used and offset is not.
 
Because hardcoding them is bad practice?
Hardcoding would be fixing the values, as opposed to setting them by variables as happens now. The point of "Rapid_Raid", as opposed to the more limited "Ambush" and "Random_Raid", is to allow the quest-writer to use those variable to set up the attacker the way he wants rather than accept what pre-defined (hard-coded? ;)) functions supply.

If the characters get a wrong nation name, then the character nationalities aren't set correctly.
I know the function that does that works fine; I've used it plenty times before.

Something doesn't work fine, the evidence being the various soldiers and boarders whose dead bodies had wrong nationality names when I looted them.

The officer type controls the type of skills and abilities the characters get.
If you generate a bunch of "fighters" they'll probably end up tougher than a bunch of "sailors".
So you're stuck if you actually want a bunch of sailors, then.

Though of course if we can modify these functions to be able to handle some of that, that would be quite nice.
"Random_Raid" already handles it. The proposal appears to be to remove some of that handling, though perhaps we could indeed modify it again to put the handling back. xD

If you want separate characters generated at specific locators though, I don't see how one single function can handle that anyway.
It is indeed true that having the different attackers spawn at different locators would require (a) separate 'LAi_CreateFantomCharacterEx' and skill/perk/weapon assignments for each, and (b) enough locators in close proximity. Otherwise you just spawn the whole lot on one locator, then they'll scatter almost at once as they rush to attack you. That's what "Ambush" does, and what I'd like "Rapid_Raid" to do as well. Best is if the locator is near a door or gate, then it looks as though the squad has just charged through that door or gate. The Martinique beach battle in "Hornblower" does something along those lines, though it really does need separate 'LAi_CreateFantomCharacterEx' lines because each French soldier spawns at the same entry point, then walks to a different locator to make up the battle formation. The effect is that the troops have just marched in from the path to town.
 
Hardcoding would be fixing the values, as opposed to setting them by variables as happens now. The point of "Rapid_Raid", as opposed to the more limited "Ambush" and "Random_Raid", is to allow the quest-writer to use those variable to set up the attacker the way he wants rather than accept what pre-defined (hard-coded? ;)) functions supply.
"Rapid_Raid" has several levels of skills hardcoded in there. That bypasses the Levelling system and is therefore something I would prefer to not have to do.
The Levelling system itself is 100% NOT hardcoded. It looks at the appropriate officer type and the perks defined in the init file and assigns things somewhat randomly based on that.

Specifying a rank (or rank offset) and officer type should give quite a bit of control by itself.
Of course this all hangs on Levelling actually working as intended.
But while obviously related, that is technically a separate issue altogether.

Something doesn't work fine, the evidence being the various soldiers and boarders whose dead bodies had wrong nationality names when I looted them.
Please make a Bug Tracker entry for that.
Also indicate exactly the type of NPCs and the situation where they are generated. It could be that they're initialized in the wrong way.
If done correctly, the nation-name function does do what it is meant to.

So you're stuck if you actually want a bunch of sailors, then.
I don't think I follow you there? In what way are you stuck?
If you want characters who look like sailors, but have "fighter" skills, that should be totally possible. :confused:

"Random_Raid" already handles it. The proposal appears to be to remove some of that handling, though perhaps we could indeed modify it again to put the handling back. xD
But you were saying the Hornblower scenes do NOT use "Random_Raid"? Confused again.... :oops:

It is indeed true that having the different attackers spawn at different locators would require (a) separate 'LAi_CreateFantomCharacterEx' and skill/perk/weapon assignments for each, and (b) enough locators in close proximity. Otherwise you just spawn the whole lot on one locator, then they'll scatter almost at once as they rush to attack you. That's what "Ambush" does, and what I'd like "Rapid_Raid" to do as well. Best is if the locator is near a door or gate, then it looks as though the squad has just charged through that door or gate. The Martinique beach battle in "Hornblower" does something along those lines, though it really does need separate 'LAi_CreateFantomCharacterEx' lines because each French soldier spawns at the same entry point, then walks to a different locator to make up the battle formation. The effect is that the troops have just marched in from the path to town.
One thing that COULD be made possible is to generate different characters in the attacking group at randomly chosen locators of a certain group.
That should not be too difficult. Of course then they'd end up being generated all around you. I think that is what happened with the "Merchant Guild Reinforcements" (though that may have changed now...? :unsure ).
 
Back
Top