The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Swing swinging at record of the fight + source
Author Message
Mad Gunther
Apprentice
*

Posts: 45
Likes Given: 11
Likes Received: 5 in 5 posts
Joined: Oct 2015
Reputation: 1



Post: #3
RE: Swing swinging at record of the fight + source
Hello Coruja, thanks very much for response. Sorry if i did not stated it more clearly before.

This is the way i see things in combat by checking source code:

war_swing_swinging: i take iswingdelay from weapon selected and wait until time is over.(the more weight more iswingtime, if twohand more iswingtime even, saying it fast and bad ---> using sphere custom formula). (bardiche can take 8,7 seconds and halberd 10 just an example).

war_swing_ready: ok now iswingdelay time is over, i´m ready to hit, if i have my opponent near my attack anim will show up and will hit or miss to player, if not i´ll be holding the hit waiting to be near and hit/miss in that precision time i´m close to my opponent.

war_swing_equipping: recoil anim and we say swing is finished.
When war_swing_equipping ends I call again war_swing_swinging if i keep the intend to hit again.
That´s how I would like it to run it. Actually when I try to hit for first time a player my character starts the fight in war_swing_ready instead of war_swing_swinging because @HitTry is called when war_swing_ready takes place in action.

I commit a mistake by don´t telling that im using sphere custom combat formulas but I tweaked some things like this that would answer your question about how iswingdelay and animdelay works in my system, take a look at //MOD. comments:

Code:
// Start the swing
    if ( m_atFight.m_War_Swing_State == WAR_SWING_READY )
    {
        if ( !CanSeeLOS(pCharTarg) )
            return WAR_SWING_EQUIPPING;

        ANIM_TYPE anim = GenerateAnimate(ANIM_ATTACK_WEAPON);
        int animDelay = 14;        // MOD.
        int iSwingDelay = g_Cfg.Calc_CombatAttackSpeed(this, pWeapon) - 1;    // swings are started only on the next tick, so substract -1 to compensate that

        if ( IsTrigUsed(TRIGGER_HITTRY) )
        {
            CScriptTriggerArgs Args(iSwingDelay, 0, pWeapon);
            Args.m_VarsLocal.SetNum("Anim", (int)anim);
            Args.m_VarsLocal.SetNum("AnimDelay", animDelay);
            if ( OnTrigger(CTRIG_HitTry, pCharTarg, &Args) == TRIGRET_RET_TRUE )
                return WAR_SWING_READY;

            iSwingDelay = static_cast<int>(Args.m_iN1);
            anim = static_cast<ANIM_TYPE>(Args.m_VarsLocal.GetKeyNum("Anim", false));
            animDelay = static_cast<int>(Args.m_VarsLocal.GetKeyNum("AnimDelay", true));
            if ( iSwingDelay < 0 )
                iSwingDelay = 0;
            if ( animDelay < 0 )
                animDelay = 14;//MOD.
        }

        m_atFight.m_War_Swing_State = WAR_SWING_SWINGING;
m_atFight.m_timeNextCombatSwing = CServTime::GetCurrentTime() + iSwingDelay;

My animdelay is always the same for every weapon but not it´s argn1 for each on @Hittry, just like 51a. I made an event that involved all weapons from second age assigning a custom argn1 value like if (<argo.baseid>==i_bardiche)  argn1=87 endif… I don´t care about the formula because i know in seconds how they should work.
It takes 0,014/0.01 = 1,4 seconds to display the whole anim (forward swing plus recoil anim) because that:
Code:
UpdateAnimate(anim, false, false, static_cast<BYTE>(animDelay / TICK_PER_SEC));

So it´s not working really like sphere custom, I made this “cheap trick” to accomplish my targets, it´s all about like reverse engeenering looking through older versions.

So just realize that animdelay is the same for every weapon in my system, but iswingspeed is different for each other.

My problem comes when I want to start a fight and with the first hit. There is no iswingdelay called before hitting the opponent for first time, anim comes as fast as I double click player in war mode and once hit or miss iswingdelay is now coming but not in first hit.

Here are some vids with the differences between versions more easy so you can check out by yourself better. in 0.56c when player says current time it is the time that the swing took to complete (argn1 in hittry trigger). Also be aware that attacks starts for me when player turn blue just before double clicking him in war mode.

0.56c:




0.51a (the way i want)




Thanks for your time again, i hope you see better this time. Greetings mate.
(This post was last modified: 02-17-2016 09:48 AM by Mad Gunther.)
02-17-2016 09:47 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Swing swinging at record of the fight + source - Mad Gunther - 02-17-2016 09:47 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)