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..
ID:145126
![]() Jun 9 2006, 11:34 am (Edited on Jun 9 2006, 11:42 am)
|
|
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. |
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++
|
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 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 |
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.
|
Sin1990 wrote:
fixed mob/Login()//or mob/proc/Login() which ever way works i guess dependin on how u want it You still messed a little bit up on the switch line, all fixed. |
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. 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. :| |
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
|
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")) thats my character selection on my game, its simple and does what i need it to |
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. |
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