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

(Very crude) Jumping Movement

CouchcaptainCharles

COO (Chief Oddity Officer)
Storm Modder
Pirate Legend
This is not a big thing, but it opens up new swordfighting tactics and townareas that were so far inaccessible. It is only a variation of Nathan Kell's Sidestep mod. First increase the lenght of the sidestep, so that it becomes a leap, in bildsettings.h:

#define SIDESTEP_DIST 1.0


Then go to Nathan's "bool Sidestep" function in characterscharacters.c . By outcommenting this line

jump ay += PI/2; // rotate angle to perpendicular

you can turn the movement by 90 degrees so that it teleports you forward/back instead of sideways. And to make the teleport appear more like a charactermovement you can add sound and animation:

LAi_tmpl_ani_PlayAnimation(pchar, "afraid", 0.2)
PlaySound("peoplejump.wav");

Here the whole changed function (changes in <b>bold</b>):

// NK sidestep `04-09`-17 -->
bool Sidestep(ref pchar, float mag)
{
if(FindLoadedLocation() == -1) return false; //if not in loc mode, return
float x,y,z, ay;
GetCharacterPos(pchar, &x, &y, &z); // get pos
GetCharacterAy(pchar, &ay); // get angle
//Logit("Pos Before: (" + x + ", " + y + ", " + z + "), " + ay);
<b>// ccc jump </b>ay += PI/2; // rotate angle to perpendicular
<b>LAi_tmpl_ani_PlayAnimation(pchar, "jump", 0.2) // ccc jump
PlaySound("peoplejump.wav"); // ccc jump</b>

/*while(ay > PIm2) ay -= PIm2;
.....
.....

As i said, it works a bit crude. What works fine is that you can now jump down from stairs, balconies, porches etc. to escape pursuing enemies. You can also jump "over" those fences and hedges that seal of parts of the towns. But once you have jumped outside of the normal area of movement (defined by the model's "patch") you can move only by jumping, not by normal walking (Nathaniel the rabbit in the governor's garden <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" /> )
And the oddest thing is that you can jump through walls so that you may find yourself at the backside of the models. Though that opens up quite interesting views as well <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

EDIT: changed animation name to "jump"
 
Is it not posible to make your own animations???

I mean if it is we should start to make an sidestep animation so that everything goes more smoothly.

Your jumping is the same as sidestep you can get to odd places when side stepping as sidestepping is theoraticly a teleport 30 cm away from your character but it would be awesom to indeed see some new animation.

I really didnt like how Nathaniel was standing while sword in hand
with his left hand backwards and down it looked kinda GAY.
 
There definitely is a jumping animation. It's used when you jump down from a high place, like in Oxbay port from the stairs .
Not sure if it has a corresponding function, but in the .an files all animations are aligned sequentially - so you only have to find the right start and stop frame numbers.
I'll look it up for you .. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" />

I think this jumping is pretty cool <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Uhh, I am only a poor coder, and without Inez' tool I can do nothing with models, let alone animations <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

The only thing that I could do is exchange the "afraid" string in the code below with some other animation title:
LAi_tmpl_ani_PlayAnimation(pchar, "afraid", 0.2)
 
<!--QuoteBegin-SoulThief+--><div class='quotetop'>QUOTE(SoulThief)</div><div class='quotemain'><!--QuoteEBegin-->I really didnt like how Nathaniel was standing while sword in hand
with his left hand backwards and down it looked kinda GAY.<!--QuoteEnd--></div><!--QuoteEEnd-->

Akella once boasted that they took real fencing lessons to make those animations. So that's probably how Russian fencingmasters move <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/duel_pa.gif" style="vertical-align:middle" emoid=":ixi" border="0" alt="duel_pa.gif" />
 
In the man.ani file (which is a text file) there is a "jump" animation defined with start_time 126 and end_time 162.
Now let's see how that is called ... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" />
 
Perfect place for me to pop up a swordfighting thought I had: Possible to "disarm" a character in a fight? We can now knock someone unconscious, but that's mostly a victimization thing and you can't do it when fighting... but it'd be great to be able to just stop someone from going after you, to pacify, instead of having to kill and risking the entire fecking town coming down on your head (as happened with me recently in FdF - I, naturally, had to get my money back from a pickpocket, and this brought every guard and armed citizen in the entire archipelago after me. I just had to give up and load from my last save point, and avoid talking to anyone for fear of sticky fingers).

Seems to me this could be done by nothing more inelegant than simply removing someone's equipped sword, as a matter of chance perhaps, with a stroke of your own blade or the use of a `gun-hand`-equipped dagger. Animations or sounds could be thrown in for effect. And it could be a simple knocking the blade away in a fight, or we could limit it to certain blades with those little hook/loop things near the hilt, as the Highlander, or invent new ones, like the dagger I suggested. (And since Inez' tool can resize models, we could make a dagger- or -`medium-sized` blade out of any other sword. I for my part shall create a `60-inch` Claymore... now if only we could require `two-handed` use for certain swords. Can the equipping of a blade be made to make equipping guns null?)
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" />
 
I've always thought it would be great to be able to fight with the sword and a main gauche, the smaller sword or knife in the off hand... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />

Very cool stuff here! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> WTG!!! Have some treasure! :Q
 
Is that a new smiley ? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bounce.gif" style="vertical-align:middle" emoid=":b:" border="0" alt="bounce.gif" />

Hey great !
:Q
 
<!--`QuoteBegin-Inez` Dias+--><div class='quotetop'>QUOTE(Inez Dias)</div><div class='quotemain'><!--QuoteEBegin--><b>CouchcaptainCharles</b>, have you even tried

LAi_tmpl_ani_PlayAnimation(pchar, "jump", 0.2)  ??[/quote]

Yes, that works <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" /> Thanks a lot <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> We are really a good team here <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" />

A new smiley? :Q I'd call that a movie <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
Here is a proposal for a "disarmchance" weaponsattribute:

It can be added to any blade, and it causes your enemy to loose his blade (sometimes). He will run away as result.

You add it to the weapondefinition in itemsinit_items.c like this:

itm.disarmchance = 5;

That means that 5 percent of your strokes with this weapon will disarm your enemy.


And here is the code that makes this happen. Add it to the other SWAK sections in the function "void LAi_CharacterAttack()" in Loc_AiLAi_events.c


if( CheckAttribute(weapon, "disarmchance" ) && LAi_IsFightMode(enemy) )
// if weapon can disarm opponent in fight
{
if(rand(100)< sti(weapon.disarmchance) +sti(attack.skill.Fencing)/2)
// checks if you score a lucky disarming hit, fencing skill increases chance
{
if(CheckAttribute(enemy, "equip.blade")) RemoveCharacterEquip(enemy, BLADE_ITEM_TYPE );
// removes victims blade
LAi_SetCitizenTypeNoGroup(enemy); // makes disarmed victim flee
PlaySound("OBJECTSduelsword_fallen.wav");
Log_SetStringToLog("You slashed his swordarm !");
}
}
 
Sounds like some cool new mods! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />

Does the jump mod replace the sidestep one or can it be installed in addition.

BTW: You reckon these are mods I can somehow implement in my cumulative post Build 12 mods file?
 
<!--`QuoteBegin-CouchcaptainCharles`+--><div class='quotetop'>QUOTE(CouchcaptainCharles)</div><div class='quotemain'><!--QuoteEBegin-->Uhh, I am only a poor coder...[/quote]Either I cannot read or I have gone nuts. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->We are really a good team here  <!--QuoteEnd--></div><!--QuoteEEnd-->
Thx. I think so, too. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" />
 
<!--`QuoteBegin-Pieter` Boelen+--><div class='quotetop'>QUOTE(Pieter Boelen)</div><div class='quotemain'><!--QuoteEBegin-->Does the jump mod replace the sidestep one or can it be installed in addition.

BTW: You reckon these are mods I can somehow implement in my cumulative post Build 12 mods file?[/quote]
I recklessly replaced Nathan's sidestep <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/oops3.gif" style="vertical-align:middle" emoid=":eek:ops2" border="0" alt="oops3.gif" /> I didn't want to block yet another key, and I am sure he won't mind.
I anyway did this not for publication but more as an experiment. And it is really rather crude.
But try it and make up your own mind, i leave that up to you <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

As for the disarm feature, I'll implement that once I've heard the other's opinions, together with a few other changes. If you want i can send you the files then.
 
Talking about the LAi_tmpl_ani_PlayAnimation function:
I remember Alan Smithee speculate about making a "dance" mod (like in SMP) - wouldn't that be just the function to do it? I suppose you can use any animation name defined in man.ani (or woman.ani or whatever), probably even use only parts of the more complex movements by making new entries into the ani files -
Hook that to some keys and you can make your characters dance (sort of)!
 
<!--`QuoteBegin-CouchcaptainCharles`+--><div class='quotetop'>QUOTE(CouchcaptainCharles)</div><div class='quotemain'><!--QuoteEBegin-->
As for the disarm feature, I'll implement that once I've heard the other's opinions, ...[/quote]

<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />
The only concern I have is whether this would be operational during ship boardings.
If so, would the disarmed sailors prevent one from moving on to the next deck, forcing you to kill him anyway, and would that produce the negative rep hit?
 
<!--`QuoteBegin-CouchcaptainCharles`+--><div class='quotetop'>QUOTE(CouchcaptainCharles)</div><div class='quotemain'><!--QuoteEBegin-->it causes your enemy to loose his blade (sometimes). He will run away as result.[/quote] <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" /> I LOVE this!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />

Petros raises a valid question tho - on boarding, if you do disarm someone they won't die, and this prevents you from moving to the next deck... Can you make the enemy simply run away and fade out so he is not a factor in that case?

We DO make a good team... Looking forward to seeing that jump thing work! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />

Heh, glad you like the new smileys. Here's more new ones: :bbb <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/8q.gif" style="vertical-align:middle" emoid=":8q" border="0" alt="8q.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" /> :par

I did not make the parrot, and the second one was made by Admiral8Q but I made it blink. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

(been practicing a lot of work avoidance this week) <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />
 
Back
Top