- ffixer wrote:
Actions:
pic1box$filename$ eg: pic1boxMyPic.bmp (show image in picbox1)
pic2box$filename$ eg: pic2boxMyPic.bmp (show image in picbox2)
Where do I need to write these "actions"?
In the Script 1 or 2?
Or in the Responses?
(Maybe I did something wrong, but unfortunately I am not a professional in English language, because I am not English.)
TAB is first and foremost a text adventure creator.
CONDITIONS and ACTIONS coding is the "language" that TAB understands to carry out RESPONSES to player input or to trigger EVENTS that may happen in a game in a particular situation...
You need to know a bit about these so it's best to try out the tutorial game (tutorial.txt) in the TAB folder to get some kind of understanding...
We deal with all types of things within reason that the player might type in by placing coding entries into the RESPONSES list. This list is looked at ONLY straight after the player hits ENTER with their input command.
For example if the player types in and ENTER's:
>score
then there is an entry existing in the RESPONSE list to deal with that type of command which prints out the player's score. eg:
"Your score is 20 out of 100."
TAB may then move on check the Script 2 list to see if anything else needs to be done or printed out on that turn of the game...
Entries in the Script 1 list are ONLY looked at in sequence immediately after a location (room) is described by TAB; for instance when the player types "look" in the current room or if the player moves into another room by a direction...
The entries in the Script 2 are scanned and processed ONLY immediately after the TAB has finished dealing with the player's inputted command (from the RESPONSE entries) This is so the computer has it's own turn at the game (after the player has had their turn) and to carry out any tasks or events need to be actioned at that stage of play...
So the actions you mentioned
pic1box
pic2box
can be used in either or any of the RESPONSE, SCRIPT1 or SCRIPT2 lists whenever you want to show a static picture into the upper right picture box (pic1box) or into the lower right picture box (pic2box)
Say for instance you wanted to show a picture of the player/character fighting a dragon. This could be made to happen if the player decided to attack the dragon from a RESPONSE entry eg:
[start]attack dragon#charpresent3[acts]cmessYou raise your sword to fight the vicious fire-breathing beast...#pic2boxdragonfight.jpg#cmessOh dear! The dragon shrieks and emits a searing bolt of flame that fries you to a crisp!!!#pause3#gameover[end]
If the player typed attack dragon and the dragon character was present then print the messages, show the picture into the picbox2 then pause for 3 seconds and then end the game.
That's just a simple example and the words "attack" would need to exist in the Vocabulary and Character 3 would be a dragon created in the Character Editor...
Alternatively you could use Script 2 to show the same picture with an entry such as:
[start]turns=12[acts]cmessSuddenly a vicious fire-breathing dragon swoops down from the sky and attacks you...#pic1boxdragonfight.jpg#cmessOh dear! The dragon shrieks and emits a searing bolt of flame that fries you to a crisp!!!#pause3#gameover[end]
On turn 12 of the game print message about dragon attacking, show picture in pic1box, pause for 3 seconds then end the game.
Hope this helps,
Phil.