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


RE: differencing races? - kn4tseb - 06-11-2014 01:45 PM

i thought about that, couldnt question a XuN quickly writed script xD... ill try Smile


ok, works fine against different.....

but as a human i summon another human, like an actor for example... and if i set it to (<race>)==(<src.race>) it doesnt do anything
but if i set it to not equal it does it, like if we have different bodies...
i .info me and it says body c_man.... so i dont understand...


i might think those vendors actually doesnt have the same obody? Confused

EDIT: yep.. works fine except when races are the same... at less vs NPC it assumes that they have not the same obody than me Confused


RE: differencing races? - Extreme - 06-12-2014 12:41 AM

...
(<race>)==(<src.race>)
...
(<race> == <src.race>)

IF (<OBODY> == C_MAN) || (<OBODY> == C_WOMAN)


RE: differencing races? - kn4tseb - 06-12-2014 05:02 AM

tryed both ways:
if (<RACE> != <SRC.RACE>)
and if (<RACE>) != (<SRC.RACE>)

nothing changes... still taking c_man or c_woman as a different body than mine.
dunno what im missing but its the only thing left to finish the script.

ON=@Hit
If (<WEAPON> && <WEAPON.TYPE> != T_WEAPON_BOW)
IF (!<ARGO.TWOHANDS>)
if (<RACE>) != (<SRC.RACE>)
SERV.B MY NAME IS <name>
endif
endif
endif

[FUNCTION RACE]
IF (<OBODY> == C_MAN) || (<OBODY> == C_WOMAN)
RETURN 1
ELIF (<OBODY> == C_ELF_MALE) || (<OBODY> == C_ELF_FEMALE)
RETURN 2
ELIF (<OBODY> == C_GARGOYLE_MALE) || (<OBODY> == C_GARGOYLE_FEMALE)
RETURN 3
ELSE
RETURN -1
ENDIF


RE: differencing races? - darksun84 - 06-12-2014 05:32 AM

(06-12-2014 05:02 AM)kn4tseb Wrote:  tryed both ways:
if (<RACE> != <SRC.RACE>)
and if (<RACE>) != (<SRC.RACE>)

nothing changes... still taking c_man or c_woman as a different body than mine.
dunno what im missing but its the only thing left to finish the script.

ON=@Hit
If (<WEAPON> && <WEAPON.TYPE> != T_WEAPON_BOW)
IF (!<ARGO.TWOHANDS>)
if (<RACE>) != (<SRC.RACE>)
SERV.B MY NAME IS <name>
endif
endif
endif

[FUNCTION RACE]
IF (<OBODY> == C_MAN) || (<OBODY> == C_WOMAN)
RETURN 1
ELIF (<OBODY> == C_ELF_MALE) || (<OBODY> == C_ELF_FEMALE)
RETURN 2
ELIF (<OBODY> == C_GARGOYLE_MALE) || (<OBODY> == C_GARGOYLE_FEMALE)
RETURN 3
ELSE
RETURN -1
ENDIF

Try this way
Code:
If (<WEAPON>) && (<WEAPON.TYPE> != T_WEAPON_BOW)
   IF (!<ARGO.TWOHANDS>)
       if (<RACE <uid>>) != (<RACE <src>>)
       SERV.B MY NAME IS  <name>
       endif
   endif
endif

[FUNCTION RACE]
ref1=<args> //
IF (<ref1.OBODY> == C_MAN) || (<ref1.OBODY> == C_WOMAN)
RETURN 1
ELIF (<ref1.OBODY> == C_ELF_MALE) || (<ref1.OBODY> == C_ELF_FEMALE)
RETURN 2
ELIF (<ref1.OBODY> == C_GARGOYLE_MALE) || (<ref1.OBODY> == C_GARGOYLE_FEMALE)
RETURN 3
ELSE
RETURN -1
ENDIF



RE: differencing races? - Extreme - 06-12-2014 05:53 AM

(06-11-2014 09:49 AM)Extreme Wrote:  
PHP Code:
If (<ARGO.WEAPON>) && (<ARGO.WEAPON.TYPE> != T_WEAPON_BOW)
 IF (!<
ARGO.TWOHANDS>)
  IF (<
RACE> != <SRC.RACE>)
   IF (<<
ARGO.SKILL>> >= 60.0)
    
SERV.B HELLO
   
ENDIF
  ENDIF
 ENDIF
ENDIF 

(06-11-2014 01:43 PM)Extreme Wrote:  Okay, one tip: when comparing things, if you have more than one condition, you should use () on each condition.

