ID:177989
Jul 3 2002, 2:32 am
|
|
I read everything, have everything ready, but now I need help making a monster that walks around and attacks people. Variables I will be using are HP, Strength, and Expup. In case that helps.
|
Copyright © 2025 BYOND Software.
All rights reserved.
A common system for this is to make a loop that wanders at random, approaches any player in view, and attacks once it gets up to them. I think I like this variation a little better:
This will make a monster patrol around until it finds a player, and attack the nearest one. My version of this code would use a "sleep mode" to conserve CPU cycles--useful if you have a lot of monsters--so that you can simply wake monsters when a player enters their vicininty (perhaps through turf.Entered() signaling them).
Lummox JR