How to make an "insult swordfighting"

Started by Andrechan, Tue 25/07/2006 17:21:05

Previous topic - Next topic

Andrechan

HiÃ,  :)!
I want to make a challenge between characters (a justice speech challenge if you want to knowÃ,  ;D) and I would like to use pretty the same concept of Monkey Island's swordfighting:

After picking a fight with a justice paladin, the main character (Amelia) always has first shot at declaiming.
If the paladin cannot respond, Amelia takes the advantage and gets to pick the next speech (but doesn't learn anything).
If the paladin gives the correct response, the advantage goes to him and he picks the next speech (but Amelia learns the response and has a chance at hearing a new speech).
Whoever gains the advantage three times in the match, wins


The problems I have are:
-The battle can start only if Amelia knows a secret word. After Amelia discovers the word, how can I enable the option with the word in ALL the topics of the paladins?
-I make a topic with all the speech possibles and one with all the answers possibles and at the start they are all off but one. How to recicle these topics for all the paladins? Each paladin has his own set of questions/answers he knows so I need the same topics but different scripts.
If I have to make a copy of the topics for each paladin, how can I turn on a question or an answer in ALL the topics?
-If a paladin gives a correct response, how can I make him pick a random question he knows?
-How can I interrupt the conversation after someone gains the advantage three times?

I hope there are answer to my problems,after playing Monkey Island making a speech challenge is one of my dreamsÃ,  ;D

sven

You cannot do that with the dialog editor (at least there's no way I can think of), but it's perfectly doable with scripts. Basically, you create an array for each paladin that contains every possible question/answer combination plus a flag to check if the player already knows the correct answer. If the player encounters a paladin, you call a script that sets two counters (one for the player, one for the paladin), then randomly chooses a question and checks if the opponent knows the answer. Then you display question and answer via character[foo].say and increment the counter of the winning side; if one counter reaches three, you exit the fighting script and pass some variable to determine what happens next. I'm too lazy to put it in code right now, but check the manual entries on variables and character interaction - that should answer everything :)

Scummbuddy

Here is a fun read that we all discussed awhile back on the exact methods used in Monkey Island as it pertains to Insult Swordfighting.

You may get some ideas from it:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=24714.0
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SSH

Dave Gilbert's recent "The Shivah" game has an interesting twist on Insult fighting at the end, where you have to out-Rabbi the bad Rabbi...
12

Khris

Quote-The battle can start only if Amelia knows a secret word. After Amelia discovers the word, how can I enable the option with the word in ALL the topics of the paladins?
-I make a topic with all the speech possibles and one with all the answers possibles and at the start they are all off but one. How to recicle these topics for all the paladins? Each paladin has his own set of questions/answers he knows so I need the same topics but different scripts.
If I have to make a copy of the topics for each paladin, how can I turn on a question or an answer in ALL the topics?

You'd use one dialog which contains the insults, and one which contains the answers.
There's no need to use one dialog per paladin.

Quote-If a paladin gives a correct response, how can I make him pick a random question he knows?
-How can I interrupt the conversation after someone gains the advantage three times?

Using run script and dialog_request()


I'm in the middle of creating a working example, give me some time, and I'll publish it here. Open source, of course.

Khris

Sorry for double-posting, but I wanted to bump the thread.

DOWNLOAD v0.9 for 2.72beta+
(exe included for the impatient ;))

Talk to the Rogers on the right, tell them "Shazam!" to start insulting each other.
They'll learn insults and responses when they hear them.

The big one knows all of them, so use him to learn more phrases.
The small one starts with two insults and two answers, so in the beginning, you should be able to beat him.

F10 resets their positions, should any of them have left the screen.

It's 3 AM here, I'm off to bed.

Andrechan

#6
Thanks a million Khris! *__*

Where can I find the 2.72 beta version?Ã,  ??? It doesn't open with my 2.71 version...

EDIT
No problem, I found it in the AGS wiki

EDIT 2
Ok, it opens. Will your scripts and dialogs still work with the  2.71 version if I export them?

Thanks again for your help ^_^

Khris

You're welcome, I've been wanting to do this for a long time anyways :)

The dialog scripts _should_ work with 2.71.
However, the global script won't, because the dialog commands have changed a bit.

You can edit it yourself, it's not hard.

d___.Start(); runs a dialog, you'll have to change every occurance to RunDialog(x);.
Same for d____.Set/GetDialogOption(o, enum);, which you'll have to change to Set/GetDialogOption(x, o, enum);
(Where x is the dialog topic, of course.)

If you take a look at the script, you'll notice that I've used an array called knows to keep track of known insults, etc.
In my example, the player's ID is 0, and the paladins' IDs are 1 and 2.
So by using data knows[2];, I've declared knows[0], knows[1] and knows[2]. Very convenient, since I can now use knows[Character.ID].

If you're going to have 10 paladins or more, make sure the parameter in the data knows[xx]; line is [index of last paladin]+1, otherwise you'll get an "array out of bounds" error.

SMF spam blocked by CleanTalk