im just starting and im starting my first game.
the game has a start up menu at the biggining and in it there the the option to go to would one
now i made a code that when the user click on World One they get sent to 'destenation'
Here is the code:
turf // turf
PlayNow // the name of the turf
icon = 'world1.bmp' // the icon of the turf
density = 1 // if 1, you can't walk through it
Click() // if you click it...
Entered(mob/m)
var/dest = locate(src.destination)
if (dest) // if no destination set in the map editor, don't do anything
m.Move(dest)
else
. = ..()
it says proc definition not allowed inside another proc
i dont know what to do?
can anyone help, Also can you tell me if this code is correct?
ID:172706
![]() Apr 5 2004, 7:06 pm
|
|
Ok i still have a problem.
so you are saying that my code is wrong and i should use this code: turf // turf World1 // the name of the turf icon = 'world1.bmp' // the icon of the turf density = 1 // if 1, you can't walk through it Click() // if you click it... locate("World1") i did put that code and when i run the game and click on World One it wont take me to where i put the tag. My whole code: mob // mob or mobile Login() // login proc src.loc = locate(6,6,1) //locates the person to the title screen area... src << "Welcome to [world.name]!" world name = "Ebay" // the world name version = 1 // the world version hub = "UnknownPerson.TitlePageDemo" // where it is on the hub view = 6 // how many tiles you want to see. Note that you will have to change the size of the title screen if you change this. You will also have to locate in a different place... turf = /turf/Grass // the default turf mob = /mob/Player // the default mob or player client/New() // when they log in... world << "[src] has joined!" // alert the world ..() // does the default commands client/Del() // when they log out... world << "[src] has left!" // alert the world ..() // does the default commands turf // turf World1 // the name of the turf icon = 'world1.bmp' // the icon of the turf density = 1 // if 1, you can't walk through it Click() // if you click it... locate("World1") turf // turf Ebay // the name of the turf icon = 'ebaysign.bmp' // the icon of the turf density = 1 turf // turf lineup // the name of the turf icon = 'lineup.bmp' // the icon of the turf turf // turf lineright // the name of the turf icon = 'lineright.bmp' // the icon of the turf density = 1 turf // turf world1 // the name of the turf icon = 'world1.bmp' // the icon of the turf density = 1 turf // turf world2 // the name of the turf icon = 'world2.bmp' // the icon of the turf density = 1 turf // turf world3 // the name of the turf icon = 'world3.bmp' // the icon of the turf density = 1 turf // turf black // the name of the turf icon = 'black.bmp' // the icon of the turf density = 1 turf // turf black1 // the name of the turf icon = 'black1.bmp' // the icon of the turf density = 1 exit icon = 'exit.bmp' density = 1 Click() switch(alert("Are you sure you want to exit [world.name]?","Exit?","Yes","No")) // alert them in a box if they want to really leave if("Yes") // if they want to... usr << "Suit yourself!" // alert them "suite yourself!" del(usr) // logs them off else // else (that means if they click no or anything else) usr << "Thanks for staying" // thank them for staying ggggg icon = 'turfs.dmi' icon_state = "ggggg" layer = 5 // makes it at the top layer because you don't want to see yourself at the title... density = 1 // can't walk through it White icon = 'turfs.dmi' icon_state = "white" layer = 5 density = 1 Yellow icon = 'turfs.dmi' icon_state = "yellow" layer = 5 density = 1 Grass icon = 'turfs.dmi' icon_state = "grass" mob Player icon = 'Player.dmi' |
That aside, you almost have it, but not quite. What you're looking for is the tag variable. Basically, it's set to a text string, and you can use locate() to find it again by that text string. So, isntead of using locate(src.destination), you can use locate("World1"), and then, on the map editor, right click on a turf, select edit properties, and change the tag variable to "World1".
Also, .=..() is pointless in Click().