ID:149435
 
I have been working my brain muscles very hard for just under five hours now and it is getting me no where at all. I have tried all sorts to try and fix whats wrong but to no avail...I get no where!

So I am asking if anyone can help me solve this problem:


-- Errors... --

loading mygame.dme
Objects.dm:593:error::invalid expression
Objects.dm:601:error::invalid expression
Objects.dm:609:error::invalid expression
Objects.dm:617:error::invalid expression
Objects.dm:639:error::invalid expression
Objects.dm:647:error::invalid expression
Objects.dm:655:error::invalid expression
Objects.dm:663:error::invalid expression
Objects.dm:582:L :warning: variable defined but not used
Objects.dm:583:B :warning: variable defined but not used
Objects.dm:584:R :warning: variable defined but not used
Objects.dm:585:C :warning: variable defined but not used
Objects.dm:629:A :warning: variable defined but not used
Objects.dm:630:B :warning: variable defined but not used
Objects.dm:631:C :warning: variable defined but not used
Objects.dm:632:D :warning: variable defined but not used

mygame.dmb - 8 errors, 8 warnings (double-click on an error to jump to it)


-- The Coding --

/* Alcoholic Substances */

obj
NPC
Inn1
name = "Inn Keeper, Rose"
icon = 'characters2.dmi'
icon_state = "Rose"
density = 1
verb
Buy()
set name = "Purchase"
set category = "Shop"
set src in oview(2)
// alert("I am currently being worked on -= Note: You will be able to purchase alcohol from me later on in the game =-")
var/buy = input("What would you like to buy?", text) in list ("Wine","Beer","Ale","Spirits")
if(buy == "Wine")
var/obj/Alcohol/Wine/Red/R = new /obj/Alcohol/Wine/Red
var/obj/Alcohol/Wine/White/W = new /obj/Alcohol/Wine/White
var/obj/Alcohol/Wine/Champagne/C = new /obj/Alcohol/Wine/Champagne
var/drink = input("Please choose a drink [usr.name]") in list ("Red","White","Champagne")
if(drink == "Red")
if(usr.gold <=19)
usr << "You need 20 gold to purchase this drink [usr.name]!"
if(usr.gold >=20)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
R.per += usr.Sob
usr.gold -= 20

if(drink == "White")
if(usr.gold <=19)
usr << "You need 20 gold to purchase this drink [usr.name]!"
if(usr.gold >=20)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
W.per += usr.Sob
usr.gold -= 20

if(drink == "Champagne")
if(usr.gold <=39)
usr << "You need 40 gold to purchase this drink [usr.name]!"
if(usr.gold >=40)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
C.per += usr.Sob
usr.gold -= 40


if(buy == "Beer")
<b>var/obj/Alcohol/Beer/LagerBlack/L = new /obj/Alcohol/Beer/LagerBlack</b>
<b>var/obj/Alcohol/Beer/BitterShandy/B = new /obj/Alcohol/Beer/BitterShandy</b>
<b>var/obj/Alcohol/Beer/RedWitch/R = new /obj/Alcohol/Beer/RedWitch</b>
<b>var/obj/Alcohol/Beer/Cider/C = new /obj/Alcohol/Beer/Cider
var/obj/Alcohol/Beer/GuinnessBC/G = new /obj/Alcohol/Beer/GuinnessBC
var/drink1 = input("Please choose a drink [usr.name]") in list ("Lager and Black","Bitter Shandy","Red Witch","Cider","Guinness and Black Current")
if(drink1 == "Lager and Black")
if(usr.gold <=20)
usr << "You need 21 gold to purchase this drink [usr.name]!"
if(usr.gold >=21)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>L.per += usr.Sob</b>
usr.gold -= 21

if(drink1 == "Bitter Shandy")
if(usr.gold <=20)
usr << "You need 21 gold to purchase this drink [usr.name]!"
if(usr.gold >=21)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>B.per += usr.Sob</b>
usr.gold -= 21

if(drink1 == "Red Witch")
if(usr.gold <=34)
usr << "You need 35 gold to purchase this drink [usr.name]!"
if(usr.gold >=35)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>R.per += usr.Sob</b>
usr.gold -= 35

