Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: VII Toast on Wed 13/10/2004 14:02:33

Title: Does anyone know the script for intro?
Post by: VII Toast on Wed 13/10/2004 14:02:33
Read the tittle againÃ,  :P

But reall, does anyone know?
Title: Re: Does anyone know the script for new game, load and exit?
Post by: Fightmeyer on Wed 13/10/2004 14:36:05
Quote from: VII Toast on Wed 13/10/2004 14:02:33
Read the tittle againÃ,  :P

But reall, does anyone know?

Watch the AGS Manual! There are exactly the functions you are looking for.
Seacrh for Functions or restart or something like that.

Title: Re: Does anyone know the script for new game, load and exit?
Post by: VII Toast on Wed 13/10/2004 14:40:37
you follow me too much  ;)
Title: Re: Does anyone know the script for new game, load and exit?
Post by: Barbarian on Wed 13/10/2004 15:18:10
RestartGame();

RestoreGameDialog();

QuitGame(1);
Title: Re: Does anyone know the script for new game, load and exit?
Post by: VII Toast on Wed 13/10/2004 16:05:45
Hey, thanks. Although when I try to make a new game it brins me back to the start screen. What' wrong with it? The first room is room "1"
Title: Re: Does anyone know the script for new game, load and exit?
Post by: on Wed 13/10/2004 16:07:12
Heh, I was just about to post this as well:

Just to add to what Barbarian said:
I'm guessing you want this for an intro screen thing?
If so, RestartGame() probably isn't what you want, as it will just re-load the game from the begining - meaning you'll be stuck on the intro screen. Instead, use NewRoom or NewRoomEx to move to the room the game starts in. (In this case, 1).
Title: Re: Does anyone know the script for new game, load and exit?
Post by: VII Toast on Wed 13/10/2004 16:08:23
NewRoom(1);

???
Title: Re: Does anyone know the script for new game, load and exit?
Post by: Ashen on Wed 13/10/2004 16:35:53
Yup, if room 1 is where the playable part of the game starts - that is, if it's not the intro screen. NewRoomEx does the same, but lets you set where the player is in the room, if you haven't done so on the 'Character' window of the editor.
Title: Re: Does anyone know the script for new game, load and exit?
Post by: VII Toast on Wed 13/10/2004 17:16:14
Hrm, I seem to be having a problem loading up the game from a saved file. It is RestoreGameDialog(); right?

I'm using that, doesn't load. It shows Global Message #983 the message is default and it says,"Sorry, not now."
Title: Re: Does anyone know the script for new game, load and exit?
Post by: BorisZ on Wed 13/10/2004 18:40:47
Quote from: VII Toast on Wed 13/10/2004 17:16:14
Hrm, I seem to be having a problem loading up the game from a saved file. It is RestoreGameDialog(); right?

I'm using that, doesn't load. It shows Global Message #983 the message is default and it says,"Sorry, not now."


Maybe your game is changed in meantime and engine can't load the old game with new preferencies.
Title: Re: Does anyone know the script for new game, load and exit?
Post by: Gord10 on Wed 13/10/2004 19:18:46
Quote from: VII Toast on Wed 13/10/2004 17:16:14
Hrm, I seem to be having a problem loading up the game from a saved file. It is RestoreGameDialog(); right?

I'm using that, doesn't load. It shows Global Message #983 the message is default and it says,"Sorry, not now."


Are you sure saving isn't disabled in the room? There is an option "Save/load disabled" in the room settings. (Room Editor/Settings) It's between the options "Play music on room load" and "Hide Player Character".
Title: Re: Does anyone know the script for new game, load and exit?
Post by: TerranRich on Wed 13/10/2004 22:18:30
Next time, VII Toast, read the manual! It's there for a reason!

As for your restore-game question, what is the exact script you're using?
Title: Re: Does anyone know the script for new game, load and exit?
Post by: VII Toast on Thu 14/10/2004 10:58:50
Ah, I fixed it. Cool.

I have another question, but I better look in the manual first....

EDIT:. O.k.// I looked for my question, but I didn't find it (or if I did than I didn't notice it, I am new after all!)

My question is, I want to use a script for an intro sequence. Anyone got one? (Get ready for the flaming....)
Title: Re: Does anyone know the script for intro?
Post by: Radiant on Thu 14/10/2004 11:51:21
StartCutscene (1);
SetCharacterView (EGO, INTRODANCE);
AnimateCharacter (EGO, 3, 5, 1);
Wait (80);
Display ("Welcome to this game!");
Display ("No really, I meant that!");
AnimateCharacterEx (EGO, 4, 6, 0, 0, 1);
AnimateCharacterEx (EGO, 4, 6, 0, 0, 1);
EndCutscene ();
NewRoom (5);


Edited out the capitalization errors.
Title: Re: Does anyone know the script for intro?
Post by: VII Toast on Thu 14/10/2004 12:05:27
Uhm. Seems to be a little buggy for the new person's eyes.

I put my start screen as INTRO and my intro at room 2.....did I mess up somewhere? :P
Title: Re: Does anyone know the script for intro?
Post by: Radiant on Thu 14/10/2004 12:43:20
No, it's not buggy, it just depends on what you call your views.

