extends AIScriptModule

# Declare member variables here. Examples:
# var a = 2
# var b = "text"


# Called when the node enters the scene tree for the first time.
func init(tick):
	var root = get_character(tick)
	assert(root.has_meta("skeleton"))
	var cmdq = []
	if root.has_meta("cmdqueue"):
		cmdq = root.get_meta("cmdqueue")
	cmdq.push_back(["register_marker", self, "head/marker_talk", {"method": "talk"}])
	cmdq.push_back(["register_marker", self, "head/marker_hips_action", {"method": "action", "action": "hips_action"}])
	cmdq.push_back(["show_marker", "head/marker_talk"])
	cmdq.push_back(["show_marker", "head/marker_hips_action"])
	root.set_meta("cmdqueue", cmdq)

func talk(data):
	print("TALK")
#	var root = get_parent()
#	root.set_meta("req_state", "TALK")
#	scenario.emit_signal("talk", root)

func marker_hips_action(data):
	print("ACTION")

func action(data):
	return
#	var root = get_parent()
#	root.set_meta("req_state", "ACTION")
#	if root.is_in_group("nuns"):
#		scenario.nun_action(root)
#	else:
#		if data.action == "hips_action":
#			print(data)
#			marker_hips_action(data)

func update(tick, delta):
	return ERR_BUSY
func update_physics(tick, delta):
	return ERR_BUSY
