In response to Skye Reaver
|
|
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.
|
In response to YMIHere
|
|
Oh to hell with it, I give up on DM >_>
|
In response to Skye Reaver
|
|
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 |
In response to Skye Reaver
|
|
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 |
In response to Hell Ramen
|
|
_> 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. |
In response to Skye Reaver
|
|
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. |
In response to YMIHere
|
|
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 |
In response to Skye Reaver
|
|
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. |
In response to YMIHere
|
|
#define DEBUG That? I get no runtimes with that, but the turret doesnt shoot at all even when I get in view. |
In response to Skye Reaver
|
|
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. |
In response to N1ghtW1ng
|
|
YAH0000! Total Worketh XDDD
|
In response to N1ghtW1ng
|
|
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 |
In response to Skye Reaver
|
|
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() |
In response to Skye Reaver
|
|
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. |
In response to N1ghtW1ng
|
|
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. =)
|
In response to YMIHere
|
|
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. |
In response to Skye Reaver
|
|
No put usr in proc. Ungh.
Lummox JR |
In response to N1ghtW1ng
|
|
To do it that way would require another proc, but it's an acceptable way to do it also.
something |
In response to Skye Reaver
|
|
As Lummox said, usr is innappropriate here (it may look like caveman speak to you, but that's just the filters. =P). When atom/movable/Bump() is called, the atom that got bumped into is the argument.
Bump(atom/A) |
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))