ID:165825
 
I have a few tittle screens that I have for my game but I need to know how to have it randomly choose one for a player to see when him/her logs in to play.
Use pick() rand() or prob().
Place each picture anywhere on the map and teleport the player on login to a random one


Heres a quick and simple way to do it using rand
mob/Login()
var/W=rand(1,3)
switch(W)
if("1")
src.loc=locate(X,Y,Z)

And the same for 2 and 3 but different X,Y and Z's

and someone beat me to it.
In response to Xx Dark Wizard xX
which one would work best for tittle screen use?
In response to Dbgtsuperfreak
mob
Login()
var/w = (rand(1,3))
switch(w)
if(1)
loc = locate(1,1,1)
if(2)
loc = locate(2,2,2)
if(3)
loc = locate(3,3,3)

In response to Xx Dark Wizard xX
You could have a turf or area (or mob or obj, whatever) that's positioned at the centre of each title screen, and then using the pick command you could make the code much more robust, eg;

mob/Login()
var/list/titleScreens = list()
for(var/turf/T in world)
if(istype(T,/turf/titleScreen))
titleScreens += T
loc = pick(titleScreens)

turf/titleScreen


And then you'd place down the titleScreen turf in the centre of every title screen, and... run it.

- Conj'
In response to The Conjuror
I understand it and I made what i needed so post is closed.