![]() |
Npc attacking doors
NPC Code: Ok, this is supposed to find npcs that are enemies with hearts, and destroy them, then retarget, but it not only wont retarget, sometimes the first target will be a door or something. Why the heck does it do this is it my mistake or a bug in graal programming? |
Please format your code first.
|
Wtf? did my post get removed?
I'll rewrite it. Maybe you should break after finding the npc? NPC Code: You can use getdir() or the move option. NPC Code:dir=getdir(npcs[this.i].x-x,npcs[this.i].y-y); the move look unsmooth. use option 2. |
1.) Format your code properly
2.) Vex, if you want to help, format your code properly as well. |
My name is Kjetil, and what in the world was wrong with my formating?
I see nothing wrong in NPC Code:dir=getdir(npcs[this.i].x-x,npcs[this.i].y-y); If you acctuly look, you would see that I posted the same as he, to point out that it was that part I meant...! |
Quote:
|
whats "properly formatted" I thought it just had to be spaced a bit I hate these rules....
|
Quote:
|
K ill do that real quick but please help this happpens on many npcs
|
Quote:
[MADtv Stuart mode] Pyt, LOOK WHAT I CAN DO!: [/MADtv Stuart mode] NPC Code: |
thanks ill try that asap
|
meh didnt seem to make a difference
|
is like the players[i].hearts and npcs[i].hearts command bugged? weird
|
I didn't do anything, I just formated it better.
All the players[i].vars and npcs[i].vars are READ-ONLY. |
i know wthat but that means
NPC Code:should work, but it ignores that flagif (npcs[i].hearts>0) do what i say; |
Quote:
NPC Code: I'd say more, but you're better off getting your script to work before worrying about refining your scripts. "learn to walk before you run" As we say consarnit extra spaces in the code brackets, BAH I say! Edit: what's up with all this non-sensical spam? this forum used to be nice |
Edit by Spark: DIABLO2099's post and those relating to it deleted upon request.
|
OK ill try that now i didnt no about the break command....
|
Well, you use this.i to check the players, but then if (npcs.[i]hearts>0)
there is no i, only this.i! |
this.i is always going to max out because there isn't a break command whenever you find it. So if there are 10 npcs in the level, this.i will always be maxed to 10.
|
Perhaps the problem is that your NPC does not has hearts? As far as I heard NPCs do not automatically have hearts...
|
Quote:
Quote:
|
any npc it shuld go after have hearts, thats the thing. It shuldnt be going after doors and such, which it does..
|
| All times are GMT +2. The time now is 08:46 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.