forums | blogs | polls | tutorials | downloads | rules | help

Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in remember_me_form_alter() (line 78 of /var/www/siegetheday.org/sites/all/modules/contrib/remember_me/remember_me.module).

The underwater saga

I got the basic switch between swimming and walking to work. Lara goes through a pair of command triggers that turn a "swim" boolean on and off in GoBits, and when she's on the swim side, she swims, and when she's on the walk side, she walks.

But she swims at the same speed that she runs, so I modify the trigger commands so that they also decrease and revert her movement speed. Should be a simple change, but I now find that her swimming animation randomly changes to a different one, none of which is a walk/run animation! She "slides" at the correct speed, but the animation she's performing is wrong. There is logic in select_walk to select run or walk loops depending on speed, but neither of those animations gets used, she's switching to fidget animations, or none at all (DaVinci pose).

When she stops, she's still reliably performing the 'nrm0' fidget instead of the 'swm0' one that I'm trying to have her perform. No randomness here! This leads me to believe that she's not dropping into a fidget too early, despite the fidget animations replacing her swim.

Any random off-the-wall ideas? I've tried applying logic, but it's failing!

volkan's picture

Sorry, but I'm still too much of a NOOB about computers and coding. Skrit and animations are way outta my league.

@ghastley: Well i guess i never have faced such tricky animation matters as you currently seem to have...
But didn't you mention in another post that Lara swimms because of an added animation in CHORE_FIDGET ?

Supposed it still does - recently while tuning some pet brain realted things i have seen there are many situations leading back (intentionally or in case of errors) to fideting by the functions in k_job_...fidgeting.skrit (or so), and assumed fidgeting is called by any reason then normally a char will try to face a nearby actor or otherwise start a random aniamtion - what now if your custom swimming animation is not respected here?
Maybe should check that library file once!?

Right, every time she stops moving, the job_fidget gets control. She should be using only two animations, one for moving and one for remaining in place. There are no underwater mobs, so she doesn't need to attack, die or get up. Job_move and job_fidget check for interruptions that require other animations, but there should not be any.

I find that her fidget animation is consistently her regular non-swimming one (the nrm0=dff-02 animation), so the spurious ones from job_move should not be coming from the k_job_c_mcp_fidget_utils code, since it is shared by both jobs.

It appears that just about every job includes the fidget utils, so that the ai can switch to a fidget as soon as the current chore ends. The other job that is involved everywhere is dying, because that will interrupt anything!

I am going to try removing my changes from k_job_c_mcp_fidget_utils to see if it causes the walk/swim problem, especially as it is NOT making her do her underwater fidget! It's probably better to test one thing at a time anyway, except that the ai stuff connects it all together whether you like it or not.

I'm still trying to understand how the ai determines what interrupts what. Dying must take precedence, or you'd be able to cheat death just by keeping on the move. But moving has to interrupt attacking, or you'd never be able to break off and run away. Moving has to be interrupted by running into obstacles, etc. It appears that this is all coded into the jobs, so each one is deciding whether a new event will kill the current job and start a new one, but it's hard to find the details when you need them!

Well i'm a bit familar with the job queue concept meanwhile but i only have dusty experience how this affects the MCPManager - and separate/extraordinary animation executions i used hardly so far.

Indeed there seems to be some kind of 'interruption ruleset', if/how a player's order may overtrump a default order form a job (eg. when loosing consciousness) but i never have found a concrete trace about this... Puzzled

Sharkull's picture

:idea:
Don't forget about a casting animation, for (autocast) buffs being renewed underwater (unless you've disabled this as a possibility).

It turns out it was something else causing it.

The GPG code (quite reasonably) assumes that once it has determined she has multiple walk/run animations, that she always needs recalculation of her speed to detrmine her animation, so it never turns that flag off.

I needed to reset that whenever I determine that she's swimming, because she only has one swim animation. I don't quite understand how the other animations were chosen, but I suspect the engine was being told to use the second of the group of one, so it fell off the end and did someone random instead.

However I do need to do something about preventing spell casting underwater. And I still have the fidget situation to debug.

Strange thise animations related thing....

...however about not casting under water, try to change the file k_inc_spl_utils.skrit resp. the skrit function ValidateTargetAndCaster$() by expanding it with a 'under water' go bit check!?
As you know probably ValidateTargetAndCaster$() is a very essential function, maybe not all but most spell/power casting processes depend on it, although for powers that function comes a bit late since it will be evaluated after a power has been activated already.
So to avoid new power launches i would try Actor.RSSetUsingActiveSkill(true) to pretend temporarly any power usage in order to block the GUI (resp. the player) to start powers himself when under water.

An other approach (a quite official one, in particular in v2.3/BW) would be to add the generic state 'silenced' to the actor while under water. Very probable that Actor.GetCanCast will become false then automatically too, but i have some doubts if this will be restrictive enough related on the existing casting/power code.

I'll certainly have to research the functions for setting that. I'm not sure that it's too much of a problem without any targets for most spells, but that does look like a clean solution if it works.

The fidget problem is driving me nuts right now. I've confirmed with report.screenf that the skrit is passing through the right code and the correct animation is being requested (and accepted!) but she's still not actually doing it. There must be some factor that makes the engine substitute another animation for the one I queued, but I can't see it yet.

no good on coding, but it seems to me that they don't fidget when they're dead
so there most be an "off" switch somewhere
- CHR then presumably gets the "ghost" option..
- can't this be modified in some way and used to clear the jobqueue

- probably nonsense, but there you go..?

I had to remove the GetAnim$ function from k_job_c_mcp_fidget_utils, completely replace select_fidget with new code that included the stuff I'd removed from the utils, plus the swim switch, and update job_fidget to match. Then I had to make sure all the other characters that used that code still worked the same as before.

Now for the bubble FX, new fishes, coral reef textures, door logic to require the scuba set, ....

volkan's picture

Good job!!! :woot:

A full recipe for the swimming set-up is now at http://dslcv1-458.fast.net/ds/swimming.asp

Giovanna_del_Arco's picture

That's looking better and better, Ghastley. Keep up the good work!

I got a reasonable bubble effect working and created an emitter gizmo, so I can have a stream of bubbles rise from whatever might be generating them. To test it I just put one on the floor here.

So far I just have a steady stream effect, but I'm working on a "bloop" effect to use for the character breathing out, or a chest opening, where there will be an initial large release breaking up into smaller bubbles. Once I'm finished, I'll write up what I found out about the WorldFXMgr in DS2. It won't be complete, but it should help anyone else doing SFX.

volkan's picture

Keep up the good work. Can't wait for final release. ^^

ghastley wrote:
A full recipe for the swimming set-up is now at http://dslcv1-458.fast.net/ds/swimming.asp

Thanks for the explanation. Not many modders do such thing so it was very interesting to read how you have managed these code matters!


ghastley wrote:
...
Luckily your Lara has such heavy breasts - like this you don't need to sacrify another item slot for the weight-belt. Wink
 

Thanks to a pointer from Sharkull (how appropriate!) she can now breathe underwater. She lets out a small burst of bubbles every 3-5 seconds.

and I found out how to leave them behind when she's swimming forward.

Last one to do is the larger burst of bubbles from an opening chest.

Sharkull's picture

:thumbup: