More complicated dialog? help!

Started by cece0808, Fri 30/12/2005 21:37:19

Previous topic - Next topic

cece0808

How can i create lucasarts style conversations? For example like when player selects the RIGHT dialog opinion, something will happen (adds item to inventory, changes room, game ends...). Do i need to get scripting or can it be done more simple ways?

thx!

Akumayo

Please read the dialogue section in the manual more closely before posting topics such as this.
"Power is not a means - it is an end."

strazer

Manual -> Tutorial -> Setting up the game -> Conversations

Candle

The dialog commands available are:

add-inv X
Adds inventory item X to the current player's inventory. This does the same thing as the AddInventory script command, but is provided here because it is frequently used in dialogs.
give-score X
Gives the player X points, and plays the score sound if appropriate.
goto-dialog X
Switches the current topic to Topic X, and displays the current list of choices for that topic.
goto-previous
Returns to the previous topic that this one was called from. If the dialog started on this topic, then the dialog will be stopped.
lose-inv X
Removes inventory item X from the current player's inventory. This does the same thing as the LoseInventory script command, but is provided here because it is frequently used in dialogs.
new-room X
Takes the player to room X, and aborts the conversation. Since this does not allow you to specify co-ordinates, you may need to use some Player Enters Room logic in the target screen to place the character properly.
option-off X
Turns option X for the current topic off, meaning it won't be displayed in the list of choices next time.
option-off-forever X
Turns option X off permanently. It will never again be displayed, not even if an "option-on" command is used.
option-on X
Turns option X for the current topic on, including it in the list of choices to the player next time they are displayed.
play-sound X
Plays sound effect X, similar to the Play Sound interaction command.
return
Stops the script and returns to the list of choices.
run-script X
Runs global script function "dialog_request", with X passed as the single parameter. This allows you to do more advanced things in a dialog that are not supported as part of the dialog script. The "dialog_request" function should be placed in your game's global script file, as follows:

  function dialog_request (int xvalue) {
    // your code here
  }
 
set-globalint GI VAL
Changes script GlobalInt number GI to have the value VAL. This is equivalent to the SetGlobalInt script command, and allows you to quickly set things without having to go through a run-script just to set an int value.
set-speech-view NAME X
Changes character NAME's talking view to X. NAME must be their script name, and X is the number of the new talking view. Use this to easily change their facial expression during a conversation.
stop
Stops the conversation and returns the player to the game.
For an example of a dialog script, load the demo game into the editor and look at the script for its topic 0.
Parser input

You'll notice in the dialog editor, a checkbox "Show text parser with this topic". If you check this, a text box is displayed below the predefined options, which allows the player to type in their own input.

If they type in something themselves, then the dialog_request global script function will be run, with its parameter being the dialog topic number that the player was in.

AGS automatically calls ParseText with the text they typed in before it calls dialog_request, so you can use Said() calls to respond. See the text parser section for more info.


SMF spam blocked by CleanTalk