0% found this document useful (0 votes)
271 views

VNSceneScript Docs

This document provides documentation for VNSceneScript version 1.0, which allows scripts to be set inside folder names in visual novel scenes. Commands must start with ":" and are run at different states. Common commands include :a to run actions, :show to display folders, :txt to display text, :cam to move cameras, and :util to run utilities. Extensions can add custom actions via Python files. The document provides examples of commands and describes additional features introduced in later versions.

Uploaded by

慈叔
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
271 views

VNSceneScript Docs

This document provides documentation for VNSceneScript version 1.0, which allows scripts to be set inside folder names in visual novel scenes. Commands must start with ":" and are run at different states. Common commands include :a to run actions, :show to display folders, :txt to display text, :cam to move cameras, and :util to run utilities. Extensions can add custom actions via Python files. The document provides examples of commands and describes additional features introduced in later versions.

Uploaded by

慈叔
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 5

Documentation for VNSceneScript

------
here for v 1.0
------
Basics
VNSceneScript allows you to set a script inside folder names in scenes.
So, your code for scene will be saved, because folders (with names) are saved at scenes too.

Code inside folder names we will name commands.


All commands must starts with :
All other folder names will be ignored.

So, our script (because it based only on folder names) must be very compact.
So, we define these - all your scripts must be called at states.
Usually, you run scene from 0 to End state (defined in header)
States, where nothing happened, ignores.

States Range
In most cases you will must define range of states - when you show objects, run actions etc.
It have this format:
1 - for state 1
1-3 - for states 1,2,3
1,3 - for states 1,3
1-3,5-7 - for states 1,2,3,5,6,7
i - for state -1 (initialize state)

Commands
Types of commands:

:vnscenescript
unique command. Setup and indicates the start of VNSceneScript file
Syntax
:vnscenescript:<version>:<maxstate>
Example
:vnscenescript:v10:110

:a
Action
Most usable type of command.
Syntax (see States Range article)>:
:a:<state_range>:<action_name>:<actions_params>
Example
:a:0:txts:Our story begins...
All detailed action_names and params see at Actions article

:show
Show folder and it's content on selected states, and hides on other
Syntax (see States Range article)>:
:show:<state_range>
Example
:show:10-19

:showch
The same as show, but applies show/hide for it's parent.parent.parent.
Needed for characters (so, ch postfix) - we add this command as child of head, for example, and it works
on chara itself.
Mostly useful for NEO users, not so needed for CharaStudio (NEO can't add charas to folders)

:useext
Use additional user-extension for handling additional actions.
Needed for users, who want to implement it's own original actions like manipulating characters pos, FK,
IK etc.
Syntax:
:useext:<ext_name>
Example
:useext:keitaro10

See Extension article

Extension
See example of Extensions in
- demo of Extension
- file vnscenescriptext_keitaro10.py

If you have <ext_name>, it must be in vnscenescriptext_<ext_name>.py file

It also must contain 2 functions:


def custom_action(game,act):
- here you processed the original actions

and
def debug_buttons(game,state):
here you can return additional buttons for debug mode

Actions
Please, see demos - here you find only short desc
Text actions
:txt
show text from char
Syntax :txt:<charid>:<text>
example: :a:0:txt:g:Hi!

:txts
show system text
example: :a:0:txts:System text

:regchar
register charid
Syntax: :regchar:<charid>:<charcolor>:<charshowname>
charcolor is RRGGBB
Example: :a:i:regchar:izumi:ee99ee:Izumi

Cameras
:cam
move to camera by number
example: :a:2:cam:2

:camanim
animated move to camera by number
example: :a:2:camanim:2

:camanim2
animated move to camera by number, but also with zoom-out-zoom-in feature
Second param is Z-distance in meters (power of effect)
example: :a:2:camanim2:2:20 (20 meters of effect)

:camcur and :camcuranim


Same actions for change camera current location.
:camcur for instant, :camcuranim - for animated
1 param - rotx,roty,rotz or disz
2 param - number
example:
a:1:camcuranim:disz:-0.5
(slightly zoom-out from cur position)

:camo and :camoanim and :camoanim2


Move camera to arbitrary location
1 param - location (can be seen using dump camera feature - it's a 10 numbers, separated by ,)
:camo - instant move
:camoanim - animated move
:camoanim2 - animated move with zoom-out feature (see :camanim2 example)

Example:
a:2:camo:-0.3,2.0,1.0,0.0,0.0,-2.9,12.0,352.4,0.0,23.0
Manipulating states

:nextstate:<nextstatenum>
Allows you to move after click not to next state, but move forward or backward
Example:
a:9:nextstate:200

So, you can show some states outside your usual content, and then return back

:addbtn:<btntext>:<btntostate>
Game can define it's own buttons, replacing original.
Use several addbtn to add choices to game
Example
:a:3:addbtn:Move to next >:4
:a:3:addbtn:Skip intro >:60

timernext:<duration>
run next state after duration (in seconds, can be float)
examples:
:a:0:timernext:5
(run state after 0 after 5 seconds)
:a:0-3:timernext:4
(run states from 0 to 4 with 4-seconds interval)

Utils

:util:<utilname>
Run a set of useful utils.

Available utilnames:
cam110 - set a actions like :a:10:cam:1, :a:2:cam:20 for all 10 cameras
for i in range(10):
atxt = ":a:%s:cam:%s"%(str((i+1)*10),str(i+1))
util_action_append(game,atxt)

charsg4b4 - set a set of characters id (g,b,gs,bs etc.):


gcolor = "ee99ee"
gcolor3 = "99ee99"
bcolor = "9999ee"
game.register_char("q", "aaaaaa", "? ? ?")
game.register_char("g",gcolor,"Girl")
game.register_char("gs", gcolor, "Girls")
game.register_char("g1", gcolor, "Girl 1")
game.register_char("g2", gcolor, "Girl 2")
game.register_char("g3", gcolor3, "Girl 3")
game.register_char("b", bcolor, "Boy")
game.register_char("bs", bcolor, "Boys")
game.register_char("b1", bcolor, "Boy 1")
game.register_char("b2", bcolor, "Boy 2")

defpack
run utils cam110 and charsg4b4

Example:
:a:i:util:defpack

New commands since 3.0


- new commands: showui, hideui, hideui:<timerforhide>
- "addbtnrnd" action to move to state randomly. Syntax: addbtnrnd:<btntext>:<states separated by ",">
Example: addbtnrnd:Random action:200,300,400
- Ministate button run cmd - addbtnms:<text>:<ministatename>
- Adv cam function - camoanim3:<camstr>:<duration>:<style>:<effZoomOut>:<effRotX>:<effRotZ> (use
0.0 if you don't want effects)
- Ministate immediately run cmd - runms:<ministatename>
- commands for control buttons in UI - lockui, lockui:timeout, unlockui

Also support new params in existed cmds:


- timernext support syntax: timernext:<time>:<nextstate>
- support scene params "next" in addbtn calls (like addbtn:Go further:next)
- support scene params "end" in addbtn calls (like addbtn:To end:end)

You might also like