It is currently Mon Dec 18, 2017 10:41 am

All times are UTC + 9:30 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: CW:T Scripting
PostPosted: Fri Sep 06, 2013 5:41 am 
Offline
User avatar

Joined: Fri Apr 10, 2009 12:13 am
Posts: 55
CW:T already owns a json based rule engine which allows the manipulation of the data flow. As already said, we want to make the game modifiable with the data ( mod file ) and the rules.

Let's have a look how rules looks like.

Code:
    { $when: [
            "FIRETYPE", ["INDIRECT","DIRECT"],
            "RANGE", [5]
        ],   
        att: +1
    }


In a rule you only have $when as special keyword. All other properties of a rule object will be recognized as attributes. An attribute increases / decreases the value of a solve step when the solve step ask for that attribute. If a $when block is given then you can make conditions. If that conditions don't evaluates to true then the attribute value won't added to the solve step.

The problem is that rules maybe difficult to read. That's why the editor supports a custom syntax for the rules as well. The above rule can be written like that:

Code:
RULE
  WHEN
    SLOT FIRETYPE IN DIRECT,INDIRECT
    SLOT RANGE IS 5
  THEN
    INCREASE att BY 10
END


A working document about the attributes and when parameters can be obtained from this location: https://github.com/ctomni231/cwtactics/wiki/Scripting.

Remember that document is still under construction. 8)

---

Sources:

jsonScript engine => https://github.com/Tapsi/jsonScript

_________________
my name is BlackCat


Top
 Profile  
 
 Post subject: Re: CW:T Scripting
PostPosted: Fri Sep 06, 2013 5:50 am 
Offline
User avatar

Joined: Sat Dec 16, 2006 4:45 am
Posts: 635
Location: Samsara
Sorry about that, I don't know why this post went on the approval queue. I'm trying to figure out what's wrong.

_________________
Do not annoy moderators, for they are subtle and quick to anger.

"Bunny-cat is a dick."
~SF Debris, on Puella Magi Madoka Magica.

"It's like they took everything you shouldn't put into a movie... and made a show out of it."
~JakeSamiRulz, on Boku no Pico.

My blog.
My YouTube channel.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 9:30 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Blue Moon by Trent © 2007
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group