if(drink1 == "Cider")
if(usr.gold <=19)
usr << "You need 21 gold to purchase this drink [usr.name]!"
if(usr.gold >=20)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>C.per += usr.Sob</b>
usr.gold -= 20

if(drink1 == "Guinness and Black Current")
if(usr.gold <=20)
usr << "You need 21 gold to purchase this drink [usr.name]!"
if(usr.gold >=21)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
G.per += usr.Sob
usr.gold -= 21

if(buy == "Ale")
<b>var/obj/Alcohol/Ale/LagerLime/A = new /obj/Alcohol/Ale/LagerLime</b>
<b>var/obj/Alcohol/Ale/LagerBC/B = new /obj/Alcohol/Ale/LagerBC</b>
<b>var/obj/Alcohol/Ale/CiderBC/C = new /obj/Alcohol/Ale/CiderBC</b>
<b>var/obj/Alcohol/Ale/BitterMild/D = new /obj/Alcohol/Ale/BitterMild</b>
var/drink2 = input("Please choose a drink [usr.name]") in list ("Lager and Lime","Lager and Black Current","Cider and Black Current","Bitter Mild")
if(drink2 == "Lager and Lime")
if(usr.gold <=21)
usr << "You need 22 gold to purchase this drink [usr.name]!"
if(usr.gold >=22)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>A.per += usr.Sob</b>
usr.gold -= 22

if(drink2 == "Lager and Black Current")
if(usr.gold <=21)
usr << "You need 22 gold to purchase this drink [usr.name]!"
if(usr.gold >=22)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>B.per += usr.Sob</b>
usr.gold -= 22

if(drink2 == "Cider and Black Current")
if(usr.gold <=20)
usr << "You need 21 gold to purchase this drink [usr.name]!"
if(usr.gold >=21)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>C.per += usr.Sob</b>
usr.gold -= 21

if(drink2 == "Bitter Mild")
if(usr.gold <=16)
usr << "You need 17 gold to purchase this drink [usr.name]!"
if(usr.gold >=17)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
<b>D.per += usr.Sob</b>
usr.gold -= 17



if(buy == "Spirits")
var/obj/Alcohol/Spirits/PernohLemon/A = new /obj/Alcohol/Spirits/PernohLemon
var/obj/Alcohol/Spirits/PernohBC/B = new /obj/Alcohol/Spirits/PernohBC
var/obj/Alcohol/Spirits/VodkaLime/C = new /obj/Alcohol/Spirits/VodkaLime
var/obj/Alcohol/Spirits/VodkaLemon/D = new /obj/Alcohol/Spirits/VodkaLemon
var/obj/Alcohol/Spirits/VodkaOrange/E = new /obj/Alcohol/Spirits/VodkaOrange
var/obj/Alcohol/Spirits/VodkaCoke/F = new /obj/Alcohol/Spirits/VodkaCoke
var/obj/Alcohol/Spirits/GinTon/G = new /obj/Alcohol/Spirits/GinTon
var/obj/Alcohol/Spirits/GinOrange/H = new /obj/Alcohol/Spirits/GinOrange
var/obj/Alcohol/Spirits/WhiskyWater/I = new /obj/Alcohol/Spirits/WhiskyWater
var/obj/Alcohol/Spirits/WhiskyLemon/J = new /obj/Alcohol/Spirits/WhiskyLemon
var/obj/Alcohol/Spirits/RumCoke/K = new /obj/Alcohol/Spirits/RumCoke
var/obj/Alcohol/Spirits/BrandyLemon/L = new /obj/Alcohol/Spirits/BrandyLemon
var/obj/Alcohol/Spirits/PortLemon/M = new /obj/Alcohol/Spirits/PortLemon
var/drink3 = input("Please choose a drink [usr.name]") in list ("Pernoh and Lemonade","Pernoh and Black Current","Vodka and Lime","Vodka and Lemonade","Vodka and Orange","Vodka and Coke","Gin and Tonic","Gin and Orange","Whisky and Water","Whisky and Lemonade","Rum and Coke","Brandy and Lemonade","Port and Lemonade")
if(drink3 == "Pernoh and Lemonade")
if(usr.gold <=25)
usr << "You need 26 gold to purchase this drink [usr.name]!"
if(usr.gold >=26)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
A.per += usr.Sob
usr.gold -= 26

