ID:1364617
 
(See the best response by Ter13.)
Code:
NonClan-Lee
Click()
switch(alert(usr, "Are you sure you want to be born without a clan?",,"Yes", "No"))
if("Yes")
usr.NonClan=1
usr.Clan="NonClan-Lee"
usr<<"You were born without a clan!"
if("No")
return
Inuzuka
Click()
switch(alert(usr, "Are you sure you want to befriend dogs?",,"Yes", "No"))
if("Yes")
usr.Inuzuka=1
usr.Clan="Inuzuka"
usr<<"You are now dogs best friend!"
if("No")
return


Problem description:
Here's the issue, when I compile, I get two errors:

loading yazuma tizight.dme
Login.dm:230:error: NonClan: expected end of statement
Login.dm:239:error: Inuzuka: expected end of statement
yazuma tizight.dmb - 2 errors, 0 warnings

(There is a space error between the name and the rest of the code, I am aware of this, just didn't feel like fixing it on here although it is spaced correctly in the source)
The weird thing is that I have other turfs that look exactly the same as these two excluding the names and things, but otherwise the same. I'm not sure what the issue is and I don't know what else to try. I've tried changing the names, copy and pasting the turfs that look exactly the same, and nothing works. Here's an example of another turf that looks exactly the same and also compiles without errors:

Akimichi
Click()
switch(alert(usr, "Are you sure you want to have the ability of size manipulation?",,"Yes", "No"))
if("Yes")
usr.Akimichi=1
usr.Clan="Akimichi"
usr<<"You can now manipulate your size!"
if("No")
return

The only problem I can identify is the NonClan-Lee, which is supposed to be NonClan_Lee.
Best response
You can't use "-" in type names. Use the "_" underscore instead.

Not to mention, your indentation looks like it's severely messed up.
actually, the "-" isn't the issue, I've tried both and underscore(_)and and dash (-) and neither work. I even tried not having either in the name which also didn't work. Also, Ter12, the indentation isn't messed up in the source. It got messed up when I posted it on here. Just didn't want to fix it which I mentioned in my post.
In response to Kyubikitsune
It infact is the problem.

NonClan_Lee
// this works perfectly fine for me, with a copy and paste of your snippet
Well I have the rest of the source and when I compile I get errors so, it isn't the problem. It must be something else. Here I'll copy and paste the rest of the code.

turf
ClanSelection
Namikaze
Click()
switch(alert(usr, "Are you sure you want to be part of the Namikaze clan?",,"Yes", "No"))
if("Yes")
usr.Namikaze=1
usr.Clan="Namikaze"
usr<<"The Will of Fire is strong in you, you are descendent from the Yellow Flash!"
if("No")
return
Kurenai
Click()
switch(alert(usr, "Are you sure you want to be part of the Kurenai clan?",,"Yes", "No"))
if("Yes")
usr.Karama=1
usr.Kurenai=1
usr.Clan="Kurenai"
usr<<"You will be an Amazing Genjutsu Specialist!"
if("No")
return
Uzumaki
Click()
switch(alert(usr, "Are you sure you want to be part of the Uzumaki clan?",,"Yes", "No"))
if("Yes")
usr.Uzumaki=1
usr.Clan="Uzumaki"
usr<<"You are now an amazing clone specialist!"
if("No")
return
Uchiha
Click()
switch(alert(usr, "Are you sure you want to be born with the Sharingan ability?",,"Yes", "No"))
if("Yes")
switch(alert(usr, "Would you like to be a Pure Uchiha? Or have an Implanted Sharingan?(Hatake)",,"Pure Uchiha", "Implanted Sharingan"))
if("Implanted Sharingan")
usr.Clan="Hatake"
usr<<"You've been born with the ability to have an implanted Sharingan!"
if("Pure Uchiha")
switch(alert(usr, "What fighting style would you like to use?",,"Sasuke", "Itachi", "Madara"))
if("Sasuke")
usr.Uchiha=1
usr.Clan="Uchiha"
usr<<"You've been born with Sasuke's blood!"
if("Itachi")
usr.Clan="Itachi"
usr<<"You've been born with Itachi's blood!"
if("Madara")
usr.Clan="Madara"
usr<<"You've been born with Madara's blood!"
usr<<"You are now an amazing clone specialist!"
if("No")
return
Aburame
Click()
switch(alert(usr, "Are you sure you want to have the ability of bug control?",,"Yes", "No"))
if("Yes")
usr.Aburame=1
usr.Clan="Aburame"
usr<<"You can now control bugs!"
if("No")
return
Akimichi
Click()
switch(alert(usr, "Are you sure you want to have the ability of size manipulation?",,"Yes", "No"))
if("Yes")
usr.Akimichi=1
usr.Clan="Akimichi"
usr<<"You can now manipulate your size!"
if("No")
return
NonClan-Medic
Click()
switch(alert(usr, "Are you sure you want to be a Medic?",,"Yes", "No"))
if("Yes")
usr.Medical=1
usr.Clan="NonClan-Medic"
usr<<"You can now use Medical Jutsus!"
if("No")
return
NonClan_Lee
Click()
switch(alert(usr, "Are you sure you want to be born without a clan?",,"Yes", "No"))
if("Yes")
usr.NonClan=1
usr.Clan="NonClan-Lee"
usr<<"You were born without a clan!"
if("No")
return
Inuzuka
Click()
switch(alert(usr, "Are you sure you want to befriend dogs?",,"Yes", "No"))
if("Yes")
usr.Inuzuka=1
usr.Clan="Inuzuka"
usr<<"You are now dogs best friend!"
if("No")
return
Hyuuga
Click()
switch(alert(usr, "Are you sure you want to posses the coveted Byakugan?",,"Yes", "No"))
if("Yes")
usr.Hyuuga=1
usr.Clan="Hyuuga"
usr.random = rand(1,2)
if(usr.random==1)
usr<<"You've been born into the main family of the Hyuuga clan"
if(usr.random==2)
usr<<"You've been born into the branch family of the Hyuuga clan"
if("No")
return
Nara
Click()
switch(alert(usr, "Are you sure you want to control shadows?",,"Yes", "No"))
if("Yes")
usr.Nara=1
usr.Clan="Nara"
usr<<"You can now control the shadows of Naruto The Shinobi Dream!"
if("No")
return
Tenten
Click()
switch(alert(usr, "Are you sure you want to be a weapons specialist?",,"Yes", "No"))
if("Yes")
usr.Tenten=1
usr.Clan="Tenten"
usr<<"You are now a weapons specialist!"
if("No")
return
Danzo
Click()
switch(alert(usr, "Are you sure you want to be a Sharingan collector?",,"Yes", "No"))
if("Yes")
usr.Clan="Danzo"
usr<<"You are a Sharingan collector!"
if("No")
return
Gaara
Click()
switch(alert(usr, "Are you sure you want to control sand?",,"Yes", "No"))
if("Yes")
usr.Gaara=1
usr.Clan="Gaara"
usr<<"You now control sand!"
if("No")
return
Third_Kazekage
Click()
switch(alert(usr, "Are you sure you want to control IRON sand?",,"Yes", "No"))
if("Yes")
usr.Ironsand=1
usr.Clan="Third Kazekage"
usr<<"You now control iron sand!"
if("No")
return
Temari
Click()
switch(alert(usr, "Are you sure you want to be the master of fans?",,"Yes", "No"))
if("Yes")
usr.Clan="Temari"
usr<<"You are now a fan master!"
if("No")
return
Sasori
Click()
switch(alert(usr, "Are you sure you want to be a puppet master?",,"Yes", "No"))
if("Yes")
usr.NonClan=1
usr.Clan="Sasori"
usr<<"You are now a puppet master!"
if("No")
return
Pein
Click()
switch(alert(usr, "Are you sure you want to be born with the Samsara Eye(Rinnegan)?",,"Yes", "No"))
if("Yes")
usr.Clan="Pein"
usr<<"You've been born with the Rinnegan!"
if("No")
return
Konan
Click()
switch(alert(usr, "Are you sure you want to be of the oragami clan?",,"Yes", "No"))
if("Yes")
usr.Konan=1
usr.Clan="Konan"
usr<<"You are now a master of paper!"
if("No")
return
Deidara
Click()
switch(alert(usr, "Are you sure you want to be of the clay clan?",,"Yes", "No"))
if("Yes")
usr.Deidara=1
usr.Clan="Deidara"
usr<<"You now control clay!"
if("No")
return
Kamizuru
Click()
switch(alert(usr, "Are you sure you want to be of the bee clan?",,"Yes", "No"))
if("Yes")
usr.Kamizuri=1
usr.Clan="Kamizuru"
usr<<"You now control bees!"
if("No")
return
Guren
Click()
switch(alert(usr, "Are you sure you want to be of the crystal clan?",,"Yes", "No"))
if("Yes")
usr.Guren=1
usr.Clan="Guren"
usr<<"You are now part of the unique Guren clan!"
if("No")
return
Zabuza
Click()
switch(alert(usr, "Are you sure you want to be a descendant of the Zabuza clan?",,"Yes", "No"))
if("Yes")
usr.SuitonE=1
usr.Clan="Zabuza"
usr<<"You are now part of the Zabuza clan!"
if("No")
return
Haku
Click()
switch(alert(usr, "Are you sure you want to be a part of the Haku clan?",,"Yes", "No"))
if("Yes")
usr.Haku=1
usr.Clan="Haku"
usr<<"You can now control the unique ice element!"
if("No")
return
Raiga
Click()
switch(alert(usr, "Are you sure you want to be a part of the Raiga clan?",,"Yes", "No"))
if("Yes")
usr.Raiga=1
usr.Clan="Raiga"
usr<<"You can now part of the Raiga clan!"
if("No")
return
Kisame
Click()
switch(alert(usr, "Are you sure you want to be a part of the Kisame clan?",,"Yes", "No"))
if("Yes")
usr.Kisame=1
usr.Clan="Kisame"
usr<<"You can now part of the Kisame clan!"
if("No")
return
Kaguya
Click()
switch(alert(usr, "Are you sure you want to be a part of the Kaguya clan?",,"Yes", "No"))
if("Yes")
usr.Kisame=1
usr.Clan="Kisame"
usr<<"You can now control your bones!"
if("No")
return

here's the entire code.
In response to Kyubikitsune
You're still using the dash symbol.

// change all dashes to underscores _
NonClan-Medic
to
NonClan_Medic
Okay. That did it. I changed the NonClan-Lee to _ but I forgot about medic lol. Hate it when it gives the same errors for something else XD.
Double-click on the error message to highlight the line giving you errors. The errors will always be on the line or above the line that is highlighted.
lol it was more than just one line above the error, But I'm having another issue, it seems reallyyy easy, and maybe i'm tired lol, but I can't seem to get it to work. It looks fine and all, I just don't know whats wrong with it.

turf/LeftArrow
layer = 10
icon = 'LA.jpg'
Click()
usr.loc=locate()
turf/RightArrow
layer = 10
icon = 'RA.jpg'
Click()
usr.loc=locate()

the errors I'm getting are:
loading NTSDskin.dmf
Login.dm:62:error: 'LA.jpg': cannot find file
Login.dm:67:error: 'RA.jpg': cannot find file
yazuma tizight.dmb - 2 errors, 0 warnings

Btw I know the locs aren't set yet, But that isn't the issue I'm having right now. But, I've put jpegs in my source many times and idk why this one is any different. Thankyou all soo much for all your help!
P.S. YES it is in my source lol. In a file withing my source file.
In response to Kyubikitsune
Are you should you're using the correct extension for the images?
If it's in a subfolder, you need to type out the full path from the root of your project.
In response to Ter13
It's not required to type the full path, it should find the file automatically. I'm convinced he isn't using the correct extension.
In response to Neimo
Neimo wrote:
It's not required to type the full path, it should find the file automatically. I'm convinced he isn't using the correct extension.

Huh... Maybe I'm getting old, and use too many different IDEs... Thanks for that correction.

You are probably right, though. Anybody who uses a .jpg in a videogame on BYOND should be strung up, though. Jpegs at 0% compression are hugely inefficient space-wise compared to .pngs, and at 100% compression look like utter garbage. .png files, on the other hand, are pretty much better in every way.
In response to Neimo
Neimo wrote:
It's not required to type the full path, it should find the file automatically. I'm convinced he isn't using the correct extension.

Well, It's a jpg, I looked in the properties of the picture. Btw, Ima she not a he :/.
In response to Neimo
and lol I wasn't really worried about jpg or png I just found it on google images and used it... and all the pictures I got on google images are jpg so I'm not even sure where to get pngs from lol. Also, Do I have to give cred to images I take off google? O.o.
Here's some proof that it doesn't work with png though:

loading yazuma tizight.dme
loading NTSDskin.dmf
Login.dm:62:error: 'LA.jpg': cannot find file
Login.dm:67:error: 'RA.png': cannot find file
yazuma tizight.dmb - 2 errors, 0 warnings
I figured it out, I opened the source, Looked to the left and opened the file the .jpg was in.. The problem was that it was named as .jpeg instead of .jpg. I just renamed it to .jpg and it worked ^^
A lot of this code could be written so it's easier to modify later on (and easier to look at)... why is there a var per clan type and a clan var?

You should probably just indent the Click() proc to apply to all the clan turfs and refer to vars for description.

Page: 1 2