VNSceneScript Docs
VNSceneScript Docs
------
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.
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
Extension
See example of Extensions in
- demo of Extension
- file vnscenescriptext_keitaro10.py
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)
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)
defpack
run utils cam110 and charsg4b4
Example:
:a:i:util:defpack