grass1
icon = null
Entered(mob/M)
if(ismob(M))
var/R = rand(1,20)
if(R == 1)
usr.oldx = usr.x
usr.oldy = usr.y
usr.oldz = usr.z
usr.loc = locate(6,6,2)
usr.icon_state = "vis"
usr.islocked = 1
usr.overlays -= /obj/mobhead
usr.overlays -= /obj/mobhead2
var/mob/S = new/mob/Skeleton
alert(usr,"A level [S.level] [S] appears before you!")
sleep(10)
battle(S)
if(R == 2)
usr.oldx = usr.x
usr.oldy = usr.y
usr.oldz = usr.z
usr.loc = locate(95,6,2)
usr.icon_state = "vis"
usr.islocked = 1
usr.overlays -= /obj/mobhead
usr.overlays -= /obj/mobhead2
var/mob/S = new/mob/Snake
alert(usr,"A level [S.level] [S] appears before you!")
sleep(10)
battle(S)
else
return ..()
Now when i enter sometimes,it randomly starts a battle.and theres no grass1 turfs under me.Whys that?
ID:148477
![]() Jan 31 2003, 1:26 am
|
|
im not good at coding, and unless a guru tells you to, don't take my advice, but shouldn't you use enter not entered?
|
KitKate20 wrote:
im not good at coding, and unless a guru tells you to, don't take my advice, but shouldn't you use enter not entered? No, because Enter() is only for determining if you can or can't enter a turf. Entered() is called after you do enter, which is the correct way to do it. Lummox JR |
Depends on the situation. In this case, it really wouldn't matter, but it would probably be more efficient to use Enter (from my point of view anyway).
|
but it won't matter in this situation. ^_^
Trust me, I'm doing the same exact thing, only I did use Enter instead of Entered. So bleh =P |
1. Check your world.turf var (I think thats the right var. this var is the default turf when you load up a map)
2. Is grass1.icon supposed to = null? =P |
Ghaleon wrote:
but it won't matter in this situation. ^_^ I'd say it does matter; modifying Enter() will cause an action to happen before the move is complete, and will even act on simple movement checks. Doing it the wrong way instead of the right way closes doors that aren't necessary to close. And even though it works for your situation, what's the point of actually advising someone to do it backwardly when they can do it a better way and have more flexibility out of it? That's just unnecessary. Don't go actually telling people to do something they shouldn't be doing, just because it may work in a limited case you're used to. Lummox JR |
Lummox JR