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

Fixed Rewrite Musket on Shoulder Code

I have tested (also the latest version) for mainchar and officers. Soldier enemies don't ever seem to
sheath their blades so I can't confirm they're behaving ok. "Ambush" situation is started etc.
 
What if you enabled Godmode and attack some soldiers in Colonial Powers?
They all carry muskets then so when they grab their blades to fight against you, this code should trigger.
 
So can anyone fight some soldiers in colonial powers?
 
Did you by any chance already enable godmode and go mental on the soldiers in Colonial Powers?
We know this works well for single characters now. We just need to know what happens if a whole bunch of characters use muskets at the same time.
Should probably OK as well, but once we know for sure, we can mark this one "Fixed". :cheeky
 
I made myself immortal and have fought these guys all day. All is working very good now with the new musket code.
I have continued though with the 3 new musket types and am still testing them. It looks very promising so far.

There is one thing: I have not found one certain place where to check when NPC:s and officers leave fightmode.
I have one (in LAi_fight) for checking when they enter fightmode.
 
I made myself immortal and have fought these guys all day. All is working very good now with the new musket code.
"Fixed" it is then. And a hearty congratulations for figuring this one out! :bow

There is one thing: I have not found one certain place where to check when NPC:s and officers leave fightmode.
I have one (in LAi_fight) for checking when they enter fightmode.
@Levis, do you have any idea? I won't be able to search for a while.
 
And a hearty congratulations for figuring this one out!
That was only because of your hint about how "Postevent" works Pieter. :onya

About the check for leave fightmode. I have traced ALL functions in LAi_fight.c to see which one
was the right one.

Code:
void LAi_tmpl_fight_SetWaitState(
was always the last one when characters
took down their blades. I tried to use it but it made no effect.
 
That was only because of your hint about how "Postevent" works Pieter. :onya
A hint is still only a hint. You made it work. :doff

Code:
void LAi_tmpl_fight_SetWaitState(
was always the last one when characters
took down their blades. I tried to use it but it made no effect.
How did you check? A trace call at the beginning of each function in there? That's what I would try to find out.

Is there any chance of it being related to LAi_tmpl_fight_Stop or LAi_tmpl_fight_StopRestore ?
 
So you are looking for a function which is called when characters stop fighting?
 
I do believe so. Jack probably wants to add some code to the function where characters sheath their swords to put the guns back on their back.
 
I'm not sure but maybe this function does it:
Code:
void LAi_Character_EndAction()

BTW @Pieter Boelen the function
Code:
void LAi_CharacterAttack()
might be wrong. When looking in Notepad++ it says some brackets are not in place. Could you maybe double check it? It seems the function might be missing a bracket.
 
How did you check? A trace call at the beginning of each function in there?
Yes.

So you are looking for a function which is called when characters stop fighting?
Jack probably wants to add some code to the function where characters sheath their swords to put the guns back on their back.
Yes. And I'll test
Code:
void LAi_Character_EndAction()
:doff
 
I was too quick to celebrate. There's a lot of testing before anything works as it should. :modding
 
I'm not sure but maybe this function does it:
Code:
void LAi_Character_EndAction()

BTW @Pieter Boelen the function
Code:
void LAi_CharacterAttack()
might be wrong. When looking in Notepad++ it says some brackets are not in place. Could you maybe double check it? It seems the function might be missing a bracket.
When does that happen? Any log entries? I haven't seen it yet.
 
Did you try putting a trade call at the beginning of each function in there?
Include the name of the character with GetMySimpleName so you can see the last function that is called for each character.
 
I made a very homemade trace:
Logit("YES IT'S HERE");
+ played a pling plong sound. No stringlog, no sound.
 
My suggestion:
trace("LAi_Character_EndAction executed for " + GetMySimpleName(chr));
Check the chr variable as I cannot check the correct variable name right now.

Then add such a line in each possibly related function in that file.
You'll then get a compile.log entry every time such a function is called for a character,
so hopefully you can see which function was called last for each character.

NOTE: I'd recomend using trace (writes to compile.log) instead of LogIt because this may make for rather a lot of texts.
 
Back
Top