mob
verb
Challenge(mob/playerM in world)
set hidden = 1
if(M ==usr)
usr<<"[world] You can not Challenge yourself."
return
else
challengee = usr
challenger = M
sleep(600)
M<<"Chicken"
usr<<"They Chickened out."
challengee=null
challenger=null
ID:1746065
Dec 24 2014, 12:21 pm (Edited by moderator on Dec 24 2014, 2:12 pm)
|
|
So I am trying to make a Challenge system on my game, but I keep getting errors about how i'm using wrong indention and stuff
|
Dec 24 2014, 2:17 pm
|
|
The compiler isn't lying—your indentation is way off. To start with, none of your statements should be aligned with the verb keyword or your verb declaration.
|
I'm sorry, I am just stressing out over this. I have not been having a god few days with coding.
|
Try this as FKI said but im not sure if you caught on you used
mob/playerM your supposed to put a / between player and M mob/player/M mob |
In response to Bebi Tuf
|
|
That sleep() call will cause an error, too. It doesn't work like spawn(), so you don't need to indent the code under it. The else statement will also cause one, as there is no preceding if statement on the same indentation.
As for how the system works, it currently doesn't actually do much of anything. Here's my quick rendition: mob It's not thoroughly tested, and I would do it much different for my own projects, but comparing this to the original you should notice that there was a lot of logic missing from the original code. |
In response to Reformist
|
|
This system would utterly fall apart when 2 people challenge the same person before that person can respond to the first challenger. Thus is the problem when trying to use just a single variable for a whole concept that's in need of its own class.
|
In response to Spunky_Girl
|
|
if(!src.challengee && !src.challenger && !M.challenger && !M.challengee)
You can't challenge someone who's already been challenged, so that instance would never happen. But I agree, as I said, I would do it much different for my own projects. |