ID:273036
 
Hey, I was working on a game and I was wondering how would I go about making it so that when you walk in a certain turf mobs would appear randomly, I used an "Entered()" proc but I can't seem to get the mobs to appear..I was wondering if anyone could help me?


Please and Thanks for future preferences.
Did you created a /mob or called a procedure that would do so?
In response to GhostAnime
I don't know how to create the procedure, I left BYOND for a while and have forgotten most of the stuff, I was wondering if someone could help me out with that.
Kakashi_sean95 wrote:
Hey, I was working on a game and I was wondering how would I go about making it so that when you walk in a certain turf mobs would appear randomly, I used an "Entered()" proc but I can't seem to get the mobs to appear..I was wondering if anyone could help me?


Please and Thanks for future preferences.

well for my guess, dont know if its gonna be completely right, cause i'm not gonna test the code
     area // I think that a area would work best because... yea
Monsters // just a little sub category
Entered(mob/M as mob) //calling the entered proc
var/mob/A = new/mob/monster/pie // this just defigns a new variable set to the key "A" and anything that is "A" is a /mob/monster/pie and it will always use A as that one mob, it wont make a new mob... yes pie is a monster
// you also can add in more monsters in it by making a new var which would look like this var/mob/B = new/mob/monster/pie, everytime you want a new monster in there you have to make a new varible and change the letter so the coding doesn't get confused
A.loc = M.loc // just brings that new mob to where you are, so it will poof right there
//If you used the previous information you will also have to add in a new proc right after ( or before) this line which should look like this B.loc = usr.loc and so on
// At this point you can make the mob step in some random direction incase you dont want it to be right under the users feet by using the step_rand() proc, for example
step_rand(A)
// you can almost do anything do to the fact that that spicific mob is represented by the variable A, even call other proc's to that mob in general like move(A) or death_check(A), whatever


i'm not postive that that code will work, i never tested it and you will have to do some arrangements to it because it is kinda sloppy, and you have to modify it to your standards but whatever

i used a simmilar type of code in one of my games, and it seemed to work fine, but i'm not sure if it is the best way to do this, but it works

[Edit]
there you go happy, i changed it from usr to M, not that much of a change, but it thought that anybody with a brainstem would find that out and change it with that.
In response to Xxdragonslxx
You should not be using usr in procs, and those comments are an unhelpful mess.

Please don't try to provide help before you are experienced with the language. Bad help is worse than no help.