How to have the player do something only if he's already done something else

Started by pyjamagris, Tue 20/01/2004 19:29:57

Previous topic - Next topic

pyjamagris

Hi everyone. After a long search throughout the forum, I couldn't find what I'm looking for, so I'm trying to write a message myself, using my humle abilities in english. (ont easy for a french guy - what ? You don't give a f--- ?)

Actually, I don't really know what to say; my problem is pretty much explained in the title of the message... But to be more precise, let's imagine the following situation : I've set my first room so that when the player character walks off the screen, he finds himself in another room. But I only want him to leave the room if he's already spoken to the other character present in the room. Also, I'd like that, during a dialog, each option disapears after they've been clicked...  but I figure it's the same problem as above.

I suppose it would be logic to think that my problem has something to do with the "if" thing and the "conditional" stuff, and I'v tried to learn a bit about it, but frankly, it's chinese to me...

Someone please heeeelp !
Thanks from Paris

Ishmael

For the dialog thing, study the dialog script commands in Tutorial -> Starting Off -> Conversations in the manual.

Fot the first one...

You can set a globalint:

in the walk off screen edge, where you want the player to be able to leave only after the dialog:

choose "Run Script" from the dropdown and then click "Edit script":

if (GetGlobalInt(1) == 1) {
NewRoom(1);
} else {
Display("You shouldn't go yet...");
MoveCharacterBlocking(EGO,character[EGO].x - 10, charcter[EGO].y);
}

If it is the right screen edge in the second room you want the condition to apply, change the minus before 10 in the MoveCharacter... command to a plus.

Now, in the dialog, in the point where you want to they player to be allowed to leave the room, use:

set-globalint 1 1
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

pyjamagris

Thanks a lot for your time; at first it looked like it worked, the character didn't leave the room as I wanted. But even after the dialog, he wouldn't leave the room !

I figured maybe you had mistyped set-globalint 1 1, adding ( and) :
set-globalint (1,1), but then the software replied : "Not enough parameters for set-viewspeech / set-globalint".

Any idea ?

pyjamagris

Forget what I said; I just misplaced it in the script. It works just fine ! Thanks again !

SMF spam blocked by CleanTalk