if(drink3 == "Pernoh and Black Current")
if(usr.gold <=25)
usr << "You need 26 gold to purchase this drink [usr.name]!"
if(usr.gold >=26)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
B.per += usr.Sob
usr.gold -= 26

if(drink3 == "Vodka and Lime")
if(usr.gold <=30)
usr << "You need 31 gold to purchase this drink [usr.name]!"
if(usr.gold >=31)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
C.per += usr.Sob
usr.gold -= 31

if(drink3 == "Vodka and Lemonade")
if(usr.gold <=30)
usr << "You need 31 gold to purchase this drink [usr.name]!"
if(usr.gold >=31)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
D.per += usr.Sob
usr.gold -= 31

if(drink3 == "Vodka and Orange")
if(usr.gold <=30)
usr << "You need 31 gold to purchase this drink [usr.name]!"
if(usr.gold >=31)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
E.per += usr.Sob
usr.gold -= 31

if(drink3 == "Vodka and Coke")
if(usr.gold <=30)
usr << "You need 31 gold to purchase this drink [usr.name]!"
if(usr.gold >=31)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
F.per += usr.Sob
usr.gold -= 31

if(drink3 == "Gin and Tonic")
if(usr.gold <=35)
usr << "You need 36 gold to purchase this drink [usr.name]!"
if(usr.gold >=36)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
G.per += usr.Sob
usr.gold -= 36

if(drink3 == "Gin and Orange")
if(usr.gold <=22)
usr << "You need 23 gold to purchase this drink [usr.name]!"
if(usr.gold >=23)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
H.per += usr.Sob
usr.gold -= 23

if(drink3 == "Whisky and Water")
if(usr.gold <=25)
usr << "You need 26 gold to purchase this drink [usr.name]!"
if(usr.gold >=26)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
I.per += usr.Sob
usr.gold -= 26

if(drink3 == "Whisky and Lemonade")
if(usr.gold <=29)
usr << "You need 30 gold to purchase this drink [usr.name]!"
if(usr.gold >=30)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
J.per += usr.Sob
usr.gold -= 30

if(drink3 == "Rum and Coke")
if(usr.gold <=29)
usr << "You need 30 gold to purchase this drink [usr.name]!"
if(usr.gold >=30)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
K.per += usr.Sob
usr.gold -= 30

if(drink3 == "Brandy and Lemonade")
if(usr.gold <=29)
usr << "You need 30 gold to purchase this drink [usr.name]!"
if(usr.gold >=30)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
L.per += usr.Sob
usr.gold -= 30

if(drink3 == "Port and Lemonade")
if(usr.gold <=21)
usr << "You need 22 gold to purchase this drink [usr.name]!"
if(usr.gold >=22)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
M.per += usr.Sob
usr.gold -= 22




This is really getting on my nervers...I have highlighted the ones that are errornous in bold text...

Lee
Mellifluous wrote:
This is really getting on my nervers...I have highlighted the ones that are errornous in bold text...

The bold formatting doesn't show up inside the <DM> tag, FYI.
Anyway, looking at one of the lines:
var/obj/Alcohol/Beer/LagerBlack/L = new /obj/Alcohol/Beer/LagerBlack


...I see that you've omitted the parentheses () normally found after the type; that's probably your whole problem. However, specifying the type a second time is redundant; you can just as easily say this:
var/obj/Alcohol/Beer/LagerBlack/L = new()

My guess is you'd also want to set L.loc to usr or something, which you can just as easily do like this:
var/obj/Alcohol/Beer/LagerBlack/L = new(usr)

Lummox JR
I dont see the bold text there?
In response to Lummox JR
Lummox JR wrote:
Mellifluous wrote:
This is really getting on my nervers...I have highlighted the ones that are errornous in bold text...

The bold formatting doesn't show up inside the <DM> tag, FYI.

Thanks, I'm glad I know that now ^_^

