I'm gettin' fed up with this I put in:
for (var/A = 0;A <= length(Players);A++)
and they keep telling me "missing comma ',' or right-paren ') and I dunno what to do! Also what does "expected end of sentence" mean?And if I put in:
for (var/A = 0;A <= length(Players);A++)
what do I do when they tell me "The Journey of Inuyasha.dm:330:error: ): expected }" ? Please some1 answer my question!!!!!!!!!!
ID:267449
May 10 2003, 12:19 am
|
|
May 10 2003, 12:25 am
|
|
Ok, Im pretty sure that an error before the for() is confusing the compiler. Take a look at the surrounding lines and see if anything is wrong. If not post the lines above it and we should be able to help.
|
In response to DarkView
|
|
okay
|
In response to Lil'T
|
|
this is what I have:
usr.XLoc = usr.x usr.YLoc = usr.y usr.ZLoc = usr.z usr.BattleNumber = BattleCount usr.Move(locate(Location.x - 1, Location.y, Location.z)) usr.client.lazy_eye = 5 usr.icon_state = "Battle Stance" step(usr, EAST) usr.dir = WEST if (Mons1) Mons1.BattleNumber = BattleCount Mons1.Move(locate(usr.x - 4, usr.y, usr.z)) if (Mons2) Mons2.BattleNumber = BattleCount Mons2.Move(locate(usr.x - 4, usr.y + 1, usr.z)) if (Mons3) Mons3.BattleNumber = BattleCount Mons3.Move(locate(usr.x - 4, usr.y - 1, usr.z)) var/list/TurnOrder = new() var/list/Players = new() for(var/mob/M in world) if (M.BattleNumber == BattleCount) Players += M var/NextPlayer var/Agi do for (var/A = 0;A <= length(Players);A++) Agi = 0 for(var/mob/M in Players) if (M.Agility > Agi) NextPlayer = M Agi = M.Agility else if (M.Agility == Agi) if (rand(0,1)) NextPlayer = M TurnOrder += NextPlayer Players -= NextPlayer PlayerCount ++ while (length(Players) > 0) I could understand if it's confused lol but I need help badly or my game won't work. |
In response to Nadrew
|
|
It really makes no difference which one you use.
|
In response to Lil'T
|
|
Lil'T wrote:
I could understand if it's confused lol but I need help badly or my game won't work. I don't see the problem there -- could you indicate which line the compiler reports a problem for? If you aren't getting line numbers, in your Build->Preferences for... screen, check the "Generate debugging information" checkbox. |
In response to Deadron
|
|
this is the line:
for (var/A = 0;A <= length(Players);A++) please help!!!! |
In response to Lil'T
|
|
Lil'T wrote:
this is the line: That line does not appear to be the problem -- I typed in directly and compiled it without problem. If you have a BYONDscape subscription, here's an article on debugging tips: http://www.byondscape.com/ascape.dmb/Deadron.2002-0118 |
In response to Deadron
|
|
it says mine is wrong...is there a way the compiler can fix it by itself?
|
In response to Lil'T
|
|
Lil'T wrote:
it says mine is wrong...is there a way the compiler can fix it by itself? No. Learning how to diagnose problems like this is painful, but a critical part of learning to program. Also, learning how to provide the necessary information when asking for help is important...I can't help you because what you've shown doesn't give enough information. |