Elemental Geekout: Dumb Outlaw
Welcome to the first of an ongoing series for people interested in game development.
Tonight, I’m trying to figure out why an outlawis just standing there instead of either a) running away,
attacking, or c) just doing something.
So here is this outlaw. He’s not doing anything. Why?
First step was to rename him into something easy to identify in the debugger -- “Dumb Outlaw”.
Now in the debugger I wait…
He’s trying to go to tile 57, 51.
So why isn’t he moving???
It turns out, it’s because when I spawned the unit, I fenced them in. I randomly gave them a range in which they could wanter. Well, some units got a fence of 0 and so even if I told the unit to go far away, it didn’t matter because it wouldn’t go beyond its fence.