You can put the title screen and intro in whichever room you like. Note that 'intro.crm' is room #0, not room #1. Bear in mind that the starting room for the player character should be your title screen room, e.g. 0 in your case. Then the title screen should have NewRoom (2) somewhere in its script.
Title: Re: Does anyone know the script for intro?
Post by: VII Toast on Thu 14/10/2004 13:12:26
Argh.


There was an error compiling your script. The problem was:
In: 'Main Script'
Error (line 28): Undefined token 'StartCutScene'

Do you want to fix the script now? (Your room has not been saved).



Doesn't seem it likes me.

Does this script have to be when you start the game up? Because I don't want it like that, I want a hotspot you can click, it would go to a new room and then show the intro.

Thanks.
Title: Re: Does anyone know the script for intro?
Post by: Ashen on Thu 14/10/2004 14:10:13
StartCutscene()
Note the capitalisation - AGS script is case sensitive. Radiant did get it wrong, but it's right there in the manual.

Anyway:
In your Intro/start screen (New Game/Load/Quit), the 'New Game' button interaction should send you to room 2.
In room 2, in the 'First time player enters screen' interaction, put the script for your intro.
Title: Re: Does anyone know the script for intro?
Post by: jetxl on Thu 14/10/2004 14:16:16
No, you have to place the code in the room where you want the intro to start.


Ã,  // script for room: First time player enters screen
Ã,  character[GetPlayerCharacter()].x=350;Ã,  //charac start at x350
Ã,  character[GetPlayerCharacter()].y=120;Ã,  //charac start at y120
Ã,  MoveCharacterBlocking(GetPlayerCharacter(),160,120,1);Ã,  //let character walk on screen
Ã,  FaceLocation(GetPlayerCharacter(),160,1000);Ã,  //face screen
Ã,  DisplaySpeech(GetPlayerCharacter(),"I'm here to infotain you.");Ã,  //character says something
Ã,  MoveCharacterBlocking(GetPlayerCharacter(),20,120,1);Ã,  //character walks to the left
Ã,  DisplaySpeech(GetPlayerCharacter(),"Oh, I can't go this way.");Ã,  //say something
Ã,  DisplaySpeechBackground(GetPlayerCharacter(),"Then I'll go that way.");Ã,  //talk while walking
Ã,  MoveCharacterBlocking(GetPlayerCharacter(),160,120,1);Ã,  //walk
Ã,  MoveCharacterBlocking(GetPlayerCharacter(),160,250,1);Ã,  //walk of screen


Try to explain what you want to do in the intro.
Title: Re: Does anyone know the script for intro?
Post by: VII Toast on Thu 14/10/2004 15:31:05
Quote from: jetxl on Thu 14/10/2004 14:16:16
No, you have to place the code in the room where you want the intro to start.


  // script for room: First time player enters screen
  character[GetPlayerCharacter()].x=350;  //charac start at x350
  character[GetPlayerCharacter()].y=120;  //charac start at y120
  MoveCharacterBlocking(GetPlayerCharacter(),160,120,1);  //let character walk on screen
  FaceLocation(GetPlayerCharacter(),160,1000);  //face screen
  DisplaySpeech(GetPlayerCharacter(),"I'm here to infotain you.");  //character says something
  MoveCharacterBlocking(GetPlayerCharacter(),20,120,1);  //character walks to the left
  DisplaySpeech(GetPlayerCharacter(),"Oh, I can't go this way.");  //say something
  DisplaySpeechBackground(GetPlayerCharacter(),"Then I'll go that way.");  //talk while walking
  MoveCharacterBlocking(GetPlayerCharacter(),160,120,1);  //walk
  MoveCharacterBlocking(GetPlayerCharacter(),160,250,1);  //walk of screen


Try to explain what you want to do in the intro.

Ha! Yours is the only one that actually worked! Anyhoo, if you want me to tell you what I want in the intro, I wish this..

Just a normal display message to appear, telling out the story so far.
(I would want some charater movements and actions, although I would have to edit that myself, which I'm not good at.  :P)

The text shoud say this...

Once, a long time ago...
There was a boy, a poor one at that.
He wasn't happy, and had very little friends.
But, he had one dream.
To become the greatest Pimp the world will ever know.
He worked for day after day, year after year.
Then, finally. His dream had come true.
He soon had more money than most could imagine.
The Pimp settled down, married and had a son.
This son is you. But hidden to you both...
..there are dark forces looming to gain your fathers riches.
They will do anything they can to gain his power...even kill.
And so begins Pimps at Sea!

Then, at the end of that. I would like it to go back to the INTRO screen, or room 0.

Thanks!!!
Title: Re: Does anyone know the script for intro?
Post by: Scorpiorus on Thu 14/10/2004 19:19:50
Well, then you can make all the text a global message and show a text window using a DisplayMessage command:

DisplayMessage(MESSAGE_NUMBER_HERE);
NewRoom(0); // back to the INTRO screen

But really, be sure to check the manual - all of that can be found there ;)
Title: Re: Does anyone know the script for intro?
Post by: on Thu 14/10/2004 20:22:35
Ah, great. I'm done with that. O.k. thanks guys. Problem solved. ;D