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
ID:175464
![]() Apr 20 2003, 12:28 pm
|
|
![]() Apr 21 2003, 12:05 am
|
|
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~~ |
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]!" |
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.
|
"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 |
i would also like to know...........can u guys make a demo about it? its kinda confusing and im getting the same error
|
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 |
Shy_guy197 wrote:
turf/Gateway 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 :) |
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"
|
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... |
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
|