NodeScript.NINI - alternative & self-explanatory CYOA format

Hi,

today I decided to add an alternative CYOA file format for Node-X Interpreter v2.x (to be released) and higher versions.

It is called NINI (“Node INI file”, pronounced “Ninny”). This alternative format (.nini) has the same functionality as the current file format (.nx) documented here but has a different layout. All short abbreviations for INI section names, section keys (command vars) and enumeration values were replaced with self-explanatory long names. Both formats will be supported by the Node-X Interpreter, giving authors the option to choose their desired layout.

I originally intended to implement this format in 2007 when I started the Node-X project, but I dropped the idea back then, because I thought it would be easier and faster not to type so much. However, this alternative format has Pros and Cons aswell.

Basic example of NodeScript.NINI layout and Pros/Cons:
devnode.freeforums.org/nodes … t-t14.html

Feel free to post your thoughts on this format.

Regards,
Emilian K.

Below is an example of a simple Node-X adventure in Nini’s format. It is a conversion of the original demoroom_en.nx script file from the Node-X 1.1 distribution package (see IFComp 2009 entry “Trap Cave”):

[code]; -------------------------------------------------------------------
; demoroom_en.nini (conversion of demoroom_en.nx)
;
; Node-X Interpreter (NXI) v2.x or higher required to run this file!
; (not yet released)
;
; NodeScript and NINI format by Emilian Kowalewski © 2007-2010
;--------------------------------------------------------------------
[NodeScript.NINI]
Generation=1
EngineClass=NodeJumper

[FileInfo]
Date=09/26/2009
Time=19:00

[GameInfo]
Title=Demo: One Room Adventure
Author=Emilian K.
Version=1.0
Language=English

[NetInfo]
Email=@
URL=%

[GameInterface]
LineStyle=Single

[FileInterface]
SaveFile=demoroom

[Inventory]
ElementName=Body
SubElementName=hand
SubElementLeftName=left
SubElementRightName=right
SubElementLeftAbbr=LH
SubElementRightAbbr=RH

[PlayerStart]
bInventory=False
Node=1

[Locations]
1=Description
2=Office
3=End

[Choices]
1=examine chair
2=look around
3=examine desk
4=walk to door
5=open drawer
6=close drawer
7=take key
8=put key in drawer
9=go to desk
10=open door
11=unlock door

[NodeText1]
1=^This script demonstrates how to write a basic one room
2=^adventure with one exit to be unlocked with one item.
4=^This text shows how to center a line on the screen.
5=^For documentation, tutorials and/or help please visit
6=^the Node-X Forum (see URL).

[Node1]
Location=1
NodeText=1
NodeType=JumpNode
NodeJump[1]=2

[NodeText2]
1=You are inside an office and sit on a chair.

[Node2]
PreCallAction=ShowInventory
Location=2
NodeText=2
NodeType=PathNode
NodeChoice[1]=1
NodeChoice[2]=2
NodeJump[1]=3
NodeJump[2]=4

[NodeText3]
1=It’s a black leather chair which can be rotated 360 degrees.

[Node3]
Location=2
NodeText=3
NodeType=JumpNode
NodeJump[1]=2

[NodeText4]
1=You look around the office. In front of you is a desk and a door behind it.

[AltText4]
1=You rotate the chair and take a look around the office.
2=There is a desk in front of you and a door behind it.

[Node4]
PreCallAction=AltFlag
PreCallFlag=3
Location=2
NodeText=4
AltText=4
NodeType=PathNode
NodeChoice[1]=3
NodeChoice[2]=4
NodeJump[1]=5
NodeJump[2]=8

[NodeText5]
1=It’s a white wooden desk with a drawer on the front.

[AltText5]
1=You are in front of the desk.

[Node5]
Location=2
NodeText=5
AltText=5
NodeType=PathNode
NodeChoice[1]=5
NodeChoice[2]=4
NodeJump[1]=6
NodeJump[2]=8

[NodeText6]
1=You have opened the drawer.

[Node6]
Location=2
NodeText=6
NodeType=ItemNode
NodeChoice[1]=6
NodeJump[1]=7
NodeItem=1
bItemFlag=False
FlagSetChoice=7
FlagUnsetChoice=8

[ItemText1]
1=A modern silver key to open office doors.

[Item1]
ItemType=Standard
ItemName=key
ItemText=1

[NodeText7]
1=You have closed the drawer.

[Node7]
Location=2
NodeText=7
NodeType=PathNode
NodeChoice[1]=5
NodeChoice[2]=4
NodeJump[1]=6
NodeJump[2]=8

[NodeText8]
1=You stand in front of the office door.

[Node8]
PreCallAction=ItemJump
PreCallJump=10
Location=2
NodeText=8
NodeItem=1
NodeType=PathNode
NodeChoice[1]=10
NodeChoice[2]=9
NodeJump[1]=9
NodeJump[2]=5

[NodeText9]
1=You can’t open the door. It’s locked!

[Node9]
Location=2
NodeText=9
NodeType=JumpNode
NodeJump[1]=8

[Node10]
Location=2
NodeText=8
NodeType=PathNode
NodeChoice[1]=9
NodeChoice[2]=11
NodeJump[1]=5
NodeJump[2]=11

[NodeText11]
1=You have unlocked the door and left the office. Game solved!

[Node11]
Location=3
NodeText=11
NodeType=DeadNode

; End of script[/code]

The NINI version of the Demoroom example will be more helpful for learning Node-X than the NX version. I have a feeling that the new format will catch on, but the smaller file size might make the NX script style worthwhile for users who are fluent with all the Node types, etc. At any rate, it’s good to have choices (heh, no pun intended :wink: ),

Right. NINI is intended for beginners and NX is for advanced users. However, I’m planning to code a little tool with which users can convert between those two formats. So even if you are a beginner you can write your game script in NINI and then convert it to NX with the tool. Or you can convert an existing game script written in NX to NINI in order to better understand it.

As you mentioned, it’s about having choices. It’s a “Choose Your Own File Format” type thing (no pun intended aswell). :wink: