Difference between revisions of "Transition Script"

From HLKitWiki
Jump to: navigation, search
(New page: {{context|Kit Reference|Script Types}} ==Technical Details== :{| class="scripttable" |class="leftnormal"|Initial Context: |Hero |- |Alternate Context: |None |- |Fields F...)
 
Line 20: Line 20:
 
|class="leftnormal"|message
 
|class="leftnormal"|message
 
|Entry: The empty string to indicate that no transition message should be shown to the user.<br>
 
|Entry: The empty string to indicate that no transition message should be shown to the user.<br>
Exit: If non-empty, specifies the transition message to be shown to the user as a reminder.
+
Exit: If non-empty, specifies the transition message to be shown to the user as a reminder. The text may contain [[Encoded Text|encoding]].
 
|-
 
|-
 
|}
 
|}

Revision as of 04:15, 15 December 2008

Context: HL KitKit Reference … Script Types 

Technical Details

Initial Context: Hero
Alternate Context: None
Fields Finalized? Yes

The Transition script utilizes the following special symbols:

message Entry: The empty string to indicate that no transition message should be shown to the user.

Exit: If non-empty, specifies the transition message to be shown to the user as a reminder. The text may contain encoding.

Description

The Transition script is only utilized when the formalized advancement mechanism is enabled for the game system. This script allows the author to display a message to the user whenever the user successfully switches from creation mode to advancement mode, or vice versa. In general, the message is simply a reminder about the implications of the transition, as well as how to switch back. If you want to suppress the message, simply use an empty message string (or omit the script entirely). The message starts out centered, although you can change the behavior.

When invoked, a Transition script starts with the actor as its initial context. You are free to refer to any aspect of the character, although doing so is rarely necessary. The primary detail you'll want to check is whether the character is transitioning to creation mode or advancement mode, which can be determined via the "state" context.

Example

The Transition script below shows the standard behavior you'll want to include in your data files. Depending on the new mode, an appropriate message is displayed.

if (state.iscreate <> 0) then
  @message = "{b}{text ffff00}Creation Phase{text 010101}{/b}"
  @message &= "\n\n"
  @message &= "{align left}You have unlocked your character!"
else
  @message = "{b}{text ffff00}Advancement Phase{text 010101}{/b}"
  @message &= "\n\n"
  @message &= "{align left}You have locked your character creation traits. "
  endif