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!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
Rapid_Raid(type, custom_model, bmax, nation, mainrel, npcrel, alert, attackers_name, attackers_skill, attackers_perks, minhp, maxhp, bladetype, guntype, bladecategory, gunchance, armortype, armorchance)
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);
PChar.quest.pursuers = "active";
LAi_group_SetRelation("SPAIN_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
LAi_group_FightGroups("SPAIN_SOLDIERS", LAI_GROUP_PLAYER, true);
Here's the definition of "Ambush", from "PROGRAM\CCCFunctions.c":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;
Ambush(modeltype, bmax, mainrel, npcrel, locator)
case "Pursuers":
Ambush("Skeletons", 3, "enemy", "friend", "reload1");
break;
I did? When? I must have mistyped and meant "Ambush" or "Random_Raid".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.![]()
I preferred the extra control.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 can imagine why you'd want to use it. But there being multiple separate functions for the same thing is bad coding.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.
Agreed; that does indeed sound like the most sensible thing to do.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".
Good idea again. Done!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.![]()
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".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?
'LAi_CreateFantomCharacterEx' does already take care of random weapon assignments.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".
Very true. And since you can read the reference to that character, you can customize the character whichever way you like afterwards.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.
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.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!
void Random_Raid(string modeltype, int bmax, int nation, string mainrel, string npcrel, string alert)
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)
Pretty much all of it!So this makes me wonder: What added control DO you need from the "Rapid_Raid" function?
Some alternate thoughts:Pretty much all of it!![]()
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?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.
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.- 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.
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?- 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.)
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.- 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.
ref LAi_CreateFantomCharacter(bool isfriend, int offset, bool genrank, bool hasblade, float hasgun, string model, string group, string locator)
ref LAi_CreateFantomCharacterEx(bool isfriend, int offset, bool genrank, bool hasblade, float hasgun, string model, string ani, string group, string locator)
That is a different issue altogether. At the moment, fact is that it does handle it.Right now I don't trust the Levelling system to reliably handle the player's and officers' levels, let alone NPC's.
Because hardcoding them is bad practice?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?
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.
If the characters get a wrong nation name, then the character nationalities aren't set correctly.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?
The officer type controls the type of skills and abilities the characters get.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.
That was indeed the variable I was thinking of; it worked fine before.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.
True; that always remains an option.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".![]()
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?Because hardcoding them is bad practice?
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.
So you're stuck if you actually want a bunch of sailors, then.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".
"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.Though of course if we can modify these functions to be able to handle some of that, that would be quite nice.
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.If you want separate characters generated at specific locators though, I don't see how one single function can handle that anyway.
"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.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.
Please make a Bug Tracker entry for that.Something doesn't work fine, the evidence being the various soldiers and boarders whose dead bodies had wrong nationality names when I looted them.
I don't think I follow you there? In what way are you stuck?So you're stuck if you actually want a bunch of sailors, then.
But you were saying the Hornblower scenes do NOT use "Random_Raid"? Confused again...."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.![]()
One thing that COULD be made possible is to generate different characters in the attacking group at randomly chosen locators of a certain group.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.