ID:142901
 
Galadoria Online v.1
loading GaladoriaOnline.dme
GaladoriaOnline.dm:82:error: ): expected }
GaladoriaOnline.dm:76:error: location of top-most unmatched {

GaladoriaOnline.dmb - 2 errors, 0 warnings (double-click on an error to jump to it)


That's the error, and technically, I have no idea what the problem is. Here. I'll put up the parts of my code that might mean something.

world
name = "GaladoriaOnline v.1"// Sets the name.
view = 7// Sets the size of the screen
mob = /mob/character//Sets the mob the player is gonna be.
-That's the begining of the code

mob/create_character    //the default mob
Login()
sleep(20)//Waits for 20 half seconds
alert("Welcome to GaladoriaOnline v.1","Welcome","Ok?") // brings up a box with OK
world << "<b> \red [usr] has entered the Game!" // tell the world who logs on
var/mob/character
src.name = input("What is your name?","Name",src.key)//this for a new key when you enter the game
var/a = input("Where are you from?","Nationality") in list("Galadoria"))
if(a=="Galadoria")
usr.nationality = "Galadoria"


Problem description:There's something wrong where it says Lognin(), that's the GaladoriaOnline.dm:76:error: location of top-most unmatched {

var/a = input("Where are you from?","Nationality") in list("Galadoria"))
That's the GaladoriaOnline.dm:82:error: ): expected }

What's the problem exactly?


        if(a=="Galadoria")
usr.nationality = "Galadoria"/ add a DM tag here
didnt you know after an if statament u have to a add a DM tag?


