[PLUGIN] Scenario

Post your completed addons to share with the community

Post » Sat Aug 04, 2012 1:20 am

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:
Image

- 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.
Last edited by rexrainbow on Thu Apr 14, 2016 9:42 am, edited 4 times in total.
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Sat Aug 04, 2012 1:37 am

User could use delay command and wait command to create a conversation.
Capx
CSV:
[code]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'[/code]rexrainbow2012-08-04 01:38:54
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Sat Aug 04, 2012 2:30 pm

Awesome plugin rex, its going to help me in all sorts of manners, thanks.
Found a little bug(maybe its 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:
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Sat Aug 04, 2012 2:32 pm

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?
sheepy2012-08-04 14:46:17
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Sat Aug 04, 2012 3:48 pm

@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 objectrexrainbow2012-08-04 15:53:02
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Sat Aug 04, 2012 4:56 pm

Thanks for the anwser rex
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Tue Aug 07, 2012 1:36 am

Update

"action:start scenario" will not start if tag is not valid.
- tag "" means started at first command line
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Fri Aug 10, 2012 11:59 pm

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 Im learning to use them my life is getting easier, thankssheepy2012-08-11 00:45:06
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Sat Aug 11, 2012 6:50 am

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.rexrainbow2012-08-11 06:50:59
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Sat Aug 11, 2012 11:39 am

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?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Next

Return to Completed Addons

Who is online

Users browsing this forum: totoe and 3 guests