Python based Input map and agent state machine example

(BluePrintRandom) #1

Python based Input map and agent state machine example

State_machine_added_melee3b.blend (1.1 MB)

(BluePrintRandom) #2

State_machine_added_melee3c.blend (1.1 MB)

added actor swap and changed the name proccessInput to ApplyMovement

(BluePrintRandom) #3

For those who don’t understand

this gives you the following abilities

  1. infinite number of python functions that are states
  2. control is seprated from input - meaning multiple controller could target copies of the same actors - (good team / bad team / whatever)
  3. keybinding is 2 dictionaries - giving the ability to easily add a keybinding screen.
  4. ability to feed a list of states to do in order - [ (walk, mark),(dialog,string),(switch,target) ]
    (for story telling / sequencing)

( #4

Sounds cool, could you design a simple API for mortals like us?

system.addState('state', function) and others?

Stuffing things into lists/dicts is not the best API to use :slight_smile:

Humans like to write with words and manipulate simple concepts.

(Lostscience) #5

could i use this code in a game?this would be great for getting in a vehicle and then controlling a different vehicle.And then getting out of that vehicle and then getting in another vehicle then control different vehicles.