Gameflow Precedents


This file will explain some of the precendents and rules of thumb for Anachronox.

Windows / Worldskills / Doors

Windows
===========================================
  #1 The size and the shape.
===========================================
All windows, excpet for interfaces and special occasions should have a default of:
Width 580
Pos 30,30
Here is an example of a very basic window with the default font, width, pos, style, background, and formatting that is currently being used at the time of writing.


#window 555:0101
title "My Pretty Window"
body "This is a window, joy!"
image sendernet/underline.pcx 16,31,548,32
width 580
pos 30,30
font _standardshadow
background color
style "style_embrace"

World Skills
===========================================
  #1 If you worldskill it open...
===========================================
After you use worldskill to open anything that has the potential of closing (i.e. most doors), then you should be able to click it open without having to constantly worldskill it. To do this you will need to use the ws_bank and ws_entry commands that allow you to call a switch at the end of a successful worldskill. Here is an example using picklock.
In this scenario we are assuming that the sequence (555:0101) is both the Sequence and the Wsequence of the object we are trying to open.


#switch 555:0101
if (Mapname_door1 == 1)
  {
     console "target door1"  // Here we see if we have been successful yet. If we have, we simply open the door.
     return                  // Stops the worldskill code below from executing.
  }
WS_STAND$ = "boots_skill_1"
ws_bank = 555
ws_entry = 0102
ws_difficulty = 3
ws_countertime = 35
gosub 4001:1
return


#switch 555:0102
Mapname_door1 = 1 // Here we set that we are successful. For most purposes the variable you set should be the (Mapname_DoorTargetName)

For most purposes the variable you set should be the (Mapname_WorldSkilledDoor/EntityTargetName). This means if I was writing this code to open a door in Hephaestus and the door's targetname was "pickdoor01", the variable name I would use would be "Hephaestus_pickdoor1".

Here is another example using throwloonie


#switch 555:0005                                     // This would be the switch for the actuall door
if (bricksb_looniedoor2 == 1) console "target door1"
else                                                 // This would play the "Seems Interesting" message, so people know that the door requires a worldskill to open.
  {
     timed_message = 36
     gosub 1000:1
     return
  }

#switch 555:0101                                     // This would be the switch for the throw loonie panel
WS_STAND$ = "stiletto_skill_1"
ws_object$ = "stilettodoor"
ws_bank = 555
ws_entry = 0102
ws_difficulty = 1
ws_countertime = 10
gosub 4006:1
return

#switch 555:0102                                    // Here is the switch that is called if the worldskill is successful
bricksb_looniedoor2 = 1                             // Here we set our success variable so the door can now be clicked open.


=============================================================
Here is a list of other variables associated with worldskills
=============================================================
//=====================================================================
// WORLDSKILL VARIABLES (For All Skills)
//=====================================================================
// All variables except "anox_worldskill_successful" are cleared after mini games.

// Mandatory Variables:
//		ws_stand$ = targetname of path corner the character should go to.

// Optional Variables: (Though usually at least ONE of these is needed)
//		ws_object$ = the object to target if worldskill was successful.
//		ws_bank / ws_entry = the back and entry of the sequence you want to call on success. (i.e. for 59:4001 "ws_bank = 59", ws_entry = "4001")
//		ws_getitem = if this value is set to 1, then the character will pickup the object specified in, ws_object$ (requires that ws_object$ is set)
//		ws_getitem$ = this can be used if you wish to both target something using ws_object$, and you want to pick up something else. Probably won't be used much, but what the hell...
//		ws_ambientname$ = set this to the path/name of an ambient script, and it will play it if the worldskill is successfull. (The ambient will play before the scene.)
//		ws_scenename$ = set this to the path/name of a scene script, and it will play it if the worldskill is successfull.
//		ws_variable$ = set this to the name a variable that you want set on success. (If "ws_variable" is not set, it will default to 1)
//		ws_variable = set this to the value that you want the variable set to on success. (Requires "ws_variable$" to be set.)
//		ws_standoverride = Set this to "1" if you do not want the player to use the stand. This a rare condition mostly used where a path_corner isn't convinient like in some Yammer cases and perhaps some Tractor / Throwloonies.
//		ws_analyze$ = You can use this instead of a callback to have Rho say a single window of dialog after she wins the Analyze.
//		ws_yammer_fail$ = Set this to the dialog you want grumpos to say on a failed Yammer. (There is a default if this is not used.)
//		ws_yammer_fail_retort$ = = Set this to the dialog you want grumpos' victim to say on a failed Yammer. (There is a default if this is not used.)
//		ws_yammeredname$ = The Window title of the guy you are yammering. (Only needed if you are going to use the Global 50 yammer windows.)
//		ws_yammeree$ = the target name of the person you are yammering
//		ws_outofway$ = the path corner that you want the victim to go to after they are yammered. (Only set this if you want them to move after)
//		ws_yammer1$ = Set this to what you want Grumpos to say when you are successful. (You can ignore this and use a call back if you prefer.)
//		ws_yammer2$ = Yammer Window 2 (optional)
//		ws_yammer3$ = Yammer Window 3 (optional)
//		ws_yammer4$ = Yammer Window 4 (optional)
//		ws_yammer5$ = Yammer Window 5 (optional)
//		ws_yammer6$ = Yammer Window 6 (optional)
//		ws_yammer7$ = Yammer Window 7 (optional)
//		ws_yammer8$ = Yammer Window 8 (optional)

// Variables For You: (These are variables the game sets, that you can use for whatever. DO NOT set these variables outside of Global50, unless you know what you are doing.)
//		anox_worldskill_successful = set to 1 if the game succeded, set to 0 if it failed.
//		ws_skill_level = set to 1 if the level 1 sequence is called, set to 2 if the level 2 is called
//		ws_doing_wskill = set to 1 if the worldskill minigame is currently in progress.
//		ws_callback_sequence$ = This is just used internally. This is the sequence # to use with the path_corner completion callback. (i.e. 4002:2) If you can find an external use for it, then have at it.
//		ws_callback_sequence_a = The bank of the callback sequence, because goto is dumb
//		ws_callback_sequence_b = The entry of the callback sequence, because goto is dumb
//		ws_called_invalid = This gets set to 1 if you try to use a worldskill with anox_worldskill_active set to 0.


//=====================================================================


For more information see also: , Door Precedents.

Doors
===========================================
  #1 To click or not click...
===========================================
When should you put a sequence or a wsequence on a door? Here are the basic rules of thumb.
If it is a large area, such as the bricks, the only doors that should have sequences are doors that you can worldskill. Once again the rule of thumb for such doors would be for them to use the same sequence number for the sequence and the wsequence. This will allow for the "Seems Interesting" message to be automatically played when you click on them.

In small areas such as Braintrain, they will need to be brought up on a case by case basis. For example in Braintrain, the doors are clickable and give you a message about where they "go to". This will be the preferred method for small areas and some few situations where working doors heavily outnumber non working ones.

For more information see also: Worldskill Precedents.