0 Favourites

[PLUGIN] Scenario

  • ScenarioJ

    Motivation

    rex_scenario plugin runs external commands (script) in csv format, which can be edited in excel, open office, or google document. It could not handle control commands like for loop, while, if..else if ... else.. well. So I tried to find another command (script) format with a better editor. Then I found that I could use C2 event sheet to be the external commands (script) editor, and save commands (script) in JSON format.

    This rex_scenarioJEditor plugin provides actions/conditions/expressions to build external commands (script), then gets the content of commands (script) in JSON string, runs it in rex_scenarioJEngine object.

    Snapshot of editor:

    • Editor: Create Scenario-Json commands. These commnds (script) could be saved into a string variable or an external text file.
    • Engine: Execute Scenario-Json commands which created from rex_scenarioJEditor plugin.

    ----

    Scenario

    I move the document of this plugin to here. Hope it would be more easier to understand.

    Scenario behavior , the behavior version of scenario plugin.

  • User could use delay command and wait command to create a conversation.

    Capx

    CSV:

    0,print,'A: Good morning'
    wait,,
    0,print,'B: Hi'
    wait,,
    0,print,'A: Are you hungery?'
    wait,,
    0,print,"'B: No, I just ate something.'"
    wait,,
    0,print,'A: Well...'
    wait,,
    0,print,'B: I should go'
  • Awesome plugin rex, it�s going to help me in all sorts of manners, thanks.

    Found a little bug(maybe it�s not intended to work this way)

    When you start a list of commands with wait(eg:"wait,,0,move,500,wait,,"), it shows up this error window:

    <img src="https://dl.dropbox.com/u/6813637/bug_rex.PNG" border="0" />

  • My bad, the error happens when you try to break a line after the quotes, like this:

    "

    wait,,

    0,move,500

    waitt,,

    "

    Is it possible to use expressions like random(a,b) as parameters?

  • sheepy

    I strongly suggest user creates csv by excel or google document, that will be more clear, especial the string with newline or ",".

    (Moreover, user could color the cell of csv in excel or google document)

    Yes, user could create random(a,b) by using a+Math.random()*b, since the parameter will go through eval -- it could do some calculation.

    reference - Math object

  • Thanks for the anwser rex

  • Update

    "action:start scenario" will not start if tag is not valid.

    • tag "" means started at first command line
  • Is there any way to use global variables as parameters on the comand lists?

    Is it possible that you create a scroller on the load command field on the next update?

    Your plugins are awesome and now that I?m learning to use them my life is getting easier, thanks

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • For request 1: "Is there any way to use global variables as parameters on the comand lists?"

    I will think about it, not sure if it is possible.

    Request 2: "Is it possible that you create a scroller on the load command field on the next update?"

    Sorry, I could not add a scroller, only Ashley can.

    It might be better using AJAX to get scenario script from external file.

  • If I understand correctly one could use this scenario plugin to make conversation-trees?

    using the wait-function and changing the tag value on user-input?

  • LittleStain

    You are right, see this post -- An adventure game demo for more detail.

  • Update

    Add MEM[index] for passing value into command string. User should set "Eval mode" to yes, to use this feature.

    Capx

    "Action:set value" will set MEM[0] to "xxyy".

    The command

    0,print,MEM[0]

    MEM[0] will return "xxyy".

    User could put

    MEM[0]+3

    if MEM[0] is a number,

    or

    MEM[0]+"abcd"

    if MEM[0] is a string.

  • rexrainbow Thank you so much, this is awesome. Now I can set MEM[0] to get a global variable.

    @LittleStain this plugin is great for making chains of complex events like animations and sounds too, like cutscenes, in an readable way.

    It also supports CSV files, which are external, to quickly make corrections.

  • sheepy I'm starting to see the possibilities this plugin has, especially for my above mentioned project. I'm just not sure how to implement them into my event sheet. Maybe this plugin (great as it is) is just a bit over my head at the moment.

  • LittleStain I suggest you see the little examples rex posted on this topic and the function/worksheet/timeline ones and try them with test projects, they simplify the event sheet immensily

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,069 148,712
han96's avatar
han96
Unread hot topic
0 Favourites
[plugin] firebase
687 65,175
cybertron7's avatar
cybertron7
Unread hot topic
0 Favourites
[PLUGIN] Canvas
627 186,724
zenox98's avatar
zenox98