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

Solved Musket/Musketoon on back

From what I've seen, it works a lot better than I ever thought possible! You've done many, many amazing things with this game. :cheers

Looking at your code for this, I think I might know one way to improve on it.
If I'm not mistaken, you're working with PChar attributes regardless of whether it is actually the player using the musket/musketoon, right?
So the game might get confused if there are different characters doing it at the same time.
Solution would be to make the characters use their own code without involving the player.

You should be able to extract the character ID that actually did the firing with GetEventData() if you set that up correctly.
I know I've done that in the past for things, but can't remember any examples right now.
Do you think something like that might help?
 
Yes that's exactly the problem. I think it's in Lai_fight I can't control who has fired his weapon.
I'll talk to you later about this thing.

Another thing Pieter. I'm trying to merge myself over to wip6 and find in itemlogic:
DoQuestReloadToLocation("Swamp_island2", "goto", "arrive", "_");
was
DoQuestReloadToLocation("Swamp_island2", "goto", "arrive", ""); earlier
Does this mean anything? I'm afraid I have many, many cases like this in other files as well.
 
When I was trying to fix the quest cases, I found that if you use "" as quest name, the game will still try to execute a quest case named "".
However, if you swap it to "_" then no quest case is executed at all; turns out THAT is the correct way of doing it.
So I searched-and-replaced every single instance of that in my PROGRAM folder.
It doesn't make much of a difference, but if the game doesn't need to execute quest code, why not prevent it? :shrug
 
From what I've seen, it works a lot better than I ever thought possible! You've done many, many amazing things with this game. :cheers

Looking at your code for this, I think I might know one way to improve on it.
If I'm not mistaken, you're working with PChar attributes regardless of whether it is actually the player using the musket/musketoon, right?
So the game might get confused if there are different characters doing it at the same time.
Solution would be to make the characters use their own code without involving the player.

You should be able to extract the character ID that actually did the firing with GetEventData() if you set that up correctly.
I know I've done that in the past for things, but can't remember any examples right now.
Do you think something like that might help?


Could this be the reason behind all the misfires I see in game? The musket is fairly reliable for me, but useless for officers and sojers. I have watched them get three misfires in a row before getting cut down by those they were trying to shoot.
The musket misfires every time in boarding actions for me.
 
Yes Hylie, I think it is.

So I searched-and-replaced every single instance of that in my PROGRAM folder.
Puh, that was good news. :onya I'll stick to "_" from now.
 
Let me know when you want to have a look at rewriting that musket code with GetEventData and such. :doff

Also, for the storyline-specific special puzzle code, I was thinking of using an AddStorylineVar in your [Storyline].c file.
Then we can use:
Code:
if(sti(GetStorylineVar(FindCurrentStoryline(), "YOUR_VARIABLE")) == 1) ExecuteYourFunction();
We have to set up your function as an external one for that to work, I think.

But that way, we wouldn't need ANY reference to even your storyline folder name in the main game code. And you could use it for other storylines without further adjustments too.
We might have to do similar things with other storyline-specific code too so we can keep the main PROGRAM folder clear of specific references.
 
Hmm, this is getting too complicated for me.

Right now I do have references like OpenBoxProcedure_WR() which is placed in SL_utils in the WoodesRogers folder.
This one is run instead of the original OpenBoxProcedure() if WoodesRogers etc etc
And similar for other storylines. It works fine.
Good enough?
 
If you can upload those files, I'll see if I can set up those external functions for you. :doff
 
Oh yes, the 3 files had to be included in Seadogs to work.
I noticed there was a lot of code concerning SL_utils.c and thought these files would be "auto included".

#include "Storyline\Bartolomeu\SL_utils.c" // JRH
#include "Storyline\GoldBug\SL_utils.c" // JRH
#include "Storyline\WoodesRogers\SL_utils.c" // JRH
 
I thought SL_utils.c WAS included! Anyway, I'll find out what's going on. :facepalm
 
Could you upload also your itemlogic.c, Loginterface.c and LAi_events.c without your code in them?
I think I'll be needing those too.
 
Without the reference to the alternative functions or without ALL my questspecific code?
 
Without all your quest-specific code, please. I'll put some new references in instead.
 
Back
Top