Here you go:
PHP Code:
[FUNCTION RACE]
IF (<
OBODY> == C_MAN) || (<OBODY> == C_WOMAN)
 RETURN 
1
ELIF 
(<OBODY> == C_ELF_MALE) || (<OBODY> == C_ELF_FEMALE)
 RETURN 
2
ELIF 
(<OBODY> == C_GARGOYLE_MALE) || (<OBODY> == C_GARGOYLE_FEMALE)
 RETURN 
3
ELSE
 RETURN -
1
ENDIF 

I'm done here.


RE: differencing races? - kn4tseb - 06-12-2014 07:51 AM

(06-12-2014 05:32 AM)darksun84 Wrote:  
(06-12-2014 05:02 AM)kn4tseb Wrote:  tryed both ways:
if (<RACE> != <SRC.RACE>)
and if (<RACE>) != (<SRC.RACE>)

nothing changes... still taking c_man or c_woman as a different body than mine.
dunno what im missing but its the only thing left to finish the script.

ON=@Hit
If (<WEAPON> && <WEAPON.TYPE> != T_WEAPON_BOW)
IF (!<ARGO.TWOHANDS>)
if (<RACE>) != (<SRC.RACE>)
SERV.B MY NAME IS <name>
endif
endif
endif

[FUNCTION RACE]
IF (<OBODY> == C_MAN) || (<OBODY> == C_WOMAN)
RETURN 1
ELIF (<OBODY> == C_ELF_MALE) || (<OBODY> == C_ELF_FEMALE)
RETURN 2
ELIF (<OBODY> == C_GARGOYLE_MALE) || (<OBODY> == C_GARGOYLE_FEMALE)
RETURN 3
ELSE
RETURN -1
ENDIF

Try this way
Code:
If (<WEAPON>) && (<WEAPON.TYPE> != T_WEAPON_BOW)
   IF (!<ARGO.TWOHANDS>)
       if (<RACE <uid>>) != (<RACE <src>>)
       SERV.B MY NAME IS  <name>
       endif
   endif
endif

[FUNCTION RACE]
ref1=<args> //
IF (<ref1.OBODY> == C_MAN) || (<ref1.OBODY> == C_WOMAN)
RETURN 1
ELIF (<ref1.OBODY> == C_ELF_MALE) || (<ref1.OBODY> == C_ELF_FEMALE)
RETURN 2
ELIF (<ref1.OBODY> == C_GARGOYLE_MALE) || (<ref1.OBODY> == C_GARGOYLE_FEMALE)
RETURN 3
ELSE
RETURN -1
ENDIF

exactly the same, work against different races, but when i try it against a c_man or c_woman playing as a human race char
it acts like they had different obodies... so there was no difference. Sad. could it be something wrong with my server? xdd


RE: differencing races? - Extreme - 06-12-2014 08:20 AM

<SEX 0/1>
0 is male, 1 is female

If this don't work, use this function:
PHP Code:
[FUNCTION GENDER]
IF (<
OBODY> == C_MAN) || (<OBODY> == C_ELF_MALE) || (<OBODY> == C_GARGOYLE_MALE)
 RETURN 
0
ELIF 
(<OBODY> == C_WOMAN) || (<OBODY> == C_ELF_FEMALE) || (<OBODY> == C_GARGOYLE_FEMALE)
 RETURN 
1
ENDIF 



RE: differencing races? - kn4tseb - 06-12-2014 08:26 AM

i ll try but i dont understand, you want me to check if this work with genders?

got this error: ERROR:(sphere_item_events_misc.scp,22)Undefined symbol ''

line 22 is: if (<gender>) != (<SRC.gender>)


EDIT: HOLD ON, ill try it again


RE: differencing races? - Extreme - 06-12-2014 08:33 AM

exactly the same, work against different races, but when i try it against a c_man or c_woman playing as a human race char

C_MAN and C_WOMAN are HUMAN.
If you want to differ them, you have to check their gender.

I really don't understand a fuck you want.


RE: differencing races? - kn4tseb - 06-12-2014 08:42 AM

easy man....

this is what i want, when chars with same RACE (i dont mind about sex) fight each other, SAY HELLO
when chars with different races (i dont mind about the sex) fight each other, then SAY BYE!
thats it.


I have tried with all functions, no matter what race (obody) i am, it always takes the other character as a different obody.

so IF (<RACE> == <SRC.RACE>) is NEVER TRUE because they are always NON EQUAL OBODIES even if they are.... thats the problem.