Why did you move that list outside of the proc? It should be right above the for loop. Anyway, you might want to make sure there are mobs is oview(src,10), and if there aren't quit the proc.
|
Skye Reaver wrote:
Oh to hell with it, I give up on DM >_> Nnnnuuu, don't. I used to be the worst nubbie ever. =/ I never gave up...and I got a quarter-way decent. :p Just keep try on smaller things. :p |
Skye Reaver wrote:
Oh to hell with it, I give up on DM >_> No! I put work in here to help you, and now you'll pay me back by getting it working. =P |
_> But I want to be able to do this!!! teheheh, I dun see whats wrong :( Tell meh what to change this too , to make it work... obj Tank ya. |
Well, for starters, tell us what doesn't work about it. Not yet though, I just read up on the missle proc and it only needs a type path. You're doing extra work. =P
You won't be able to copy and paste this, but here's a fix for that. look() Instead of creating the bullet yourself, you give the missle() proc a type path and it will create it for you. Now let us know if anything is wrong, and what it is. |
runtime error: list index out of bounds
proc name: look (/obj/proc/look) usr: null src: Turret (/obj/Turret) call stack: Turret (/obj/Turret): look() Turret (/obj/Turret): New(the turf (10,10,1) (/turf)) obj |
My guess is that there is nobody in oview(src, 10). That why you have to make this check in the proc.
if(!(locate(/mob) in oview(src,10))) // Nobody is there. *Edit Not sure about the order of preference here so I put in extra parenthesis. |
#define DEBUG That? I get no runtimes with that, but the turret doesnt shoot at all even when I get in view. |
Skye Reaver wrote:
#define DEBUG That? I get no runtimes with that, but the turret doesnt shoot at all even when I get in view. Hmm, for this line
Don't you need spawn() to call it? So try this: New() I might be wrong though. |
Another thing Id like it to do...
As long as the mob stays in view, repeat the look() (keep shooting till the mob is no longer in view) #define DEBUG |
You have to be there when it's created because it's called from New(). =)
I have a feeling you want this to run every couple of seconds or so, though, so I'm in head of you. =P Some notes first, you don't need the return and the else, but now that I think about it, it can be done better with just one if and letting the rest fall through. look() Now, to make this procedure run indefinitely we can just put the whole thing in a while loop and add a sleep() in there. =) look() |
Use spawn(), and break. Make if()'s to make sure there is a mob still in the screen when you call it again. So at the bottom do something like
[Code] Make sure you check to see if there is a mob though...I might be terribly wrong and just causing a giant infinite loop though. |
Oh, I overlooked that. That spawn is definitely handy when I changed look() into an infinite loop. If I had to guess, though, I'd say the reason it worked for him is probably because the turret was created before his mob, and that spawn slowed down the calling of the look() proc just enough for him to be created. =)
|
One more thing and ill leave yall alone XD
I want it to output a message to the usr when they are hit with a bullet... obj Obviously thats not working so ... how? XD and the shooting works perfectly, thanks alot. |
To do it that way would require another proc, but it's an acceptable way to do it also.
something |
proc name: look (/obj/Turret/proc/look)
usr: null
src: Turret (/obj/Turret)
call stack:
Turret (/obj/Turret): look()
Turret (/obj/Turret): New(the turf (10,1,1) (/turf))