And you thought I was going to complain about all the build verb requests.. fooled you.
Actually, I have read through almost every post that has to do with build but none of them pertain to my likings. I strongly believe that having to walk over a turf to replace it with another turf is a hassle, so I ask everyone this:
What would be the best way to construct a verb which is hidden from a category and is only accessible by right-clicking a turf on the player's screen? Once the verb is selected, how would it then pull each turf defined in a Turf.dm file and throw them into a switch from which the player chooses from? Finally, and obviously, the selected input would replace the existing turf.
Knowing my luck, I read every post except the one with the solution. In the same sense, I'd go to Las Vegas with $10,000 to gamble and come home broke, missing a few fingers. If such a post exists, I would be most thankful to obtain the thread#.
Thank you in advance,
Matic293
ID:178313
May 28 2002, 4:20 pm
|
|
In response to Mrhat99au
|
|
Some start.. err, right.
Anyone else have a umm, less complex example I could refer to? One that wouldn't force me to rewrite my entire game? =P |
Here's an exmple that should do the trick. :)
var // global var |
In response to Shadowdarke
|
|
Thank you for your wonderful example! It worked so well, I built a screen-sized fortress of red and green squares in your honor! (I didn't change the provided build_list to the likings of my turfs, and was having a good time.)
I've seen one example where someone defined a list with the contents of a .dm file. Instead of having to add every turf into the list manually, can I just tell the var "Hey! Do all the work for me and list all /turfs in 'Turfs.dm!'" and if so, how would one go by doing this? Never satisfied but sincerely, Matic293 |
In response to Matic293
|
|
Use the typesof() proc to list everything under /turf, but it doesn't turn out very pretty :o)
|
In response to Shadowdarke
|
|
Shadowdarke wrote:
> var // global var This is how I acknowledge the player has GM powers: mob/PC . . . Shadowdarke rocks! Matic293 |
In response to Matic293
|
|
You'll have to make it a mob proc that accepts a turf argument, then add it to GM players on login.
mob/proc/build(turf/Where) set category = null // so it does not appear in the verb panels // select a type from the global buildlist // null allows for no input, so the player may cancel var/T = input("What would you like to build?","Build what?") as null|anything in build_list if(!T) return // return without doing anything if the player cancelled var/Type = build_list[T] // get the type new Type(Where) // create a new turf where this turf is |
turf
entered_building //when the player enters entered building the area it allows the verb Build_rock to be enabled ect...
Entered()
usr.verbs += /mob/hidden/verb/Build_Rock
usr.verbs += /mob/hidden/verb/Build_2ndRock
usr.verbs += /mob/hidden/verb/Build_Floor
usr.verbs += /mob/hidden/verb/Build_Grass
usr.verbs += /mob/hidden/verb/Build_Door
usr.verbs += /mob/hidden/verb/Build_Road
Exited() //when the player enters exits the same area it will remove the verbs!
usr.verbs -= /mob/hidden/verb/Build_Rock
usr.verbs -= /mob/hidden/verb/Build_2ndRock
usr.verbs -= /mob/hidden/verb/Build_Floor
usr.verbs -= /mob/hidden/verb/Build_Grass
usr.verbs -= /mob/hidden/verb/Build_Door
usr.verbs -= /mob/hidden/verb/Build_Road
mob/hidden/verb/Build_Rock() /*what this does is creates a new wall at your postion and before addingit
it checks if you have enough buildpoints. If you do it will build if not then it wont. Ask me if you have any questions.
*/
set category = "Building"
if(build_points >= 1)//checks to see if player has enough buildpoints
usr << "You start to build!"
new/turf/wall(locate(usr.x,usr.y,usr.z))//creates a new wall
build_points -= 1//once built it takes 1 build_point so the player cant have unlimited building
mob/hidden/verb/Build_2ndRock()
set category = "Building"
if(build_points >= 1)
usr << "You start to build!"
new/turf/wall2(locate(usr.x,usr.y,usr.z))
build_points -= 1
mob/hidden/verb/Build_Floor()
set category = "Building"
if(build_points >= 1)
usr << "You start to build!"
new/turf/jail_floor(locate(usr.x,usr.y,usr.z))
build_points -= 1
mob/hidden/verb/Build_Grass()
set category = "Building"
if(build_points >= 1)
usr << "You start to build!"
new/turf/grass(locate(usr.x,usr.y,usr.z))
build_points -= 1
mob/hidden/verb/Build_Door()
set category = "Building"
if(build_points >= 1)
usr << "You start to build!"
new/obj/door(locate(usr.x,usr.y,usr.z))
build_points -= 1
mob/hidden/verb/Build_Road()
set category = "Building"
if(build_points >= 1)
usr << "You start to build!"
new/turf/Rock(locate(usr.x,usr.y,usr.z))
build_points -= 1
turf/lumber_yard
icon = 'build.dmi'
icon_state = "lumber"
verb/Get_Lumber()
set src in oview(1)
usr.build_points+=1