On the topic of CTI2 cards
Posted: 30 Jan 2017, 14:46
So I was thinking about the ease and compatibility of CTI2 cards. Currently, the cards do most of the work, they're little programs in themselves. Fun, flexible, but not very practical. This is because CTI2 cards will need to be compiled into the viewer which means that they'll always be relying on the rest of the viewer. So I was wondering if instead of compiling the cards as little programs into the viewers, why not make the viewer follow instructions. An example:
Say we want a Stroke It cards which ups the strokerate by one each card until say, the next instruction card:
We can use an object:
We could also add extra code simply by adding another block to the object:
Now to summerize the pros and cons:
Pro's:
Say we want a Stroke It cards which ups the strokerate by one each card until say, the next instruction card:
We can use an object:
Code: Select all
{
info: {
type: "Stroke It",
text: "Hurry up! Add 1 to your strokerate every slide until the next instruction card. Also lube up!",
deck: "Supplemental",
artist: "Jack the Belter"
},
condition: { //a contion required for the card to be drawn (see initialize in the next code block)
chastity: false, //checks if the player is in chastity for example
item: {
check: "available", //checks if a certain item is available, could also be something like "equipped" or "in_use"
item: "lube"
}
},
action: {
data: "strokerate", //Or a number representing strokerate
action: "+1", //first character representing a mathamatical function + for adding, = for setting or for formula's, - for substracting, * for multiplication, etc.
on: "slide", //could be "instruction" or "all" or something else
until: "instruction" //could be "end" (of tease) or "strokit", the next stroke it card.
item: {
item: "lube" //Yes, lube up!
enabled: "true" //Put lube in use to true so other cards will be able to notice.
}
},
after: {
//instruction same-y to action for an action after completion of the card.
}
}
Code: Select all
code: {
action: {
//some action not bound to an event occuring
}
},
initialize: {
//some action on loading the card, preferably before the card is ever drawn or the order of cards is decided.
},
query: {
options: { //A query adding options to a card, could perhaps also be added in 'after' (see previous example)
1: {
text: "Yes, give it to me!",
action: {
//Some action which only happens when you select this.
}
},
2: {
text: "No, your examples are stupid.",
action: {
action: "noaction" //Nothing happens when you press this.
}
}
}
}
Pro's:
- Easy to read & write for everyone who's willing to put some time into this.
- Easy to integrate, you can have .json files just in a folder, instead of compiling them into the code.
- Easy to share, because they dont have to be compiled or anything.
- Less flexibility, because the lack of direct programming POWAA!
- New work for 0131