Difference between revisions of "Cabal Common Library Doc Briefing"
m (Created page with '== Overview == This is the main class for the briefing with its members. The script handles incoming data from worldScripts to make missionscreens a bit more interesting with ti…') |
m |
||
Line 14: | Line 14: | ||
== Functions == |
== Functions == |
||
=== startBriefing() === |
=== startBriefing() === |
||
− | {{CodeEx|codeex= |
+ | {{CodeEx|codeex=worldScripts.Cabal_Common_Briefing.startBriefing = function( obj )}} |
Calling this method starts the handling. The argument (obj) should hold a few parameters to define the actions. |
Calling this method starts the handling. The argument (obj) should hold a few parameters to define the actions. |
||
Line 22: | Line 22: | ||
:;background:String. Optional. Filename with extension. |
:;background:String. Optional. Filename with extension. |
||
:;briefing:Array. Required. Action commands. |
:;briefing:Array. Required. Action commands. |
||
− | :;callback:String |
+ | :;callback:String. Required. WorldScript identifier. |
:;callbackc:String. Optional. Mission choice. |
:;callbackc:String. Optional. Mission choice. |
||
:;callbackf:String. Required. Callback function. |
:;callbackf:String. Required. Callback function. |
||
Line 38: | Line 38: | ||
Example: |
Example: |
||
{{CodeEx|codeex=var obj = { |
{{CodeEx|codeex=var obj = { |
||
− | + | role:"trader",<br> |
|
− | + | ori:[1,0,0,0],<br> |
|
− | + | briefing:[<br> |
|
− | + | [3,"mVelo",[0,-1,3,-1.005,0,0,1,0,0.85]],<br> |
|
− | + | [17,"stopVelo",[0,-1]]<br> |
|
− | + | ],<br> |
|
− | + | callback:this.name,<br> |
|
− | + | callbackf:"choiceEval"<br> |
|
− | }; |
+ | };<br> |
worldScripts.Cabal_Common_Briefing.startBriefing(obj);}} |
worldScripts.Cabal_Common_Briefing.startBriefing(obj);}} |
||
− | Short overview about the Action commands: |
||
+ | |||
+ | == obj.briefing == |
||
+ | Short overview about the action commands: |
||
:;"bgzoom":Zooms background image in and out. |
:;"bgzoom":Zooms background image in and out. |
||
:;"bind":Sticks two subents together. |
:;"bind":Sticks two subents together. |
Revision as of 13:59, 3 June 2011
Overview
This is the main class for the briefing with its members.
The script handles incoming data from worldScripts to make missionscreens a bit more interesting with time based animations of the displayed model. Scripts can pass the data easily and everything else is performed within the briefing script.
worldScripts.Cabal_Common_Briefing.startBriefing(obj); |
A second approach is possible by instantiating a copy of the underlaying API, e.g.
this.helper = new Cabal_Common_ScreenFCB(); |
But scripts are then responsible to remove the framecallbacks on their own with the method provided by the API!
Functions
startBriefing()
worldScripts.Cabal_Common_Briefing.startBriefing = function( obj ) |
Calling this method starts the handling. The argument (obj) should hold a few parameters to define the actions.
obj: Parameters:
- absolutePos
- Array. Optional.
- background
- String. Optional. Filename with extension.
- briefing
- Array. Required. Action commands.
- callback
- String. Required. WorldScript identifier.
- callbackc
- String. Optional. Mission choice.
- callbackf
- String. Required. Callback function.
- capture
- Boolean. If true only a new briefing, callback and callbackf gets established.
- cornerPos
- Array. Optional. Movement to one corner.
- music
- String. Optional. Filename with extension.
- ori
- Array. Optional. Orientation.
- overlay
- String. Optional. Filename with extension. Defaults to "bgs-i_overlay_none.png" if BGS-A or BGS-I installed.
- role
- String.
- title
- String. Optional. Defaults to "Briefing".
Returns:
- nothing
Example:
var obj = {
role:"trader", |
obj.briefing
Short overview about the action commands:
- "bgzoom"
- Zooms background image in and out.
- "bind"
- Sticks two subents together.
- "check"
- Useful for developers to see how many framecallbacks are invoked.
- "continue"
- Enables checkpoints if specific points are reached.
- "face"
- Rotate entity to face another entity.
- "kill"
- Stops briefing.
- "mes"
- Add a message.
- "mSpeed"
- Velocity based on vectorForward.
- "mVelo"
- Velocity vectorUp.Right and Forward.
- "prop"
- Set property, e.g. fuel.
- "reori"
- Set orientation.
- "repos"
- Set position.
- "rot"
- Rotate X,Y,Z.
- "stopSound"
- Stop briefing sound.
- "stopVelo"
- Stop velocity.
- "turn"
- Rotate vectorUp,Right,Forward and velocity.
- "walk"
- Subtract Z-position, biased Y.
- "zoom"
- Multiplied position.
...more...