I’m making a trading game and I don’t want it to be like all the other trading games. When I play other trading games I notice that a lot of people get ripped off. So in my game I want to make a trading verb.
I made the code but I’m getting a few errors and I have no idea what to do
This is my code:
note: for a better view copy and paste it into a [byond code file.]
note: Tabs are kind of screwed up when i post.
mob/verb
Trade(mob/m in view(usr),F as file) //the tradeing verb
switch(alert(m,"[usr] want to trade with you, do you?","**trading**","Yes","No"))
if("Yes")
input(m,"What will you like to trade for the file [usr] is giving you? ") in list ("Send File","Dont Send Anything"))
if("Send File")
(FF as file)
input(m,"[usr] is offering you the file: [F] do you want to trade your [FF] file for [usr]'s [F] file?","**trading**","Yes","No"))
if("Yes")
input(usr,"[m] is offering you the file: [FF]. Do you want to trade your [F] file for [usr]'s [F] file?","**trading**","Yes","No"))
if("Yes")
alert(m,"Trade is complete")
alert(usr,"Trade is complete")
m<<ftp(F)
usr<<ftp(FF)
if("No")
alert(m,"[usr] had declined the trade")
if("Dont Send Anything")
alert(m,"[m] You Must send a file in order to trade")
alert(usr,"[m] does not want to send you a file")
if("No")
alert(usr,"[m] declined the file","**File Declined**")
I’m getting the following errors:
loading Title Page Demo.dme
Main.dm:5:error: ): expected }
Main.dm:5:error: location of top-most unmatched {
Main.dm:5:error: ): expected }
Main.dm:4:error: location of top-most unmatched {
Title Page Demo.dmb - 9 errors, 0 warnings (double-click on an error to jump to it)
what do these errors mean and what can I do about it.
-Please don’t copy my code for your game-
ID:172698
Apr 6 2004, 5:12 pm
|
|
Apr 6 2004, 5:14 pm
|
|
for a better version to see it..put it in
tags...
|
In response to N1ghtW1ng
|
|
How do i put it in tags?
|
Blades wrote:
I’m making a trading You should just put dm tags around it so it'll appear in the correct format. mob/verb |
In response to Blades
|
|
you put [dm] in from of the code and [/dm] at the end of it... and it makes it nice and neat showing like in the dreammaker window
EX- mob/verb mob/verb Hello() src << "Hello" see tge difference? if you dont do "Reply With Quote" and you will see the tags and stuff |
In response to N1ghtW1ng
|
|
My post again Please Help!
I’m making a trading game and I don’t want it to be like all the other trading games. When I play other trading games I notice that a lot of people get ripped off. So in my game I want to make a trading verb. I made the code but I’m getting a few errors and I have no idea what to do This is my code: note: for a better view copy and paste it into a [byond code file.] note: Tabs are kind of screwed up when i post. note: if the tabs are messed up can you please fix it im getting a headace trying to fix it in the post. mob/verb I’m getting the following errors: loading Title Page Demo.dme Main.dm:5:error: ): expected } Main.dm:5:error: location of top-most unmatched { Main.dm:5:error: ): expected } Main.dm:4:error: location of top-most unmatched { Title Page Demo.dmb - 4 errors, 0 warnings (double-click on an error to jump to it) what do these errors mean and what can I do about it. -Please don’t copy my code for your game- |
In response to Blades
|
|
i fixed some of the errors
code looks like this: mob/verb now i old have an error left that says Main.dm:3:error: ,: expected } |
In response to Blades
|
|
You've used curly braces {like this} to surround the stuff in your alert, instead of round parentheses (like this). Look carefully, there's a difference. =)
|
In response to Crispy
|
|
yes but when i do use the ( ) i get more errors and when i put the { } brackets I only get one error.
|
In response to Blades
|
|
Blades wrote:
yes but when i do use the ( ) i get more errors and when i put the { } brackets I only get one error. |
In response to Ses
|
|
ok
here is my code when i use the ( )'s mob/verb Now im getting the following errors: loading Title Page Demo.dme Main.dm:8:error: ): expected } Main.dm:8:error: location of top-most unmatched { Main.dm:8:error: ): expected } Main.dm:7:error: location of top-most unmatched { Title Page Demo.dmb - 4 errors, 0 warnings (double-click on an error to jump to it) the first 3 errors are occering in the 5th line of the code. the 4th error is occering in th 4th line. Can Anyone help? |
In response to Blades
|
|
Blades wrote:
yes but when i do use the ( ) i get more errors and when i put the { } brackets I only get one error. My guess is that that particular error preceeds the brackets, so it only shows that one until it's fixed. So, in short either way you're going to have to do it correctly. |
In response to Blades
|
|
Blades wrote:
ok mob/verb Now im getting the following errors: Yeah, I think that I can. When you get errors like "error: ): expected }, error: location of top-most unmatched {". Those errors usually meen that you have ")" or "(" when you don't need it. In the lines**** input(m,"What will you like to trade for the file [usr] is giving you? ") in list ("Send File","Dont Send Anything")) **** You don't need the extra ) at the end of the line. You usually need )) two of them when you do something like**** switch(input("Say Hello?") in list ("Yes", "No"))**** .. Yeah I'm probably making no sense what so ever.. but yeah on your input lines dont add that extra ), you dont need it =\ |