SphereCommunity
races bodies - Printable Version

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

Pages: 1 2 3 4


races bodies - Osirirs - 09-01-2015 11:42 AM

Hey guys, im trying to find the right code
for my bodies, thing is, some of my races will either use the human body and other the elf body.
What Im trying to do is to change the body accordingly to the current sex of the player.
Like, if I choose the female elf body, and then in game, on the race selection, I decide I want to be a human afterall, I gotta have the human body, but the female one, of course, so I wanted to know the IF statement I can add to check if the body is male or female, thanks guys.


RE: races bodies - Coruja - 09-01-2015 01:05 PM

this body check is hardcoded, and on some situations also check for ghost ID too or check if it's male/female using IF (<CAN> & mt_female)

Human:
-man: 400 + 402 (ghost)
-woman: 401 + 403 (ghost)
-others: 987 (GM body)

Elf:
-male: 605 + 607 (ghost)
-female: 606 + 608 (ghost)

Gargoyle:
-male: 666 + 694 (ghost)
-female: 667 + 695 (ghost)


RE: races bodies - XuN - 09-01-2015 05:16 PM

You can check it in various ways:

1) As coruja said, checking the body: if (<body>==400) //this is a man.

2) if (<can>&mt_female)//can flags are inherited from [CHARDEF ], both c_woman and c_elf_female have it, also any chardef created from them.

3) <sex 1/0> // this will retrieve 1 if your body is a male one, 0 if it's a female one (this works based on 2), but can have more different usages).


RE: races bodies - escribano - 09-02-2015 07:03 AM

Osiris, here is some funcitons i use to make this verifications:

Code:
[function ishuman]
if (<body> == c_man) || (<body> == c_woman)
return 1
endif
return 0

[function isgargoyle]
if (<body> == c_gargoyle_male) || (<body> == c_gargoyle_female)
return 1
endif
return 0

[function iselven]
if (<body> == c_elf_male) || (<body> == c_elf_female)
return 1
endif
return 0

[function ismale]
if (<body> == c_gargoyle_male) || (<body> == c_elf_male) || (<body> == c_man)
return 1
endif
return 0

[function isfemale]
if (<body> == c_gargoyle_female) || (<body> == c_elf_female) || (<body> == c_woman)
return 1
endif
return 0

[FUNCTION ishumanaid]
if (<ismale> || <isfemale>)
RETURN 1
endif
RETURN 0

There is a function that checks if the player is male or female in any race.
Hope it help you!


RE: races bodies - Osirirs - 09-02-2015 10:02 AM

Thanks guys ! This all helps a lot ! Not so sure about how to use the CAN flag yet in a script but Ill try to find some examples to learn from. Im starting to see how limitless scripting can become, its epic Smile
Thanks escribano for these functions examples, its exactly what I was looking for

EDIT:

Hmmm for some reasons I get an error in my console saying it can't resolve o.O

So I tried this but the body doesnt change.
IF (<src.body> == c_man || c_elf_male)
Src.body = c_man
Src. Obody = c_man
ELSE
SRC.BODY = c_woman
SRC.OBODY = c_woman
return 1
Endif
return 0

Probably the return 0 huh ? Forgot to try removing it


RE: races bodies - escribano - 09-02-2015 11:15 AM

I'm Glad to help!!! thats why we are all here for!

Are u sure that <SRC> is the player?

Try this:
Code:
if (<src.body> == c_man) || (<src.body> == c_elf_male)
    src.id = c_man
    src.body = c_man
    src.obody = c_man
else
    src.id = c_woman
    src.body = c_woman
    src.obody = c_woman
endif



RE: races bodies - pointhz - 09-02-2015 12:05 PM

That function doesn't make any sense.

You are checking if the body is c_man OR c_elf_male, and if it is ANY of these, it will be changed to c_man. Why would you check c_man and change to c_man?

Also, "else". Every other body that is not c_man or c_elf_male will be changed to c_woman.

You probably want something like:

IF (<SRC.BODY>==c_elf_male)
SRC.BODY=c_man
ELSEIF (<SRC.BODY>==c_elf_female)
SRC.BODY=c_woman
ENDIF


RE: races bodies - escribano - 09-02-2015 12:27 PM

What pointhz sayed makes PERFECT sense!

If the src.body doesn't work (what is really, REALLY, strange... ) try to use this one:
Code:
if (<src.body> == c_elf_male)
    src.id = c_man
    src.body = c_man
    src.obody = c_man
else if (<src.body> == c_elf_female)
    src.id = c_woman
    src.body = c_woman
    src.obody = c_woman
endif



RE: races bodies - Osirirs - 09-03-2015 08:38 AM

Oooops... Guys, I must have been really tired yesterday... O.o wow haha, Im trying that right ahead ! Thanks !!

EDIT: Okay.. hmmm I dont see what I'm doing wrong here.. I've tried many things.. Here's what I got at the moment o.O :

Code:
[FUNCTION f_gender1]
IF (<src.body>==c_elf_male)
    SRC.ID=c_man
    SRC.BODY=c_man
    SRC.OBODY=c_man
    ELSEIF (<SRC.BODY>==c_elf_female)
        SRC.ID=c_woman
        SRC.BODY=c_woman
        SRC.OBODY=c_woman
        RETURN 1
    ENDIF
ENDIF
[/spoiler]

Oh and while you're there, its not part of the same topic but is there any way to change de value of hits to got ten times the str ? Same with mana and stam.
1 STR = 10 Hitpoints
1 DEX = 10 Stamina
1 INT = 10 mana ??
I know Ill have to change lots of stuff to keep the game balanced haha


RE: races bodies - azmanomer - 09-03-2015 11:43 AM

http://wiki.sphere.torfo.org/index.php/@StatChange use this trigger for example for str;
on @statchange
if <argn1>==0
maxhits = <eval <argn3>*10>
return 1
endif

i didnt try but it should work Smile