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






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
weapon speed trouble
Author Message
svf
Apprentice
*

Posts: 6
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Aug 2013
Reputation: 0



Post: #1
weapon speed trouble
I'm trying to change attack speed from different types of weapons. I change argn1 value on @HitTry and on melee weapons it works perfectly, but with any bows or crossbows, changes in argn1 value and nothing happens, ranged attack speed always the same.

I try use 0.56c release or latest 0.56d

In sphere.ini:

Code:
CombatDamageEra=0
CombatSpeedEra=0
SpeedScaleFactor=0

bow script:

Code:
[itemdef test_bow]
id=i_bow
name=test bow
tdata3=i_arrow
tdata4=i_arrow_x
type=t_weapon_bow
flip=1
skill=Archery
dam=10,20
value=50
weight=20.0
reqstr=30
speed=50
twohands=y

tevents=t_tooltips

resources=30 i_ingot_iron
skillmake=blacksmithing 30.0

category=Weapons
subsection=Professions - Blacksmith - Bows
description=Bow

On=@Create
    hitpoints=25

If i try change
Code:
on=@hittry
if (<action> == skill_swordsmanship) || (<action> == skill_macefighting) || (<action> == skill_fencing)
  argn1 = 4.0
  sysmessage Speed: <fval(<argn1>)>
endif
All ok and changes in argn1 value work fine

But for ranged weapons:
Code:
if (<action> == skill_archery)
  argn1 = 4.0
  sysmessage <fval(<argn1>)>
endif

or

if (<findlayer(layer_hand2).type>==t_weapon_bow) ||(<findlayer(layer_hand2).type>==t_weapon_xbow)
  sysmessage WEAPON: <argo.name>
  argn1=4.0
  sysmessage <fval(<argn1>)>
endif

nothing happen, ranged speed always same and too fast

Please help, what could be the problem?
(This post was last modified: 03-02-2017 04:40 AM by svf.)
03-02-2017 04:10 AM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #2
RE: weapon speed trouble
Hello.
As example it work:
Code:
[EVENTS E_WAR]
ON=@HITTRY
ARGN1=70
Set this event on player.
It if works on all types of weapon try this:

Code:
ON=@HITTRY
IF (<FINDLAYER.1.ISWEAPON>)
LOCAL.ATTACK_SPEED_FACTOR=<EVAL <DEF.<FINDLAYER.1.DISPID>_SPEED>>
ELIF (<FINDLAYER.2.ISWEAPON>)
LOCAL.ATTACK_SPEED_FACTOR=<EVAL <DEF.<FINDLAYER.2.DISPID>_SPEED>>
LOCAL.ATTACK_SPEED_FACTOR=50
ELIF (<ACTION>==SKILL_Wrestling)
LOCAL.ATTACK_SPEED_FACTOR=30
ENDIF

ARGN1=<DLOCAL.ATTACK_SPEED_FACTOR>

[DEFNAME WEAPONS_SPEED]
I_BOW_SPEED=26
013b2_SPEED=26

I_BOW_COMPOSITE_SPEED=30
9932_SPEED=30
//For each weapon type write speed...
03-02-2017 05:54 AM
Find all posts by this user Like Post Quote this message in a reply
svf
Apprentice
*

Posts: 6
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Aug 2013
Reputation: 0



Post: #3
RE: weapon speed trouble
(03-02-2017 05:54 AM)Russian Wrote:  Hello.
As example it work:
Code:
[EVENTS E_WAR]
ON=@HITTRY
ARGN1=70
Set this event on player.
It if works on all types of weapon try this:

Code:
ON=@HITTRY
IF (<FINDLAYER.1.ISWEAPON>)
LOCAL.ATTACK_SPEED_FACTOR=<EVAL <DEF.<FINDLAYER.1.DISPID>_SPEED>>
ELIF (<FINDLAYER.2.ISWEAPON>)
LOCAL.ATTACK_SPEED_FACTOR=<EVAL <DEF.<FINDLAYER.2.DISPID>_SPEED>>
LOCAL.ATTACK_SPEED_FACTOR=50
ELIF (<ACTION>==SKILL_Wrestling)
LOCAL.ATTACK_SPEED_FACTOR=30
ENDIF

ARGN1=<DLOCAL.ATTACK_SPEED_FACTOR>

[DEFNAME WEAPONS_SPEED]
I_BOW_SPEED=26
013b2_SPEED=26

I_BOW_COMPOSITE_SPEED=30
9932_SPEED=30
//For each weapon type write speed...

argn1 not working with ranged weapon
(This post was last modified: 03-02-2017 06:44 AM by svf.)
03-02-2017 06:41 AM
Find all posts by this user Like Post Quote this message in a reply
massis87
Journeyman
*

Posts: 82
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0

D&W 8thAge

Post: #4
RE: weapon speed trouble
on=@hittry
LOCAL.AnimDelay=<ARGN1>

There are worse ways to understand the sense of the word: no. Ranting
(This post was last modified: 03-18-2017 05:55 PM by massis87.)
03-18-2017 05:55 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #5
RE: weapon speed trouble
I'm testing here using this event
Code:
[EVENTS e_test]
ON=@HitTry
IF (<ACTION> == skill_archery)
  ARGN1=1.0
ELSE
  ARGN1=4.0
ENDIF
SAY <ARGN1>
and it's working fine, when I attack using bow (archery) I got speed 1.0 and using any other combat skill I got speed 4.0

try update your spheresvr.exe to latest 56d nightly, maybe this can help
03-20-2017 09:04 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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