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-nmm7 (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-nmm7 (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-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sphere_combat >.<
Author Message
Murmur
Apprentice
*

Posts: 33
Likes Given: 3
Likes Received: 2 in 2 posts
Joined: Feb 2013
Reputation: 0



Post: #1
sphere_combat >.<
Ok I give up and coming here to see if someone can point me in the right direction.

First, I'll explain what I'm trying to do, and then explain what I've done so far to achieve the goal.

I want to rewrite how weapon swing timers work. Lets set up some variables.

I have 2 weapons at the default speeds. A dagger (weapon speed 56) and a halberd (weapon speed 29).

I want dex to drastically effect swing timers.

So lets say I have 25 dex. I want the dagger swing time to be really slow, like 3 seconds each swing.

Lets say I have 100 dex. I want the dagger swing time to be quick, like 1 second for each swing.

Lets say I have 200 dex. I want the dagger to swing like a damn Gatling gun, like .2 or .1 seconds per swing.

Same deal with halberd, only it would be equally slower at each dex value on a curve.

I don't want 'thresholds' like if you have 25 dex, you would swing the same speed at 26 dex, 27 dex......49 dex, then at 50 dex you all of sudden hit a threshold that enables you to swing faster. I want an algorithm that works on a curve, so that at 100 dex the swing timer is faster than having 99 dex, and having 101 dex actually makes you swing slightly faster than 100 dex.

So what I've done so far.

The first thing I did was play around with CombatSpeedEra and SpeedScaleFactor in sphere.ini. For my purposes, no matter what option I chose on CombatSpeedEra, it didn't seem to have an effect on anything. SpeedScaleFactor does have an effect, but does not give me the drastic differences in the speed timers from the slow end to the high end.

So then I started messing around with GetWeaponSwingTimer.

Is it just me or does editing anything in Sphere_Combat.scp have zero effect on anything?

Here is the block of the code I've been focusing on for a few days of brainstorming:

Code:
[function GetWeaponSwingTimer]
if ( <weapon> )
    local.speed=<qval <tag0.override.speed> ? <tag.override.speed> : <weapon.speed> >
    if ( <local.speed> )
        local.waittime = <eval (<serv.SpeedScaleFactor> * 10 ) / (<max <dex>+100,1> * <local.speed>)>
        return <qval <local.waittime> > 5 ?5:<dlocal.waittime>>
    endif
endif
if (<brain>==brain_guard)
    return 1
endif
// Base speed is just your DEX range=40 to 0
local.waittime = <muldiv (100-<dex>),40,100>
if ( <local.waittime> < 5 )    // no-one needs to be this fast.
    local.waittime = 5
else
    local.waittime +=5 // why this 'free' increase of wait time?
endif

The first thing I tried was taking out this part:

Code:
if ( <local.waittime> < 5 )    // no-one needs to be this fast.
    local.waittime = 5
else
    local.waittime +=5 // why this 'free' increase of wait time?
endif

Because I'm trying to do exactly what this code is trying to prevent, I want to swing VERY fast on that end of the spectrum.

Then I tried adjusting, one at time, all the constants in the algorithms in GetWeaponSwingTimer.

From what I can tell, no matter what I did in GetWeaponSwingTimer, it didn't have any perceivable changes.

I even tried to put sysmessages in those blocks of code so I could see the value of local.waittime, and even failed at getting that to work.

I thought that I might be able to avoid reinventing the wheel, went to all the distros I've collected of the years (Coldfire, CloudBR, Blackrock etc) and realized that none of those distros had Sphere_combat.scp in them, and I had trouble even finding any scripts that dealt with the swing timers at all.
That is the point that I realized I'm missing something and came to the forums. I did a search on combat and found many posts about the swing animations, but none of them referenced the actual time between damage dealing (the swing).

I'm definitely not asking for someone's custom damage calc, I'd just like help understanding where I need to edit this code, or how I can just override the existing algorithms to reach my goal. Even if I have to go in and add code to every weapon on my server to override the code, I'm willing to do it.

I appreciate any advice or help.

Thanks! -Murmur

*you glance to your left to a region you just surveyed... you glimpse a magical being, more shadow than substance, caught midway in transformation... the figure smiles, the corners of his mouth jut upwards slightly on the edges, suddenly stretched to a length not at all human...*
(This post was last modified: 05-04-2017 01:31 PM by Murmur.)
05-04-2017 01:26 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
sphere_combat >.< - Murmur - 05-04-2017 01:26 PM
RE: sphere_combat >.< - Coruja - 05-04-2017, 02:30 PM
RE: sphere_combat >.< - Murmur - 05-04-2017, 03:25 PM
RE: sphere_combat >.< - darksun84 - 05-04-2017, 07:18 PM
RE: sphere_combat >.< - Murmur - 05-05-2017, 01:47 PM
RE: sphere_combat >.< - darksun84 - 05-05-2017, 06:41 PM
RE: sphere_combat >.< - Murmur - 05-06-2017, 02:29 PM
RE: sphere_combat >.< - bmanny - 05-08-2017, 06:25 AM
RE: sphere_combat >.< - Murmur - 05-08-2017, 07:19 AM
RE: sphere_combat >.< - bmanny - 05-08-2017, 07:21 AM

Forum Jump:


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