ID:145126
 
mob
proc
login()
usr.icon_state = input("What Gender?") in list ("male","female")
usr.Move(locate(1,1,1))
deathcheck()
if(src.hp <= 0)
view() << "[src] dies!"
src.hp += 100
src.per -= 3
percentcheck()
if (src.per == 100)
src.per -- 100
src.lvl ++ 1



What i want it to do is first off the login() doesn't work right when you open the game it doesn't ask what gender you are.!, secondly the percentcheck. I want it to be if you hit 100 % then your percent goes to 0 & your lvl gots up 1 but i get these errors.

Could it be because i don't have an attack verb in yet? so its not adding a certain amt of % for the kill

test.dm:13:error: expected expression
test.dm:14:error: 1: expected end of statement
test.dm:16:error: expected expression

Never mind I fixed it... i feel stupid now.. lmfao! But I didn't fix the login() problem..


Hmm

1) Try using src not usr for Login()...

2) Where's the ..()? :O

3) If there another Login() code somewhere? If there is, try combining it... or add the ..() into both (combining and having ..() is recommended)

- GhostAnime
In response to GhostAnime
Wrong Ghost.

It SHOULD be..
 
mob
Login()
1.) You should put the code IN the DM Tags.

2.) This isn't your real code, is it? Login isn't capitalized correctly.

3.) You can leave the src (in this case, usr, which I don't recommend) off in Login, as they all default to it.

4.) You might also want to consider checking the result of Move, although if you called the parent proc in all of them (..()), then you wouldn't need to manually Move the mob anyways.
In response to Flame Sage
Oops, didn't noticed that Login() was in mob/proc *bashes his head*... ah damn, now I probably have to pay my company back for damaging their PC... evening shifts suck >_<''

- GhostAnime
Can't do src.per--100 or src.level++1. Change those to src.per-=100 and src.level++
In response to GhostAnime
Thanks guys.. i am new to this so i am just learning.. i may have a few more questions eventually but right now I should have it under controll thankyou.!
im new at coding to so im sorry if this is wrong but where it says

mob
proc
login()
usr.icon_state = input("What Gender?") in list ("male","female")
usr.Move(locate(1,1,1))


it should be like this


Code:
mob/Login()//or mob/proc/Login() which ever way works i guess dependin on how u want it
switch(imput("What Gender Would You Like To Be?) in list ("Male","Female","Back")
if("Male")
icon="whatever.dmi"
icon_state='whatever'
usr.Move(locate(1,1,1))
if("Female")
icon="whatever.dmi"
icon_state='whatever'
usr.Move(locate(1,1,1))
if("Back")
return//or is it return..(), its one of the 2


i think i did it correctly but if u have any more problems i would gladly try to help u out. and if i didnt do this right im sorry somone correct me =D

aol - xxsk83rxx1990
msn - [email protected]
yahoo - fth199090
In response to Sin1990
It all really depends on if he has the female and male icon_state's in the same icon file. If so, his way would work, but if not, then yours would. You did, however, mess up the indentation on the switch(). Should have indented one more time.
In response to Exophus
fixed
In response to Sin1990
Sin1990 wrote:
fixed

mob/Login()//or mob/proc/Login() which ever way works i guess dependin on how u want it
switch(input("What Gender Would You Like To Be?") in list ("Male","Female","Back")
if("Male")
icon="whatever.dmi"
icon_state='whatever'
usr.Move(locate(1,1,1))
if("Female")
icon="whatever.dmi"
icon_state='whatever'
usr.Move(locate(1,1,1))
if("Back")
return//or is it return..(), its one of the 2


You still messed a little bit up on the switch line, all fixed.
In response to L.G.S Productions
It's not fixed at all. Utterly. It's NOT fixed.
You've got usr abuse everywhere, and I really think you should call the parent proc for safety measures. How can you people say it's fixed?!
switch(input("blaaat") in list("nah","yah")) // USR ABUSE! Doesn't look like it, but check in out in the reference.

switch(input(src,("blaat") in list("nah","yah")) // Aha! src !

/////

usr.Move(locate(x,y,z)) // ?!

src.Move(locate(x,y,z)) // !!


Also, I constantly wonder why people have a "Back" option when choosing a class, and then returning to nothing at all, bugging up your character. :|
In response to Mysame
the way i had my script worked fine in my game with no problems and the src shouldnt make the difference, i use switch in my game with no src in it, and the return is pointless actualy isint it, i should have left that out
In response to Sin1990
It doesn't work fine, actually. It might do what you want, but it doesn't work fine.
In response to Mysame
its the way i have all mine set in my game and it works the way i want it to, and i dont have src in any of mine heres an example out of my game
Code:
    switch(input("What do you want your class to be?","Class:") in list("Warrior","Mage"))
if("Warrior")
usr.str+=10
if("Mage")
switch(input("What do you want your domain to be?","Domain:") in list("Fire","Ice","Lightning"))
if("Fire")
var/f = rand(1,3)
usr.firedom=f
usr.spells += new/obj/spells/Fire_Ball
usr.mp+=50
usr.maxmp+=50
if("Ice")
var/f = rand(1,3)
usr.icedom=f
usr.spells += new/obj/spells/IceShard
usr.mp+=50
usr.maxmp+=50
if("Lightning")
var/f = rand(1,3)
usr.lightdom=f
usr.spells += new/obj/spells/Lightning_Beam
usr.mp+=50
usr.maxmp+=50


thats my character selection on my game, its simple and does what i need it to
In response to Sin1990
I swear to God, if Lummox Jr sees you're post, he'll type one heck of a long reply.

He made a whole article about how <code>usr</code> in procs can screw it all up. I'll try to find it and link it to you. It'll make you see reason.
In response to Mysame
In response to Audeuro
mi guessin without src it could sen dit to neone in the game -.-
In response to Mysame
Wrong. You should read the article.