• Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Chances and Choices

Sign in to follow this  


Actors and Action

So today I was implementing a bit of AI for my actors. I have a state machine set up in my AiActorController class. The actor class polls the controller class on what it should be doing (moving in a direction, fleeing, jumping, etc). I also made an InputActorController class to handle input from the player. Right now the input controller takes only specific keys and converts them into action commands (ACTION_MOVEUP, ACTION_SPRINT, etc) because I haven't setup my ActionMapper yet.

I'm delaying on the ActionMapper because I'm trying to find a good GUI to use. I feel that CEGUI is overkill, so I might just roll out my own or find a simple one that someone made and modify that. But of course, I hope that I don't make a wrong CHOICE in doing that.

I love Lua .. I really do

Speaking of wrong choices, using LuaPlus was probably a bad choice. While I was implementing the AI Controller I had an actor chase my character around WAY WAY too fast and because of newton physics I was realistically getting pushed around. It was pretty cool. It was just a simple pursuit function (if player.x > my.x then my.x = my.x + 1).

Then I decided to make a scripting command to set the movement speed. I used inheritance to let an Employee object inherits from an Actor Object that inherits a MovableObject ... Object that has the setMoveSpeed() function. LuaPlus threw a fit when I tried to bind it because it didn't know if I was talking about Employee::setMoveSpeed .. or the base MoveableObject::setMoveSpeed. After doing some googling research, I realized that LuaPlus didn't have support for inheritance .. and I would have to implement functions such as setNameLua() so that I could call setName() in a script. I think that kind of function duplication is a bit stupid.

Now I'm stuck in a hard place. I have to undo all of my work in LuaPlus, because I don't want to duplicate most of my useful functions so that I can expose them to the scripts. I'm thinking of going for LuaBind because I know that can support inheritance. So .. wish me luck I guess.

Sometimes I wish I was working on a space shooter or something ;)
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement