.
For Quest Version 5.3
-----------
Attributes are hidden already, only STATUS ATTRIBUTES are displayed in the panel for the game player to see.
my use of the parenthesis, is either a note, or it identifies what you are to type in (but do NOT type in the parenthesis too!)
------------
GUI (noob friendly editor with the buttons and drop down menus) mode:
1. create your game turn attribute:
Game -> Attributes (Tab) -> Attributes (the box at the bottom) -> Add ->
name: turns
type: integer
value: 0
2. create your game turn status attribute:
Game -> Attributes (Tab) -> Status Attributes (the box at the top) -> Add ->
name: turns
format string: (leave blank, just click okay button without typing in anything)
3. create your air attribute:
Player -> Attributes (Tab) -> Attributes (the box at the bottom) -> Add ->
name: air
type: integer
value: 0
4. create your air flag:
Player -> Attributes (Tab) -> Attributes (the box at the bottom) -> Add ->
name: air_flag
type: boolean
value: false (leave it UNcheck marked, so that it equates 'false' !)
5. create your air function:
Function -> Function (Tab) -> Add ->
name: air_status_attribute_setter
return type: [NONE]
parameters: (none, do NOT add any parameters!)
Script -> Add New Script ->
Scripts -> If... -> If [OBJECT ATTRIBUTE EQUALS] Object [OBJECT] [PLAYER] (air_flag) = (true) -> Then ->
-> Add A New Script -> Variables -> Add A Value To A dictionary -> Add To Dictionary (player.statusattributes) Key [STRING] (air) value [EXPRESSION] ( ! )
Add Else If -> Scripts -> If... -> If [OBJECT ATTRIBUTE EQUALS] Object [OBJECT] [PLAYER] (air_flag) = (false) -> Then ->
-> Add A New Script -> Variables -> Remove A Value From A dictionary -> Remove From Dictionary (player.statusattributes) key [string] (air)
6. create your turns and air turnscript:
Game -> Script (Tab) -> Turns Script (box at the bottom) -> Add ->
Turns Script (Tab) ->
name: air_and_game_turns
enable when the game begins: yes (click so that the little box has now a green check mark showing!)
Script -> Add New Script -> Scripts -> Call Function -> Call Function (air_status_attribute_setter) with parameters (none, do NOT add any parameters!)
Add New Script -> Variables -> Set Variable Or Attribute -> Set variable (game.turns) = [EXPRESSION] (game.turns = game.turns + 1)
7. now, all you have to do, is to:
whenever you want to show or hide your air status attribute, all you got to do is add this to any part of your game through~via a script:
Add A Script -> Variables -> Set Variable Or Attribute -> Set variable (player.air_flag) = [EXPRESSION] (true)
*true = this means that it will now show your air amount status attribute
~OR~
Add A Script -> Variables -> Set Variable Or Attribute -> Set variable (player.air_flag) = [EXPRESSION] (false)
*false = this means that it will now hide your air amount status attribute
-----------
to change your air amount:
to increase your air amount:
Add A Script -> Variables -> Set Variable Or Attribute -> Set variable (player.air) = [EXPRESSION] (player.air + some_number)
to decrease your air amount:
Add A Script -> Variables -> Set Variable Or Attribute -> Set variable (player.air) = [EXPRESSION] (player.air + some_number)
------------
and here's a demo "game", for you to take a look at:
(this is what my demo game looks like in Code View mode)
<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<statusattributes type="stringdictionary">turns = </statusattributes>
<turns type="int">0</turns>
<pov type="object">player</pov>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="editor_player" />
<air type="int">0</air>
<air_flag type="boolean">false</air_flag>
</object>
<object name="computer_terminal">
<inherit name="editor_object" />
<look>It has many buttons, but a big lever in particular stands out. Above the lever, reads: Push to show your air amount and Pull to hide your air amount.</look>
<push type="script">
player.air_flag = true
msg ("You can now see your air amount!")
</push>
<pull type="script">
player.air_flag = false
msg ("Your air amount is now hidden!")
</pull>
</object>
</object>
<turnscript name="air_and_game_turns">
<enabled />
<script>
air_status_attribute_setter
game.turns = game.turns + 1
</script>
</turnscript>
<function name="air_status_attribute_setter">
if (player.air_flag = true) {
dictionary add (player.statusattributes, "air", !)
}
else if (player.air_flag = false) {
dictionary remove (player.statusattributes, "air")
}
</function>
</asl>
1. click on the select all above, and then copy my code.
2. create and start up a new game.
3. click on the notepaper like button on the top, between the play and ? (help) buttons, to switch over to the Code View mode (this notepaper like button is a toggle button to switch back and forth between the GUI and Code View modes).
4. select all of the game code, and delete it.
5. now paste in my code.
6. save your game file.
7. now try and play it, see what you think, hehe