![]() |
NPC baddy
I'm making an NPC baddy again. This time, I am using the classic system, so it's a bit different. Anyway, I'm having trouble damaging it. So far, the only sure fire way to do it is to shoot him. I originally didn't put the wa****, wasshot, etc in the timeout, but I decided to try it to make it easier to hit him.
No luck. Any ideas/suggestions? (other than taking the sleep() command out of when the baddy is hit, that wouldn't change this, and I do plan to take it out and replace it with a timeout once I have everything working right. I also plan to add some better AI). PHP Code:
|
I'm trying to do some movement...not working.
How do you use move(), and am I using the scripts right...and wil this make it easier to attack the baddy? PHP Code:
|
move(x,y,time,options);
x = move how far from current position horizontally y = move how far from current position vertically time = time it takes to get from starting point to ending point options = cachtype(0,1,2) blockcheck(4) eventwhendone(8) applydir(16) blockcheck = test to see if the tile is blocking or not eventwhendone = stops moving after one movement. other wise the NPC will move forever in that direction. applydir = if the the char current gani has 4 dir it will apply it when it moves Here's a NPC I use for a townsfolk randomly move PHP Code:
|
Thanks, that helped a lot.
Moves a lot smoother now, although I still can't find a way to hit him x_X full script below. PHP Code:
|
One thing, I've never seen a function inside a function >_>
Ah, instead of all the onwall detection you could of used an algorithm, or onwall2( x , y , width, height) and, may I edit the script? I'll post it if I get it to work :O |
Quote:
I plan to add more. I want 'smart' baddies. The functions within the timeout are there because I was testing to see if it would work. I believe I put them outside of the timeout as well. |
Quote:
PHP Code:
|
It's detecting the Was Hit() function, but it isn't detecting the player.swordpower variable, and for some reason, even if I set it to a normal number, it still does not work, unlike the bomb and bow, which will do damage (in fact, the bomb does too much, I have to set a limit of some sort on the explosion detection).
|
Quote:
It would work wihtout 'function' <_< |
Quote:
|
yeah... i generally do
PHP Code:
I think the original comment was about the fact excal had function wa****() inside a function ontimeout() .... |
The old gs1 baddy used wa****, why wouldn't it work on this one?
|
Quote:
|
| All times are GMT +2. The time now is 03:03 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.