
You can launch other scenarios by double clicking the *.fwk files provided in the supplemental scenario packages.
(In the case when the scenario's defavatar's :control parameter is set to "default")
button is not pressed), pressing the F1 key toggles between "First
Person (FP)" and "Behind the Avatar" views.When the camera is not in "Walker Slave Tracking Mode" (when
the toolbar's
is down) the following actions are possible:
Scenarios are described using the Q language (details on the Q Language Homepage.) In this document however, we will focus on writing working scenarios through examples. (For a detailed explanation on describing scenarios with the Q Language please download the Q Language Specification document found in the download area of Q's homepage, as well as the FreeWalkV4 manual included in the FreeWalk package.)
First, in the file assigned by the [Q] ScenarioFileName inside FreeWalk.ini (from now on referred to as the "scenario file") we write the header:
(load "define_cue_action.q")
(load "def_env.q")
This requests the loading of 2 files located in the [FreeWalk Install Folder]\Q\ directory: define_cue_action.q (parameter type descriptions) and def_env.q (environment settings descriptions).
There is no problem with leaving define_cue_action.q as it is but def_env.q is important when using the network so brief comments are provided next:
(defenv name
:world_name
;; Name of the environment(string type). We recommend
that you make it correspond to 'name'.
:max_entry
;;Maximum number of allowed agents, etc.(integer
type)
:ip_address
;;IP address or machine name of machine to connect
to (string type.)
:port_number
;;Port number on machine to connect to (integer
type.)
:vrml_url
;;VRML reference URL address (string type)
:vrml_path
;;Path to the local VRML folder, relative to [FreeWalk
Install Folder] (string type.)
)
(Example)
(defenv space0
:world_name "space0"
:max_entry 100
:ip_address "Machine0"
:port_number 12345
:vrml_url "/shijo_street/"
:vrml_path "data\shijo_street\")
With such description, the community server will run on Machine0 by executing
on it "FreeWalkCommunityServer.exe 12345 space0".
Next we prepare what will become our scene (an empty stage.) In the scenario file a description like the one bellow is made.
(defscenario scenario-scene ()
(scene1))
(defagent Scene
;; Scene's name. This value can be used as a variable.
scenario-scene
;; Assigned scenario. Here we have assigned the
empty scenario "scenario-scene".
:machine "Machine0"
;; The name of the machine to operate this scene.
:location '(0.0 0.0 0.0 0.0)
;; Coordinates
:shape '("scene.wrl")
;; VRML model
)
Now we allocate the user's avatar. It is described in the scenario file as follows:
(defscenario scenario-user ()
(scene1))
(defavatar User
;; Name of the avatar. This value can be used as
a variable.
scenario-user
;; Assigned scenario.
:machine "Machine0"
;; Name of the machine to control the avatar.
:location '(10.0 0.0 10.0 0.0)
;; Initial position (x coordinate[m] y coordinate[m]
z coordinate[m] direction[degrees])
:shape '("user.wrl")
;; VRML model
)
Finally we assign the autonomous agents that will move responding to the assigned scenario.
(defagent agent
;; Agent's name. Can be used as a variable.
scenario-agent
;; Assigned scenario.
:machine "Machine1"
;; Name of the machine that will control the agent.
:location '(20.0 0.0 20.0 0.0)
;; Initial position and direction
:shape '("agent.wrl")
;; VRML model
)
(defscenario scenario-agent ()
;; Simple scenario assigned to agent.
;; If the user-controlled avatar is near, come and
go to that place.
(scene1
((?position :name_s User :distance_range '(0.0 5.0))
;; If the user is in the 0.0 - 5.0 range
(!walk :route '((0.0 5.0)) :relative #t)
;; Walk only (0.0 5.0) relative to its own current
position
(go scene2)))
;; scene2へと移る
(scene2
((?position :name_s User :distance_range '(0.0 5.0))
(!walk :route '((0.0 -5.0)) :relative #t)
(go scene1))))
Leaving all details to the manual, here we focus on what you are most likely to use. Also, unless specifically prohibited, file and folder name assignments are done using the path relative to the folder where FreeWalk.exe is ([FreeWalk Install Folder]\Program\) or an absolute path.
We will be adding tips related to FreeWalk in the future.
Please send questions to "fw-admin at lab7.kuis.kyoto-u.ac.jp"