ID:165265
Jan 27 2007, 7:56 am
|
|
Alright, I'm having some trouble with what I thought was a really simple system: deleting objects when they reach the edge of the map. So here's what's happening. I have a mob proc that creates an object at the player's location, and then I walk() it in the direction the player is facing. What I'm trying to do is make the object delete itself when it reaches the edge of the map. The best I could do was delete the fireball when the player was standing at the edge of the map, which made it look like you didn't shoot at all. I just can't figure out how to do this, and it's really bothering me, because I thought it would be really simple. Thanks.
|
In response to Bladeshifter
|
|
Bladeshifter wrote:
just throw an area, turf, or somthing around the outside of the map..... That's not possible unless you extend your map, and then it's not really so much the outside of the map as a wide border area. Lummox JR |
In response to Bladeshifter
|
|
Yeah, but I don't wanna have to make a new area. I just want to be able to use the coordinates.
|
Seraphrevan wrote:
Alright, I'm having some trouble with what I thought was a really simple system: deleting objects when they reach the edge of the map. So here's what's happening. I have a mob proc that creates an object at the player's location, and then I walk() it in the direction the player is facing. What I'm trying to do is make the object delete itself when it reaches the edge of the map. The best I could do was delete the fireball when the player was standing at the edge of the map, which made it look like you didn't shoot at all. I just can't figure out how to do this, and it's really bothering me, because I thought it would be really simple. Thanks. Since the correct way to do a projectile is to make it responsible for its own movement anyway, just give it a proc to do its own walking, so it can check for the edge of the map. obj/projectile Lummox JR |
In response to Lummox JR
|
|
Alright, I tried something like that, I just modified it a little bit, but now, the projectile doesn't seem to be created at all, but I get no error messages.
[Edit]Alright, I just ran some more test, and it turns out that the projectile DOES get created, but it doesn't actually appear on screen. I did some more tests, and the offending code snippet is the turf part. The code works fine without it, the projectile gets fired. But as soon as I add that part to make the projectile delete itself, the projectile fails to appear. I still haven't found out what's wrong.[/Edit] [Solved]Because there was no lag between each step(), the fireball just travelled off-screen so quickly that it wasn't visible. I added a sleep(1), and that fixed it.[/Solved] |
like...
area/deletezone
then have it check within the fireball shooting proc if there is the area or turf or whatever within its loc... ex: (this should be in the shooting proc)
Or something to that issue :P.