Anyway, looking at one of the lines:
var/obj/Alcohol/Beer/LagerBlack/L = new /obj/Alcohol/Beer/LagerBlack

...I see that you've omitted the parentheses () normally found after the type; that's probably your whole problem. However, specifying the type a second time is redundant; you can just as easily say this:
var/obj/Alcohol/Beer/LagerBlack/L = new()

My guess is you'd also want to set L.loc to usr or something, which you can just as easily do like this:
var/obj/Alcohol/Beer/LagerBlack/L = new(usr)

Lummox JR

Well, the L.per and the others known as
per
are the Percentage the alcohol will add to the users Soberness stat. I am trying to get this to work but I guess I am going about it the wrong way and this is the only way I thought I could do it. Still, I don't know any other way to do it besides this.

This is because I am not that well known with the language.

I also want it so the user gets nothing in their contents, just that they buy the drink, if they can afford it they get the alotted gold taken from their gold and they get the alotted alcoholic percentage added to their soberness stat. If not they get told they need more gold.

I hope that gives you a better detail of how I am after this working out but I just don't know what else to do :(

Lee
You really probably don't need to be creating new objects for all of the drinks... For instance, I'll rewrite part of the wine selection part of your code...

if(buy == "Wine")
var/drink = input("Please choose a drink [usr.name]") in list ("Red","White","Champagne")
if(drink == "Red")
if(usr.gold < 20)
usr << "You need 20 gold to purchase this drink [usr.name]!"
if(usr.gold >=20)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
[red wine's per] += usr.Sob
usr.gold -= 20

I've made bold some things I wanted to point out...

First off is the price check... Saying "<=19" is the same as saying "< 20"... I just prefer the simpler method that I changed it to...

Secondly is the soberness adjustment... You've already hardcoded the prices for each drink into this verb... Why not simply hard code the alcohol level for each one, too? So if the red wine has a "per" of 10... Just add 10 to usr.Sob right in the selection verb... Just like you subtract 20 from their gold...

So you don't need to mess with creating new objects and using their vars...

This is especially favorable considering that you mentioned not wanting to add anything to the user's contents... Why would you need to create objects if they're not really going anywhere?
In response to SuperSaiyanGokuX
SuperSaiyanGokuX wrote:
You really probably don't need to be creating new objects for all of the drinks... For instance, I'll rewrite part of the wine selection part of your code...

if(buy == "Wine")
var/drink = input("Please choose a drink [usr.name]") in list ("Red","White","Champagne")
if(drink == "Red")
if(usr.gold < 20)
usr << "You need 20 gold to purchase this drink [usr.name]!"
if(usr.gold >=20)
usr << "Drink up [usr.name], make sure you don't get too drunk please."
[red wine's per] += usr.Sob
usr.gold -= 20

I've made bold some things I wanted to point out...

First off is the price check... Saying "<=19" is the same as saying "< 20"... I just prefer the simpler method that I changed it to...

I knew this ;)

Secondly is the soberness adjustment... You've already hardcoded the prices for each drink into this verb... Why not simply hard code the alcohol level for each one, too? So if the red wine has a "per" of 10... Just add 10 to usr.Sob right in the selection verb... Just like you subtract 20 from their gold...

So you don't need to mess with creating new objects and using their vars...

This is especially favorable considering that you mentioned not wanting to add anything to the user's contents... Why would you need to create objects if they're not really going anywhere?

I have the percentage of alcohol to add but its like this:
obj/var
per = 0 //Percentage

obj/Alcohol
Wine
Red
per = 9


If I wanted to add the "per" to the character how would I do it using it like this instead of making more vars in the buy() code?

Lee


I have temporarily taken this feature out as I can't get it to work right now no matter what I try...So I guess for now the game will have to go without alcoholic substances. Plus the Soberness meter will be useless for awhile until I finally get back round to doing this and actually getting it to work.

Lee
In response to Mellifluous
Lol, mind if i ask, "what game this is?"?
In response to Vicious
Vicious wrote:
Lol, mind if i ask, "what game this is?"?

Its a new RPG called "Evolution of Eternity".

Also, whats there to laugh out loud about?

Lee