XOML Conditions – New IwGame Feature Coming Soon

Thought I would put a quick update outlining what’s happening with the IwGame Engine. In-app purchasing has been started, so hopefully that will make it into 0.32. We are looking at a way of combining iOS and Android in-app purchasing into the same system (CIwGameMarket). Will provide more details when the system is up and running.

One cool change that’s just been finished is XOML Conditions. XOML conditions are variables that evaluate to either true or false and their value is an expression of other variables. Lets take a quick look at an example:

<!--Create a bog standard int variable that contains the current level --/>
<Variable Name="current_level" Type="int" Value="1" />
<!--Create a condition variable that tests that the current level is between 1 and 9 --/>
<Variable Name="low_level_extras" Type="condition" Value="current_level GTE 1 AND current_level LT 10" />

The above condition variables value is basically an if statement which translates to:

if (current_level >= 1 && current_level < 10)

But what use is that to anyone you may ask?

Lets consider that we have an actions group such as that show below:

<!-- Next scene action -->
<Actions Name="NextScene">
    <Action Method="LoadXOML" Param1="MainScene.xml" />
    <Action Method="LoadXOML" Param1="LowLevelExtras.xml" Condition="low_level_extras" />
    <Action Method="KillScene" />
</Actions>

The above actions set would usually just load the MainScene scene and run it then load the LowLevelExtras scene and run that. However using the condition variable LowLevelScene will only be loaded and ran if the condition variable low_level_extras equates to true, allowing us to only load the extra stuff if the level is between 1  and 9. The condition variable is evaluated at run-time so you can change variables and affect the result, allowing a very dynamic system to be put together.

It may seem like a small change but it adds the ability to add mark-up side logic, which IMO is huge. My mind is whirring away with ideas for its use at the moment!

Conditions can be attached to individual actions as well as actions groups

XOML Bindings

XOML bindings are currently being implemented (nearly finished). This allows you to bind properties of objects such as actors and scenes to XOML variables using a bindings  list. When you change the value of the XOML variable it also changes the value of the property that it is bound to. This system will be particularly useful for hooking up UI’s and HUD’s to in-game data.

 

 

 

 

5 thoughts on “XOML Conditions – New IwGame Feature Coming Soon

  1. Jim says:

    Looking forward to these additions, They will hall and simplify the design a lot

  2. ir2pid says:

    i’m having some problems setting up inapp purchase n fetching product info, hope u’ll make a guide explaining the steps required for setting up test accounts etc.

  3. drmop says:

    I will include info like this in the documentation

  4. arausseo says:

    These are good features… for the In-app purchase, are you going to support Amazon App Store in this release?

    Keep the good work

  5. drmop says:

    I don’t think that we will be covering the Amazon app store as its Android specific.

Leave a Reply