Concerning rooms in cutscenes...

Started by TheQisSilent, Tue 25/11/2003 10:58:31

Previous topic - Next topic

TheQisSilent

I'm pretty sure there's a way to do this, but I can't figure it out or find it in the manual for the life of me.  Right now I'm working on my opening cutscene and it goes back to the same rooms multiple times.  So far I've just been making new rooms for the old rooms to make the new events happen, but this is making the game take up way too much space.  So how can I make it so a new event happens in the same room depending on how many times you've visited there?  Thanks for helping this confused newbie.


Follow the updates and download the demo of AFRO JONES- IN COLOR!

Minimi

#1
You could use SetGlobalValue(1) for this. (this could be any number)

Every time you want in your cutscene to load the room with it's specified actions for that moment, you could change the global value.
Like the first time to 1, second time to 2 etc. etc... (check the helpfile within ags, for more info on setglobalvalue.

Then in the room script :

if (GetGlobalValue(1) == 1) {
YOUR ACTION HERE;
}

if (GetGlobalValue(1) == 2) {
YOUR ACTION HERE;
}

if (GetGlobalValue(1) == 3) {
YOUR ACTION HERE;
}

That should work!

TheQisSilent

I can't find anything about GetGlobalValue in the help file and whenever I try to save it, it says it's "undefined."  Do you mean GetGlobalInt?

And hey, while I have your attention, how do you make a wait for a dialog?  You know, like you can have While(character[CHARID]animating.)Wait(1);?  How can you set this for a dialog?

But thanks for all your help so far and sorry for not grasping this as quick as we all would like, but my most advanced scripting before this was HTML ;)


Follow the updates and download the demo of AFRO JONES- IN COLOR!

Ishmael

It is SetGlobalInt and GetGlobalInt. You can get confused with them...

But I don't quite understand the wait for a dialog question... Dialogs automatically block the game, AFAIK... But if you have a RunDialog command in a script, the dialog will be ran when the current script function is finished. So, it won't matter wheather you put the RunDialog in the beginning or the end of a script, it will be run as the last command.

To get around this, you must use run-script x dialog command and dialog_request global function. The manual gives more information about these.
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.

TheQisSilent

Well thanks for the help, but it seems I can't do anything right.  AGS keeps prompting me with a parse error after the "1."  What am I doing wrong here?  I put this in the global script like it said in the manual:

function dialog_request (1) {
   FaceLocation (MYSTERY, 49, 222);
 }

I thought it was a very simple script- what am I doing wrong?


Follow the updates and download the demo of AFRO JONES- IN COLOR!

Minimi

Are you sure you've placed this script outside of any other "}" ?
And if it is, and still not working, then try to add another "}"  above or underneath

TheQisSilent

Still giving me trouble.  Garr.


Follow the updates and download the demo of AFRO JONES- IN COLOR!

Ginny

TheQisSilent: I think the problem is that

function dialog_request (1) {
FaceLocation (MYSTERY, 49, 222);
}

is supposed to be

function dialog_request (X, or int X don't remember) {
if (X==1) {
FaceLocation (MYSTERY, 49, 222);
}
}

ant use run-script 1

X can be anything you wan tas long as it's consistent within the function.
Try Not to Breathe - coming sooner or later!

We may have years, we may have hours, but sooner or later, we push up flowers. - Membrillo, Grim Fandango coroner

TheQisSilent

Well yeah, that was it.  Thanks for all your help, guys.


Follow the updates and download the demo of AFRO JONES- IN COLOR!

SMF spam blocked by CleanTalk