var/a = input(src,"Where are you from?","Nationality") in list("Galadoria"))/ why to ")"? u didnt use switch(input o.o


u just can use two ")" if u putted switch(input(


...:::Pirata Inmortal:::...
No wonder you're confused. This code obviously came in part from a really bad demo. I can tell because there are too many unhelpful comments, and the author didn't get that you're supposed to put a tab between the code and the // comment so people can read it.

There are several indentation problems in that code, along with the fact that you have conflicting types for the starting mob: /mob/character and /mob/create_character. Also, Login() isn't really all that usr-safe, especially when you use a character creation/loading system.

Lummox JR
In response to Lummox JR
Uh, actually, all the comments come from me. I followed what zilal's tutorial said and added comments so that I don't forget what the code means.

So, I should get rid of my comments?

Also, should I change mob/create_character to mob/character?

Also, do you know that Code where it allows you to edit your character as you type stuff in. Like hair color, skin color and whatnot.

one more thing, what's more user friendly then Login()? And Logout()
In response to DeathCoreV
one more problem occured once I corrected the problem.

What happens when it says:
75:error:20:value not allowed here


or when it says
:duplicate definition
In response to Jamora1124
Jamora1124 wrote:
Uh, actually, all the comments come from me. I followed what zilal's tutorial said and added comments so that I don't forget what the code means.

So, I should get rid of my comments?

Ah, no. I was making an assumption about the code based on what I saw there. Many demos have been done like that. What you probably want instead is to use fewer comments, just make them more concise. You should definitely, for readability, always put some spaces or a tab between your code and a // comment.

Also, should I change mob/create_character to mob/character?

Nah, you should probably change it the other way. world/mob is set to the wrong type.

Also, do you know that Code where it allows you to edit your character as you type stuff in. Like hair color, skin color and whatnot.

There's no specific code that does all that because there are many different ways to do it. But you should really get the basics working first.

one more thing, what's more user friendly then Login()? And Logout()

Not user-friendly, usr-safe. That is, you shouldn't have usr in those procs at all.

Lummox JR
In response to Lummox JR
Okay, I listened to the advice you gave me but it just showed that I have several more problems. Here's the code.

mob/character
Login()
alert("Welcome to GaladoriaOnline","Welcome","Ok?")
world << "<b> \red [usr] has entered the Game!"
var/mob/character
src.name = input("What is your name?","Name",src.key) //this for a new key when you enter the game
switch(input("Where are you from?","Nationality") in list("Galadoria")) //sets a nationality for a character
if("Galadoria")
usr.nationality = "Galadoria"
var/a = input("Select your side in this War?","Faction") in list ("Unified Alliance", "Namotto Empire") //sets a nationality for a character
if("Unified Alliance")
usr.alliance = "Unified Alliance"
if("Namotto Empire")
usr.alliance = "Namotto Empire"
switch(input("Select your Race of people?","Race") in list ("Human","Dwarf","High Elf","Gnome","Orc","Corrupted Human","Wraith")) //sets a Race to a character
if("Human")
usr.race = "Human"
if("Dwarf")
usr.race = "Dwarf"
if("High Elf")
usr.race = "High Elf"
if("Gnome")
usr.race = "Gnome"
if("Orc")
usr.race = "Orc"
if("Corrupted Human")
usr.race = "Corrupted Human"
if("Wraith")
usr.race = "Wraith"
switch(input("What shall be your Class?","Class") in list("Warrior","Archer","Priest","Mage","Ninja"))
if("Warrior") //if they chose to be a Warrior
character = new /mob/Warrior() //make their character a Warrior
if("Archer") //if they choose to be an Archer
character = new /mob/Archer() //creates a new Archer character
if("Priest") //if they choose to be a Priest
character = new /mob/Priest() //creates a new Priest character
if("Mage") //if they choose to be a Mage
character = new /mob/Mage() //creates a new Mage character
if("Ninja") //if they choose to be a Ninja
character = new /mob/Ninja() //creates a new Ninja character


And here's the errors. I have no idea what they mean. It says duplication and I have deleted a few things here and there but nothign has happened.
In response to Jamora1124
Instead of fixing this huge mess, I will provide you a snippet of my login code:

mob/creating_character
var/mob/character
Login()
world << "[usr] has logged in."
var/charactername = input("What's your name, chummer?","Name",src.key)
var/gender = input ("What is your gender?")in list("Male","Female")
var/race = input ("What is your race?") in list ("Human","Elf","Dwarf","Orc","Troll")
switch(input("What is your archtype?") in list ("Street Samurai","Street Doc","Glitterpunk","Ganger","Decker","Detective","Mage","Shaman","Rigger"))
if("Street Samurai")
character = new /mob/player/StreetSamurai()
character.class = "Street Samurai"
if(gender == "Male")
if(race == "Human")
IsHuman(character)
character.icon = 'human.dmi'
character.gender = "male"
else if(race == "Elf")
IsElf(character)
character.icon = 'elf.dmi'
character.gender = "male"
else if(race == "Dwarf")
IsDwarf(character)
character.icon = 'dwarf.dmi'
character.gender = "male"
else if(race == "Orc")
IsOrc(character)
character.icon = 'orc.dmi'
character.gender = "male"
else if(race == "Troll")
IsTroll(character)
character.icon = 'troll.dmi'
character.gender = "male"


Do you see what you did wrong?

I suggest reading the guide.
In response to Jamora1124
Jamora1124 wrote:
one more problem occured once I corrected the problem.

What happens when it says:
75:error:20:value not allowed here

or when it says
:duplicate definition


If you understand english then you should understand what the error says. Just think about it, duplicate definition, you must have a duplicate of something, maybe like a defining a var twice?
In response to Zuglilth
o.o why u used soo MANY else?
In response to Calus CoRPS
okay, like you said, you must know english to understand these errors and which I am able to do. For instance.

error: ): expected }
error: location of top-most unmatched {


Knowing pure english wouldn't help me here. I've tried everything. I've tried removing the code, replcaing, everything. What's wrong?
In response to Pirata Inmortal
Putting switch statements in other switch statements seems to cause problems. If you know a better way, please share.
In response to Zuglilth
all i saw at the begginning with the error line is at the very end it looks like this )), just delete the second )...
In response to Superbike32
Superbike32 wrote:
all i saw at the begginning with the error line is at the very end it looks like this )), just delete the second )...

That fixes the syntax error only. The code as it stood was in no condition to actually work.

Lummox JR
In response to Lummox JR
It seems we may have confused him more, and he might have had more code he didnt post, as to stop from posting a million lines of code.

Either way, i didnt look at the actual code, and just the syntax of it....

I am sorry for not looking to see what even he was trying to do, and only looking at the syntax, i was only trying to solve his compile errors, not the actual code.
In response to DeathCoreV
didnt you know after an if statament u have to a add a DM tag?

Erm, what?