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, b) attacking, or c) just doing something.

image

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”.

image

Now in the debugger I wait…

image

image

He’s trying to go to tile 57, 51.

image

So why isn’t he moving???

image

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.

1,890 views 0 replies