SphereCommunity
differencing races? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: differencing races? (/Thread-differencing-races)

Pages: 1 2 3 4


differencing races? - kn4tseb - 06-09-2014 07:27 AM

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 Smile


RE: differencing races? - XuN - 06-09-2014 05:28 PM

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



RE: differencing races? - Alaric - 06-09-2014 09:21 PM

What about 'obody' to avoid functionality while morf.


RE: differencing races? - kn4tseb - 06-10-2014 02:56 AM

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?


RE: differencing races? - darksun84 - 06-10-2014 03:14 AM

<weapon.type>


RE: differencing races? - kn4tseb - 06-10-2014 05:26 AM

(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."


RE: differencing races? - Extreme - 06-10-2014 05:42 AM

Tell us what you want to do, whats the objective.
You want to cancel the hit if the player is using bow?


RE: differencing races? - XuN - 06-10-2014 06:55 AM

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



RE: differencing races? - kn4tseb - 06-10-2014 10:21 AM

Perfectly understoood Big Grin

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.


RE: differencing races? - Extreme - 06-10-2014 02:46 PM

If <WEAPON> && <WEAPON.TYPE> != T_WEAPON_BOW