Welcome to Plan B Game Studios!
I've been toying with the idea of an xml based scripting language for a while now. Today I decided to start working on it again and keep it focused to simple game scripting we can use within our XNA games. My earlier attempts kept getting bogged down by making them able to compile into CLR bytecode. This time it's just simply load the xml file and evaluate/execute.
Here's a sample of the script. This could be nested inside other asset objects or loaded individually.
1: <?xml version="1.0" encoding="utf-8" ?>
2: <XnaContent>
3: <!-- TODO: replace this Asset with your own XML asset data. -->
4: <Asset Type="EventScriptGameLibrary.Script">
5: <!--Math-->
6: <Item Type="EventScriptGameLibrary.ScriptAction.If">
7: <Test Type="EventScriptGameLibrary.EventScriptGameLibrary.LogicalExpression.NumericLessThan">
8: <Op1 Type="EventScriptGameLibrary.NumericExpression.Variable">
9: <VariableId>27</VariableId>
10: </Op1>
11: <Op2 Type="EventScriptGameLibrary.NumericExpression.Constant">
12: <Value>50</Value>
13: </Op2>
14: </Test>
15: <Success>
16: <Item Type="EventScriptGameLibrary.ScriptAction.MessageBox">
17: <Title></Title>
18: <Content></Content>
19: <VoiceAsset></VoiceAsset>
20: <ImageAsset></ImageAsset>
21: <ImagePosition>Left</ImagePosition>
22: </Item>
23: </Success>
24: <Failure>
25: <Item Type="EventScriptGameLibrary.ScriptAction.SetFlag">
26: <FlagName>flag_001</FlagName>
27: </Item>
28: </Failure>
29: </Item>
30: <!--Flag-->
31: <Item Type="EventScriptGameLibrary.ScriptAction.If">
32: <Test Type="EventScriptGameLibrary.LogicalExpression.IsFlagSet">
33: <FlagId>flag_001</FlagId>
34: </Test>
35: <Success>
36: <Item Type="EventScriptGameLibrary.ScriptAction.PlaySound">
37: <CueName>cue_001</CueName>
38: <Wait>true</Wait>
39: </Item>
40: </Success>
41: <Failure>
42: <Item Type="EventScriptGameLibrary.ScriptAction.AddToNumericVariable">
43: <VariableId>27</VariableId>
44: <Amount Type="EventScriptGameLibrary.NumericExpression.Constant">50</Amount>
45: </Item>
46: </Failure>
47: </Item>
48: <!--String-->
49: <Item Type="EventScriptGameLibrary.ScriptAction.If"><!--also something for pattern matching might be nice-->
50: <Test Type="EventScriptGameLibrary.LogicalExpression.AreStringsEqual">
51: <Op1 Type="EventScriptGameLibrary.StringExpression.Variable">
52: <VariableId>str_001</VariableId>
53: </Op1>
54: <Op2 Type="EventScriptGameLibrary.StringExpression.Constant">
55: <Value>TestString</Value>
56: </Op2>
57: </Test>
58: <Success>
59: <Item Type="EventScriptGameLibrary.ScriptAction.GetStringInputAndStoreToVariable">
60: <AllowedPatterns><!--Nullable-->
61: <Item>J.+\sS.+</Item>
62: <Item>K.+</Item>
63: </AllowedPatterns>
64: <Prompt>What is your name?</Prompt>
65: <VariableId>str_002</VariableId>
66: </Item>
67: </Success>
68: <Failure>
69: <Item Type="EventScriptGameLibrary.ScriptAction.GetNumericInputAndStoreToVariable">
70: <AllowedRanges><!--Nullable-->
71: <Item>
72: <Start>
73: <IsInclusive>true</IsInclusive>
74: <Value>16.5</Value>
75: </Start>
76: <End>
77: <IsInclusive>false</IsInclusive>
78: <Value>60</Value>
79: </End>
80: </Item>
81: </AllowedRanges>
82: <Prompt>How old are you?</Prompt>
83: <VariableId>num_002</VariableId>
84: </Item>
85: </Failure>
86: </Item>
87: <!--Nested Logic-->
88: <Item Type="EventScriptGameLibrary.ScriptAction.If">
89: <Test Type="EventScriptGameLibrary.LogicalExpressions.And">
90: <Left Type="EventScriptGameLibrary.LogicalExpression.MatchStrings"></Left>
91: <Right Type="EventScriptGameLibrary.LogicalExpression.Not">
92: <Test Type="EventScriptGameLibrary.LogicalExpression.NumericGreaterThan">
93: <Op1 Type="EventScriptGameLibrary.NumericExpression.CharacterAttribute">
94: <CharacterId>char_001</CharacterId>
95: <AttributeName>Strength</AttributeName>
96: </Op1>
97: <Op2 Type="EventScriptGameLibrary.NumericExpression.Constant">
98: <Value>20</Value>
99: </Op2>
100: </Test>
101: </Right>
102: </Test>
103: <Success>
104: </Success>
105: <Failure>
106: </Failure>
107: </Item>
108: </Asset>
109: </XnaContent>
Here's Aya Li-Ing. Ms. Li-Ing is the "victim" for chapter 1. She claims your very obvious client brutally raped her leaving her pregnant and afraid.
Onward toward the art. The background image is far from complete, but the character is final.
NOTE: We at Plan B Game Studios do not condone rape, nor do we believe all women claiming to have been raped are lying, just this one.
NOTE 2: Rape is not a laughing matter. If you have been raped or know someone who has been raped please contact a responsible third party for counseling and/or help.
Trouble with the Plan B Game demo? Some of you lucky people out there have been given access credentials to our Plan B game engine demo, but have been having some trouble having fun with it.
Computer Requirements
Plan B AT MINIMUM Requires:
- A Pentium IV or better computer with a CPU of at least 1GHz
- 768MB Ram
- Windows XP SP2 or better. Please install your service packs and software updates.
- A high resolution monitor.
Plan B Works best with:
- Windows Vista SP1 (and if your computer runs Vista, it’s powerful enough to run Plan B.)
- A monitor supporting resolutions above 1280x768
Setup
When installing Plan B, simply download the zip file at the URL you were given, when asked to enter a username and password on the web page, enter the credentials you were given (nope – not gonna repeat them here in the blog… sorry.)
- Download the zip file and unpack the contents into a folder (any will do.)
- run Setup.exe
- follow the step-by-step instructions
- If your computer needs additional software, it will be downloaded automatically.
- Windows Vista users will be asked to enter the administrators password, or confirm a User Account Control dialog. This is normal.
- Plan B Runs automatically.
Playing Plan B
- The A key/button advances through message boxes and other on-screen events.
- The X and Y keys map to X and Y buttons respectively.
- The B key on the keyboard cancels out of your current operation.
- You can start playing the game by selecting Tests->Test gameplay from the game’s main menu.
If the game doesn’t load, or if you are otherwise unable to play Plan B, please contact me. Y’all know how…
May it be known that on this, the 27th of February 2009, Plan B Game Studios Inc. Was formed in the state of New York, in the county of Erie.
Here's to a bright future!