ID:171487
 
I always seem to never get the easiest of bugs and runtimes, but then most of the hard ones I can get...I dont know why. In the following code, I get a runtime saying Undefined Operation, with no code its relying to, but I assume its aroun d here because thats what Im at when it happens, theres more but its a HUGE Bump Change so I dont want to post the whole thing...
    else if(istype(P,/obj/StartPlanets))
src.islocked = 1
switch(input("Welcome to [P.name]! Here we can do many things to help you. For one, we can trade Resources for Credits, to upgrade your ship. Also, with Credits, you can buy Security Forces to defend your planets. Pick your destination!","Main Planet! Time to get to work!") in list("Exchange Resources","Buy Upgrades","Nothing"))
if("Exchange Resources")
switch(input("Okay, so you want to sell your resorces for Credits? Sure thing! Every 10 Minerals is 1 Credit, every 6 Organics is 1 Credit, and every 2 Energy is 1 Credit. Pick your choice!","Pick an exchange resource!")in list("Minerals","Organics","Energy","Nevermind."))
if("Minerals")
var/change = input("How much Minerals do you want to exchange?","Exchange!")
var/change2 = change / 10
change2 = round(change2)
switch(input("Okay, so for [change] Minerals, you will get [change2] credits! Are you okay with this?","Exchange confirm?") in list("Yes","No"))
if("Yes")
src << "Okay, then we are done!"
src.minerals -= change
src.credits += change2
if("No")
src << "Whatever, it's not my problem!"</DM
  • Please split up your long lines of code by putting a backslash at the end of the line. Your code is nigh unreadable because of that long input().
  • You need to turn on debugging info so you can get a line number to go with your runtime error. Go to Build | Preferences and turn on the debug checkbox.

    Lummox JR