First step toward Lua scripting

Today I saw a code that made me realize how much I need this feature that I announced in the 1st BT.CPP workshop:

<BlackboardCheckString   
       value_A="{mode}"  
       value_B="RUNNING" 
       return_on_mismatch="FAILURE">
   <AlwaysSuccess />
</BlackboardCheckString>

Wouldn’t be wonderful to have an Action that does exactly the same, like:

<ConditionScript script="{mode} == RUNNING" />

And imagine this:

<ConditionScript name="check_battery" script="{battery_voltage} > 10" />

And what about:

<SetBlackboard output_key="error_code" value="66"/>

being conveter to:

<ActionScript script="{error_code} = 66" />

This is the first step toward inserting a scripting language inside XML (that I always use as a scripting language.

This example, in my opinion, is just the tip of the iceberg of what can be done with this “meta-scripting” in terms or readability.

What do you think?

1 Like