kn4tseb
Master
Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0
|
differencing races?
Is there a way to check if players race are equal or different between each other?
second question... might sound really noob but i ll ask it either way.
how can i get the type of an item under a FOR loop?
example:
typedefs
t_weapon_mace_smith 11 //
t_weapon_mace_sharp 12 //
t_weapon_sword 13
t_weapon_fence 14
ON=@Hit
for x 11 14
local.weapon = <argo.<dlocal.x>????????????????
ty
(This post was last modified: 06-09-2014 04:44 PM by kn4tseb.)
|
|
06-09-2014 07:27 AM |
|
|
kn4tseb
Master
Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0
|
RE: differencing races?
thank you both, think obody is what ill use, might be not a bad feature to check if obody of a player is != to otherones, so there would be no need of all those conditions..
Btw, what's the best way to get the type of weapons excluding t_bow, using a @hit trigger?
i would reallty like to know how to get types, maybe with findlayer(1).x or STRMATCH(*WEAPON*,<ARGO.TYPE>)..... something like that, would you help me plz?
-----------
something like and better than:
IF ((<findlayer.layer_hand1.type> && STRMATCH(*WEAPON*,<ARGO.TYPE>) || (<findlayer.layer_hand2.type> && STRMATCH(*WEAPON*,<ARGO.TYPE>) && <argo.type>!=t_weapon_bow))
t_weapon_bow uses layer(2), right?
(This post was last modified: 06-10-2014 04:20 AM by kn4tseb.)
|
|
06-10-2014 02:56 AM |
|
|
kn4tseb
Master
Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0
|
RE: differencing races?
(06-09-2014 05:28 PM)XuN Wrote: How are you defining the 'races'?
Code:
if (<race>==<src.race>)
[function race]
if (<body>==c_man || <body>==c_woman)
return 1
elseif (<body>==c_elf_male || <body>==c_elf_female)
return 2
elseif (<body>==c_gargoyle_male || <body>==c_gargoyle_female)
return 3
else
return -1
endif
The fact that a function returns (return 1) a value, would it alter the original behavior of a @trigger? which on this case would be @hit ???
@hit
"Return 1 Cancels the combat swing."
(This post was last modified: 06-10-2014 05:28 AM by kn4tseb.)
|
|
06-10-2014 05:26 AM |
|
|
Extreme
Grandmaster Poster
Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20
SphereCommunity
|
|
06-10-2014 05:42 AM |
|
|
XuN
Sphere Developer
Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30
|
RE: differencing races?
Using a function returning a value inside a trigger will not stop the trigger, imagine the hardcoded function <NAME> as this
Code:
[FUNCTION NAME]
return character_name
Every function returns a value, but this value will represente the called function and will not alter the trigger/function's behaviour.
Code:
ON=@Any_Trigger
local.race=<race> //this won't stop the trigger since the return is in the [function race]
local.name=<name> // this won't stop the trigger for same reason for name function
local.your_something=<tag.something> //this won't stop the trigger for the same reason with the tags
return <eval <local.race>+<local.something>> //this will return the trigger since you are using the return directly
|
|
06-10-2014 06:55 AM |
|
The following 1 user Likes XuN's post:1 user Likes XuN's post
Extreme (06-10-2014)
|
kn4tseb
Master
Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0
|
RE: differencing races?
Perfectly understoood
and my last question for today, it is not a MAJOR need but will help me to understand better a lot of things:
having in mind that types have a number which reference them like the fallowing.
t_weapon_mace_smith 11
t_weapon_mace_sharp 12
t_weapon_sword 13
t_weapon_fence 14
if i want to make an intance that checks only those types, would you give me a 2 lines example for this?
in the case i want to check weapon types with the exception of bows so.
ON=@Hit
for x 11 14
local.anyname = <HOWdo.<dlocal.x>.iGetTheType>???
thanks!
PD: XuN, would you share with me fhe formula for anatomy+tactics+lumberjaking (in case of using axe) bonus hits?
thank you.
(This post was last modified: 06-10-2014 12:27 PM by kn4tseb.)
|
|
06-10-2014 10:21 AM |
|
|
Extreme
Grandmaster Poster
Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20
SphereCommunity
|
|
06-10-2014 02:46 PM |
|
|