I'm messing around with the ext_mmfi file that comes with the XLua examples and I am having some trouble. If you're going to look through this and test out what I'm doing please be aware that XLua doesn't currently handle collisions correctly with HWA and you'll have to open up the example in normal MMF2 for it to work.
Currently the demons are set up like this in the embedded lua script:
- demonClass.common.x_vel = 1
- demonClass.common.y_vel = 0
- demonClass.common.x_accel = 0
- demonClass.common.y_accel = 1
Which works just fine, but I'm trying to get the variables to be set based on alterable values A,B,C and D. So I put:
- demonClass.common.x_vel = self.values[mmf.ALT_A]
- demonClass.common.y_vel = self.values[mmf.ALT_B]
- demonClass.common.x_accel = self.values[mmf.ALT_C]
- demonClass.common.y_accel = self.values[mmf.ALT_D]
When I do that I get the debugger error of "[string "Demon AI"]:87: attempt to call method 'step' (a nil value)" so apparently I'm trying to access them wrong.
What is the correct way to do this? I've looked at the documentation on values and it looks like what I'm doing should work.
Thanks for your help in advance!