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
Parry Skill Help
Author Message
UltimaGo
Apprentice
*

Posts: 22
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Mar 2017
Reputation: 0



Post: #1
Parry Skill Help
Hello again.. BlushBlushBlush

I love to learn sphere.. so i have to post my problems, im sorry if you see some many post here jejeje.

I was testing the parry skill.. and i see that i rise and block hits without a shield..

Its there a easy way to fix it?

i think about to add and if, but then i notice that i dont know how to tell sphere that if you are without a shield the skill dont rise or you cant block the hit...

Thanks in advance to all
03-30-2017 09:36 AM
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: #2
RE: Parry Skill Help
you can use @UseQuick trigger on Parrying skill (sphere_skills.scp) to create an new parrying chance formula to override default sphere formula

I can't remember exactly but maybe return 1 will force the skill success and return 0 will force the skill to fail. Just take some caution because there's no skillgain when using return 0/1
03-30-2017 10:28 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
YoAmoElUO
Apprentice
*

Posts: 5
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2017
Reputation: 0



Post: #3
RE: Parry Skill Help
I read here and i have other solution posible but idk if what i though can do... just i will tell u Coruja, sure u know if is posible and how.

Can do if u don't have a shield, the skill is disable... just work if u have shield on. I think if is posible is more easy to create new change formula... right ?

Thanks and i hope can work and help
03-30-2017 10:42 AM
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: #4
RE: Parry Skill Help
that's what I've suggested on previous post, parrying chance formula is hardcoded but you can override it with your own formula using @UseQuick trigger on Parrying skill

something like this:
Code:
ON=@UseQuick
IF !(<FINDLAYER.layer_hand2.ISARMOR>)   //always fail the skill if there's no shield equipped
  return 0
ENDIF
03-30-2017 01:42 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
UltimaGo
Apprentice
*

Posts: 22
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Mar 2017
Reputation: 0



Post: #5
RE: Parry Skill Help
(03-30-2017 01:42 PM)Coruja Wrote:  that's what I've suggested on previous post, parrying chance formula is hardcoded but you can override it with your own formula using @UseQuick trigger on Parrying skill

something like this:
Code:
ON=@UseQuick
IF !(<FINDLAYER.layer_hand2.ISARMOR>)   //always fail the skill if there's no shield equipped
  return 0
ENDIF

Thanks, but you say that and i read the wiki, and say that with the "return" value will not rise the skill..
So with this only will rise when he block an attack?
Or i have to use an "else" to make a return 1 so he block the attack?
03-31-2017 12:59 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Parry Skill Help
Here i found that return 2 allows skill gain ( https://wiki.spherecommunity.net/index.p...own_Skills )
ON=@UseQuick
// Fires when the skill is used with the USEQUICK function
// ARGN2 = Skill difficulty (0-100, writable)
// ARGN3 = Whether or not attempt is successful (writable)
// RETURN 1 = Fail the skill attempt without skill gain
// RETURN 0 = Succeed the skill attempt without skill gain
// RETURN 2 = Proceed with skill gain (use ARGN3 to set fail or success)
(This post was last modified: 03-31-2017 02:01 AM by darksun84.)
03-31-2017 02:01 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
UltimaGo
Apprentice
*

Posts: 22
Likes Given: 5
Likes Received: 0 in 0 posts
Joined: Mar 2017
Reputation: 0



Post: #7
RE: Parry Skill Help
(03-31-2017 02:01 AM)darksun84 Wrote:  Here i found that return 2 allows skill gain ( https://wiki.spherecommunity.net/index.p...own_Skills )
ON=@UseQuick
// Fires when the skill is used with the USEQUICK function
// ARGN2 = Skill difficulty (0-100, writable)
// ARGN3 = Whether or not attempt is successful (writable)
// RETURN 1 = Fail the skill attempt without skill gain
// RETURN 0 = Succeed the skill attempt without skill gain
// RETURN 2 = Proceed with skill gain (use ARGN3 to set fail or success)
Something like this?

ON=@UseQuick
IF !(<FINDLAYER.layer_hand2.ISARMOR>) //always fail the skill if there's no shield equipped
return 0
else
return 2
ENDIF

or like this?

ON=@UseQuick
IF !(<FINDLAYER.layer_hand2.ISARMOR>) //always fail the skill if there's no shield equipped
return 0
ENDIF
IF !(<FINDLAYER.layer_hand2.ISSHIELD)
return 2
ENDIF

Maybe its better use t_shield?
Thanks!
(This post was last modified: 03-31-2017 04:34 AM by UltimaGo.)
03-31-2017 04:33 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: Parry Skill Help
Shield is considered an armor, so the first one is ok (isshield doesn't exist)
03-31-2017 05:15 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
Coruja
Sphere Developer
*****

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

Dimension Shard

Post: #9
RE: Parry Skill Help
return 2 is the same of let the trigger/function do its default action like it doesn't have any return set. So return 2 basically stop the code execution and make the trigger return it's default result. Since you're only using the trigger for 1 purpose, you doesn't need to use return 2 at the end, this will make the trigger return its default value, which it will already do it anyway even with no return 2

so I can't see nothing wrong on this code
Code:
ON=@UseQuick
IF !(<FINDLAYER.layer_hand2.ISARMOR>)   //always fail the skill if there's no shield equipped
  return 0
ENDIF
it will make the char fail the skill if there's no shield equipped (skill fail = no skill gain), or it will proceed with default result/gain if the shield exist
03-31-2017 06:09 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: Parry Skill Help
The behaviour of return 2 is valid for all triggrers?
03-31-2017 07:43 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)