ID:175464
 
how would i make a "gate"portal that gives you a ist of places that u have visited?and dungeons u have been to? plz respond

and a buddy ist and team panel with team talk that shows if they are online or not
any1 way 2 do this?
Well, what you are asking will take a few steps.

We first have to make a mob var list names something like "placesvisited". THen you can make an area or turf that you would want to warp to. Lets call it "Warp1"

mob
var/list/placesvisited = list()

area/warps
Warp1

Now when we Enter it, we want its name to be added to the places visited.

area/warps
Warp1
Entered(mob/M)
M.placesvisited += src.name // The warp's name, Warp1, is added to your places visited

You can make as many warps as you want. Now for the Gateway.

We make a turf called "Gateway" and when you enter it, it gives you a list of places you want to go to. And temporarily add "Close" to the list so you can close the menu if you change your mind.

turf/Gateway
icon = 'Gatway.dmi' // make it have an icon
Entered(mob/M)
var/area/warp/A = input("Where do you want to go?","Location") in src.placesvisited + "Close"
if(A == "Close") return // if you pick close, it stops the Entered proc.
for(var/area/warp/W) //for the warps in the world
if(W.name == A.name) //if its name is the name you picked
M.loc = W.loc // You go to the warp's location.
M << "You have traveled to [A.name]!"


I hope this helps you. =)

~~Dragon Lord~~
In response to Unknown Person
thnx! only 1 thing,i get an error when i choose an area,says:

runtime error: Cannot read "A".name
proc name: Entered (/turf/Gateway/Entered)
source file: teleport.dm,22
usr: Kablez (/mob)
src: Gateway (8,8,2) (/turf/Gateway)
call stack:
Gateway (8,8,2) (/turf/Gateway): Entered(Kablez (/mob), the floor (7,8,2) (/turf/floor))

and heres the code(fixed a little for my needs):
mob
var/list/placesvisited = list()

area/warp/A
A
Entered(mob/M)
M.placesvisited += src.name // The warp's name, Warp1, is added to your places visited


area/warp/A
Warp1
Entered(mob/M)
M.placesvisited += src.name // The warp's name, Warp1, is added to your places visited

turf/Gateway
icon = 'teleport.dmi' // make it have an icon
icon_state="gate"
Entered(mob/M)
var/area/warp/A = input("Where do you want to go?","Location") in usr.placesvisited + "Close"
if(A == "Close") return // if you pick close, it stops the Entered proc.
for(var/area/warp/W) //for the warps in the world
if(W.name == A.name) //if its name is the name you picked
M.loc = W.loc // You go to the warp's location.
M << "You have traveled to [A.name]!"

In response to Kablez
First of all, you don't change the name for area/Warp1 to area/Warp1/A. The A is there on the Entered part of the turf because we need a var defining the area. Otherwise, it should work.
In response to Unknown Person
still not working:P same error
In response to Kablez
"A" isn't an object, it's a text string. So it doesn't have a name. =)

Change this line:

if(W.name == A.name) //if its name is the name you picked

to this:

if(W.name == A) //if its name is the name you picked
In response to Crispy
now it teleports but im in a black area when the area im suppose 2 be is grass
In response to Kablez
really need help with this
any1 know?
In response to Kablez
i still have the same error
In response to Kablez
i would also like to know...........can u guys make a demo about it? its kinda confusing and im getting the same error
In response to Kablez
turf/Gateway
icon = 'teleport.dmi' // make it have an icon
icon_state="gate"
Entered(mob/M)
var/A = input("Where do you want to go?","Location") in usr.placesvisited + "Close"
if(A == "Close") return // if you pick close, it stops the Entered proc.
for(var/area/warp/W) //for the warps in the world
if(A == W) //if its name is the name you picked
M.loc = W.loc // You go to the warp's location.
M << "You have traveled to [A.name]!"

this might work
In response to Shy_guy197
Shy_guy197 wrote:
turf/Gateway
icon = 'teleport.dmi' // make it have an icon
icon_state="gate"
Entered(mob/M)
var/A = input("Where do you want to go?","Location") in usr.placesvisited + "Close"
if(A == "Close") return // if you pick close, it stops the Entered proc.
for(var/area/warp/W) //for the warps in the world
if(A == W) //if its name is the name you picked
M.loc = W.loc // You go to the warp's location.
M << "You have traveled to [A.name]!"

this might work


Ummmm.... no. please, i used to try and help people when i hadn't a clue if it was right or not. people got angry at me because new people may think its good coding and try to use it in there game and screw their game up. Try testing your code first to see if its right :)
In response to Starwarspower
so it don't work? well sorry my bad I usually do test it but as you see in a post I just make I got a problem... I'm simply trying to help this poor dude... I said at the bottom to this might work... even a new person can understand them words..... so I'm really not worried about someone trying it it's simply their risk.... specially if I say "it might work"
In response to Shy_guy197
this time I'm getting rid of might work and say will work.. (not for sure but I have tested it but not like the dude told you...)

try this
turf/Gateway
icon = 'teleport.dmi' // make it have an icon
icon_state="gate"
Entered(mob/M)
var/A = input("Where do you want to go?","Location") in usr.placesvisited + "Close"
if(A == "Close") return // if you pick close, it stops the Entered proc.
for(var/area/warp/W) //for the warps in the world
if(A == W) //if its name is the name you picked
M.x = W.x // You go to the warp's location.
M.y = W.y
M.z = W.x
M << "You have traveled to [A.name]!"

I tryed saying M.loc = W.loc but it sends me to my first loc which didn't work... so try this I'm sure it will work.. I have the same stuff almost except for the Entered() thing mine is an item, so it should work right...
In response to Shy_guy197
It still is bad because YOU ARE USING USR IN ENTERED()! NEVER USE USR IN ENTERED()!
In response to Garthor
change usr.placesvisited to M.placesvisited ^_^; oh yeah I just tested a area/warp/Entered(mob/M) usr << "OK" and it works... so I really don't see a problem with using usr... but it would be better to use M but technically speaking it DOES WORK but it might be better to put it as M
In response to Shy_guy197
That still doesn't get rid of usr. Please think before you type.
In response to Garthor
can you explain what you talking about? your kinda confusing me... I did Entered(mob/M) and put in a code like usr << "OK" and it said it to me... so it does work that way... what do you mean it doesn't get rid of usr?
Page: 1 2