ID:148264
 
mob
var
stepdelay
Ship
Magic1
icon='Ships.dmi'
icon_state="Magic1"
HP = 20
ATCK = 0
DEF = 0
slots = 3
cargo = 10
Murlock
icon='Ships.dmi'
icon_state= "Murlock"
HP = 20
ATCK = 2
DEF = 0
slots = 3
cargo = 5
Choose
Login()
..()
switch(input("Choose Your Race") in list("Murlock","Federation"))
if("Murlock")
icon='Ships.dmi'
icon_state= "Murlock"
HP = 20
ATCK = 2
DEF = 0
slots = 3
cargo = 5
Crystals = 5
src.Move(locate(/area/MurlockStart))
stepdelay = 8
if("Federation")
icon='Ships.dmi'
icon_state="Magic1"
HP = 20
ATCK = 0
DEF = 0
slots = 3
cargo = 10
Crystals = 5
usr.Move(locate(/area/FederationStart))
stepdelay = 10
mob
var
ship = 0
HP = 0
ATCK = 0
DEF = 0
slots = 0
cargo = 0
Carbon = 0
Steel = 0
Crystals = 0
drillcheck = 0

obj/planets
Planet1
icon='planets.dmi'
icon_state="planet1"
density = 1
Click(usr.oview(1))
switch(input("What would you like to do here?")in list("Mine","Sell"))
if("Mine")
switch(input("What do you want to mine?")in list("Carbon","Crystals","Steel"))
if("Carbon")
if(cargo <=0)
usr<< "Not enough room on your ship"
else
if(miningdrill == 1)
usr<<"Succesfully Mined a ton of Carbon"
cargo -= 1
Carbon += 1
drillcheck-=1
if(drillcheck <= 1)
miningdrill = 0
usr<<"Your drill broke!"
else
usr<<"Failed to mine anything"
if("Crystals")
if(cargo <=0)
usr<< "Not enough room on your ship"
else
if(miningdrill == 1)
usr<<"Succesfully Mined a ton of Crystals"
cargo -= 1
Crystals += 1
drillcheck-=1
if(drillcheck <= 1)
miningdrill = 0
usr<<"Your drill broke!"
else
usr<<"Failed to mine anything"
if("Steel")
if(cargo <=0)
usr<< "Not enough room on your ship"
else
if(miningdrill == 1)
usr<<"Succesfully Mined a ton of Steel"
cargo -= 1
Steel += 1
drillcheck -=1
if(drillcheck <= 1)
miningdrill = 0
usr<<"Your drill broke!"
else
usr<<"Failed to mine anything"
Station
icon='planets.dmi'
icon_state="Station"
density = 1
Click()
switch(input("What would you like to do here?")in list("Buy Mining Drill","Upgrade Ship"))
if("Buy Mining Drill")
if(Crystals < 4)
usr << "Not enough Crystals to buy..."
else
usr<<"Succesfully Mpurchased a Mining Drill"
Crystals -= 5
slots -= 1
miningdrill += 1
if("Upgrade Ship")
if(Crystals <100)
usr<< "Not enough room on your ship"
else
if(miningdrill == 1)
usr<<"Succesfully Upgraded Ship"
ship += 1
Crystals -= 100

thats all the code i have so far... but whenever i try to buy the mining tool ( second to last if) it gives me the "not enough crystals" response...even thoug hi have enough
if(Crystals>4) I'm not sure how your game is setup but just from glancing over it, it appears you'd want to have MORE than 4 crystals, not LESS than 4 crystals.

I could be wrong though :)
LJR
In response to LordJR
LordJR: Nope. If you look at what it's doing, you need 4 crystals (crystals are some kind of currency, I gather?) to purchase a mining drill.

TrondLock: The problem is twofold. Firstly, the station is defined as mob/obj/Planets/Station, rather than obj/Planets/Station; check your indentation. (You may need to change a number of references, if you've placed it on a map anywhere or referred to /mob/obj/Planets/Station elsewhere in your code.) But, if you actually want it to be defined as a mob rather than an obj, then obviously you'd leave it how it is. =)

Secondly, just "Crystals" by itself refers to src.Crystals, which is the station's Crystals var. This would have been picked up by the compiler if the station hadn't been a mob. You need usr.Crystals, in this case. (You'll also have to fix up the other places where you've used Crystals instead of usr.Crystals.)

It's good that you're using src instead of usr (however accidentally!), though; usr can be unreliable at times. Just so you know. =)

(I seem to link to that article on every third post when I'm helping someone with BYOND programming on here. I guess it's just so useful to refer people to instead of having to explain each time, heh. Thanks, Lummox. =) )