ID:263144
 
Hello, for the past... two years or so, I have been working on a game. I usually pick up the code on a rainy day, get interested, write up grand plans, then for a week work on the code and then, because of the many loose ends I create I lose interest. usually; code file a requires me to work on code file b, but since I havent coded the weapons that work from the theory in file a I get stuck, etc. I am sure many other people who are creative type B personalities get into this state quite often. Due to the near finalized nature of this code, I would be willing to share it with anyone who is willing to help, but I would rather it not be floating in the wind.

What I need;
a proc that works off of the 15 metals to condense the random ore gathering chance

ie. a person has 50 skill in mining, they can gather iron and bronze, a person has 300 skill in mining they can gather 10 different ores all from the same rock. I would like a proc that presents a random chance to gather any one of those ores, while forcing the higher level ores to be off limits. Presently I have a system that does this HOWEVER, it uses hundreds of lines of repeating code that seems superfluous at best.

also, I am having trouble setting up a format for my smithing system

working from the 15 base metals that I have, I am trying to code in seven quality levels that correspond to the smithers skill level in relation to the metal's difficulty to work with, and I am looking for a way to imbue these items with magical properties, perhaps a process post smithing?

If someone is able to make sense of this jumble and thinks that they might be able to turn mush into lush please email me or im me.

email;
[email protected]
yahoo;
[email protected]
AIM
dx_darklight_xb
msn;
[email protected]

I will be at work until around 5:30 this evening however I will leave my instant messengers running, feel free to leave me a message, and I will get back to you ASAP.


heres a small portion of what I do have for my mining system

(the smithing system isn't off the ground yet
Code:
obj/ingots
Iron
icon = 'mining-smithing.dmi'
icon_state = "iron"
name = "Iron Ingot"
clean = 0
amount
verb
Get()
set src in oview(0)
if(usr.contents.len==0)
src.Move(usr)
else if(usr.contents.len>=1)
for(var/obj/O in usr.contents)
if(O.name==src.name)
O.amount+=1
del src
else
src.Move(usr)
Drop()
if(src.amount >= 2)
new src(usr.loc)
src.amount -= 1
else
src.loc = usr.loc


obj/ores
Iron
icon = 'mining-smithing.dmi'
icon_state = "ore"
name = "Ore"
clean = 0
truename = "Iron Ore"
verb
Get()
set src in oview(1)
usr.contents += src
Drop()
src.loc = usr.loc
Clean()
if(clean == 0)
usr<<"You start to clean off the dirt"
sleep(5)
src.alloycolor()
usr<<"You clean off the dirt and see the true color!"
else
usr << "This does not need cleaning"

turf
MineWall
icon = 'tiles.dmi'
icon_state = "cliff"
density = 1
name = "Cave"
verb
Mine()
set src in oview(1)
if(usr.pix == 0)
alert("You Need a Pickaxe To Mine")
if(usr.pix == 1)
if(usr.swinging == 0)
usr.swinging = 1
switch(usr.Mining)
if(0 to 30)
var/ore = rand(usr.Mining,70)
if(ore >= 50)
new /obj/ores/Iron(usr)
usr << "While digging you discover some ore!"
sleep(5)
usr.swinging = 0
var/gain = rand(1,20)
if(gain == 20)
usr.Mining += 1
usr << "<font color = green>You gain some skill in mining!"
if(usr.Mining == 31)
usr<<"<font color = green>You have advanced into a category 2 miner!"
usr.category = 2
else
usr << "You dont seem to find any ore while digging."
sleep(5)
usr.swinging = 0
if(31 to 60)
var/ore = rand(usr.Mining,100)
if(ore >= 80)
var/oretype = rand(1,2)
if(oretype == 1)
new /obj/ores/Iron(usr)
usr << "While digging you discover some ore!"
if(oretype == 2)
new /obj/ores/Bronze(usr)
usr << "While digging you discover some ore!"
sleep(5)
usr.swinging = 0
var/gain = rand(1,20)
if(gain == 20)
usr.Mining += 1
usr << "<font color = green>You gain some skill in mining!"
if(usr.Mining == 61)
usr<<"<font color = green>You have advanced into a category 3 miner!"
usr.category = 3
else
usr << "You dont seem to find any ore while digging."
sleep(5)
usr.swinging = 0

turf
forge
icon = 'mining-smithing.dmi'
icon_state = "forge"
name = "Forge"
verb
Smelt_Ingot()
set src in oview (1)
for(var/obj/ores/M in usr)
if(M.name == "Iron Ore")
var/suceed = rand(round(usr.Mining/10),54)
if(suceed >= 20)
usr << "You managed to make an ingot, and put away the cool, yet ash covered ingot in your inventory"
del(M)
new /obj/ingots/Iron(usr)
var/skillgain = rand(1,100)
if(skillgain >= 98)
usr.Mining += 1


That was, an ingot, the ore (the cleaning process mentioned changes the name from ore to its true name and changes the icon to the desired color.

the gist of the mining and smelting system are also provided.

any further information will be provided when necessary.

Also any help advice or otherwise would be greatly appreciated. Possibly a little accountability is all that I need to keep a steady pace up. :)
Just by reading about your problem, I have come up with a solution you might like. Give the user a list of ores he can mine. At first, it will probably just be 1, Iron. When a person gains a level, add to this list. And when mining, use pick() and text2path() to create a new object, or just pick() to add to an existing object (for item stacking).
I have an even better Idea, look at my current post at top of list. It's not completely finished, but it's way closer then what u have.
In response to Vahn_Moon
Let me type this once again before I copy/paste this into notepad for future use;

// When checking TRUE/FALSE values

if(var==1) // Wrong!
if(var) // Right! :D

if(var==0) // Wrong!
if(!var) // Right!


Hope you're paying attention to my mining thread, cause I just gave you the code for ur or rather my random ore on mining proc