ID:144983
 
Code:
mob//defines the npc as a turf instead of object etc
Yardrat
Yardrat
npc = 1//wat the turfs name is
icon = 'turfs.dmi'//the icon
icon_state = "yardrat"
density = 1//makes the npc so u cant walk through it
verb//makes a verb
Land_On_Yardrat()//name of the verb
set src in oview(1)//sets it so the verb can only b used when npc is one tile awau
switch(alert("Do you want to land on Yardrat?","Land","Yes","No"))//ask if he/she wants to land
if("Yes")//if they say yes
usr.overlays -= /obj/Pod//make there icon this
usr.overlays -= 'invis.dmi'
usr.loc=locate(51,104,4)
usr.icon_state = ""
npc = 0//sends to this location
usr << "<B>You land on the Planet Yardrat"//wat it says to the usr
if("No")//if the say no
return//return back to the screen
Destroy()
set src in oview(1)
switch(alert("Do you want to attempt to blow up Yardrat?","Destroy","Yes","No"))
if("Yes")
if(usr.pl >= 1000000)
usr << "[usr]: aaaAAAAGGHHHH!!!!!!!!!!!!!!!"
for(var/mob/M in world)
if(M.loc=location = ,,2)
M.pl == 0
M.Die()


Problem description:

Is there a way I can make the location work for DM code because ,,2 obviously wont work so im not even gonna attempt to compile it,but is there a way i can put it in fir x and y that it wont matter what number it is but the z value must be 2 or 3 or any speccfic munber I specify?

Erm...
if(M.z == 1)


x,y,and z are all separate and built in variables.
In response to Pyro_dragons
o ok well thanks but wat if the planet doest take up an entire peice of the map? Like being from 10,25,4 to 50,60,4? is there any way to do that or should i just try to find some way around that or remake map?
In response to SS10trunks
No, you'll just have to specify the exact location then.
In response to Pyro_dragons
Each and every location on that planet?!?!?! thats a lot too much but o wait i have an idea what if i made a variabe for those small planets? Like..

mob
var
OnNamek = 0

Then when they land on namek or login(Because of being a namekian) the variable then = 1 then something like this happens...

          Destroy()
set src in oview(1)
switch(alert("Do you want to attempt to blow up Namek?","Destroy","Yes","No"))
if("Yes")
if(usr.pl >= 1000000)
usr << "[usr]: aaaAAAAGGHHHH!!!!!!!!!!!!!!!"
for(var/mob/M in world)
if(M.OnNamek == 1)
M.pl == 0
M.Death()
new/turf/Void(locate(44,60,4))
new/turf/Void(locate(44,61,4))
new/turf/Void(locate(44,59,4))
new/turf/Void(locate(43,60,4))
new/turf/Void(locate(45,60,4))
new/turf/Void(locate(43,61,4))
new/turf/Void(locate(45,61,4))
new/turf/Void(locate(45,59,4))
new/turf/Void(locate(43,59,4))
world << "Namek was destroyed!"
sleep(1500)
world << "A New Namek has been born!"
new/mob/Namek/Namek(locate(34,52,4))
else
usr << "You shoot a blast down at namek but nothing happens..."
In response to SS10trunks
SS10trunks wrote:
o ok well thanks but wat if the planet doest take up an entire peice of the map? Like being from 10,25,4 to 50,60,4? is there any way to do that...

Of course, just check if the x/y/z variables are within range:

if((M.x>=10||M.x<=50)&&(M.y>=25||M.y<=60)&&M.z==4)


It may be long, but that's all of what I can think of right now.