I've recently started on a project again which i am currently gonna work on every now and then when i've got time.
I am wondering if there is a way to make a general path for an object so that only the "last part" needs to be changed?
To elaborate:
I'm making an RPG, in this rpg you will be able to mine resources off of rocks.
Right now the whole mining aspects of the rocks are universal, with this i mean that i do not have a verb/Mine() for every type of rock. but one under the general /rock section. :
turf/Rocks
verb/Mine()
if(!src.active)
return
else
if(usr.mining >= (src.level * 10))
// and so on
if(prob(success))
usr.contents += new/obj/minerals/Clay // as an example
Clay
Iron
//etc..
Now there's a chance of getting the minerals of the rock, when you manage to do so, i made, as you can see above. that bit of code.. maybe i should make a seperate proc handle it. please comment on that too if you want.
But what i really wonder is if there is a way to make the end of the path.. in the above example named Clay changable or something dymanic. like [src.name] so the result would be:
new/obj/minerals/Clay // when mining on a clay rock
new/obj/minerals/Iron // when mining on an iron rock
etc..
Is there a way to do this?
http://www.byond.com/ members/?command=reference&path=proc%2Fistype