ID:261238
 
Is it possible to have a mob be randomly located ANYWHERE on the map using tags, like when somone dies or something. I know how to do it just using coordinatees, but I don't know how to do it this way. Can somone point me in the right direction please?
Thank You

=Wizard of How=
_______________
The Wizard of How wrote:
Is it possible to have a mob be randomly located ANYWHERE on the map using tags, like when somone dies or something. I know how to do it just using coordinatees, but I don't know how to do it this way. Can somone point me in the right direction please?
Thank You

=Wizard of How=
_______________


proc/die()
if(usr.hp <= 0)
usr.loc = locate(1,1,1)


Try something like that.
In response to Sariat
he said he knew how to do it with numbers, or coords, he wants to use TAGS!

Please read these posts before posting the answer.
In response to FIREking
FIREking wrote:
Please read these posts before posting the answer.

Oh, the irony.
Try this...

mob/proc/Die()
var/xx = rand(1,world.maxx)
var/yy = rand(1,world.maxy)
var/zz = rand(1,world.maxz)
src.loc = locate(xx,yy,zz)


It should work!
In response to Lord of Water
Well....it didn't :(. If i bump into the mob, it disappears, but it gets taken to another map. Here's the coding.....

mob
Bump(mob/M as mob in view(1))
if(istype(M,/mob/Apple))
var/x = rand(1,world.maxx)
var/y = rand(1,world.maxy)
var/z = rand(1,world.maxz)
M.loc = locate(x,y,z)

What's wrong with it?
In response to The Wizard of How
The Wizard of How wrote:
Well....it didn't :(. If i bump into the mob, it disappears, but it gets taken to another map. Here's the coding.....

mob
Bump(mob/M as mob in view(1))
if(istype(M,/mob/Apple))
var/x = rand(1,world.maxx)
var/y = rand(1,world.maxy)
var/z = rand(1,world.maxz)
M.loc = locate(x,y,z)

What's wrong with it?


x y and z are already default vars made by dream maker change them to X Y Z.
In response to Nadrew
Still the same problem.....sigh.
In response to The Wizard of How
The Wizard of How wrote:
Well....it didn't :(. If i bump into the mob, it disappears, but it gets taken to another map. Here's the coding.....

mob
Bump(mob/M as mob in view(1))
if(istype(M,/mob/Apple))
var/x = rand(1,world.maxx)
var/y = rand(1,world.maxy)
var/z = rand(1,world.maxz)
M.loc = locate(x,y,z)

What's wrong with it?

mob
Bump(mob/M as mob in view(1))
if(istype(M,/mob/Apple))
var/x = rand(1,world.maxx) var/y = rand(1,world.maxy)
M.loc = locate(x,y,1)


Try that, It should keep the thing from going to another z level. I think that was your problem.
Yeah, just use locate() to find what you wish to relocate to.

-James
The Wizard of How wrote:
Is it possible to have a mob be randomly located ANYWHERE on the map using tags, like when somone dies or something. I know how to do it just using coordinatees, but I don't know how to do it this way. Can somone point me in the right direction please?
Thank You

=Wizard of How=
_______________


If you really don't like coordinants you could do it like this

RandomMove(mob/M)
{
var/testloc
while(!isturf(testloc))
testloc = world.contents[rand(1,length(world.contents))]
M.loc = testloc
}

Just make sure you have atleast one turf in world.contents :).
In response to Vortezz
Yes, but at least i read them now, or dont even bother. A majority of the younger people at byond dont have good grammer, it isnt their fault, because maybe they haven't been taught good grammer yet. So its often hard to understand what someone is trying to say, or "mean".
In response to FIREking
Who are you talking about?
In response to FIREking
FIREking wrote:
Yes, but at least i read them now, or dont even bother. A majority of the younger people at byond dont have good grammer, it isnt their fault, because maybe they haven't been taught good grammer yet. So its often hard to understand what someone is trying to say, or "mean".

If they haven't been taught, and they go to school its their fault. If they dropped out at the age of 8 or something, its not.

Alathon
In response to Alathon
If they dropped at 8 it's very much their fault. The sad thing is that, in most situations, people don't know what's good grammar/spelling and what isn't. Know why? Because their parents don't spell things right or use correct grammar.
In response to Lord of Water
Lord of Water wrote:
If they dropped at 8 it's very much their fault. The sad thing is that, in most situations, people don't know what's good grammar/spelling and what isn't. Know why? Because their parents don't spell things right or use correct grammar.

And so, the circle of life begins anew.
In response to Lord of Water
Look on the bright side. When enough semi-literates adopt an incorrect grammar style, the English language changes to accomodate them! One of these days "you" will be considered an archaic form of "u", just as "thou" is now an archaic form of "you".
In response to Lord of Water
Lord of Water wrote:
If they dropped at 8 it's very much their fault.

How is dropping out at 8 their fault? The way I see it, if you have an 8 year old child its more your responsibility to keep them in school.

The sad thing is that, in most situations, people don't know what's good grammar/spelling and what isn't. Know why? Because their parents don't spell things right or use correct grammar.

I have yet to see, in my small life of 14 years a grown up write a letter in a format as such:

"Hey pops, ho bout me n u go fishin' out da pond over lake 10 miles down street?"

Alathon

In response to Vortezz
hey you know whats funny?
you thinking that im a snippet wizard,
haha!