I couldn't find answer to this in the manual.
How can I make those cutscenes,intros and outros?
I want to make cutscene like this: When the player comes to a new room, there is another character, who stand somewhere in the room. When the player enters the room, the other character walks to door, opens it and walks away and door closes again.
I have tried to make those walking cutscenes, but the character doesn't move. He just walk, but don,t move anywhere. Hope you understand ???
Thanks for help ;D
From the information you provided it's not really easy to find out what your problems might be. The first thing that came into my mind is the question whether you really put walkable areas onto your screen before stating to script the cutscene.
If thats not the problem, maybe you could post exactly what script you wrote for you cutscene or what you did in the editor to build up the cutscene, then we could be able to help you.
I got that cutscene working almost perfect 8)
The only problem is this: When the character opens the door, how can I change the graphic so, that the door looks like it is open? Do I have to use animation?
I have other problem too. Here it is: When the player choose the correct option in dialoque, I want, that the other character, then moves to get an object and moves back where he was. I don't now how to do this.
Thanks for help.
make a corresponding sprite image of the door looking like its open, and import it into the sprite manager. then go to the room, and go to objects of the 3 tiers, and there is a new object button, select that, then find your image, place it over your door perfectly. then when you want that image to seeem open,place a AnimateObject command
as for the other question. MoveCharacterDirect
-----------
dont forget to use StartCutscene, and EndCutscene
:)
Thanks for help!
I will try those. If they work, good, if not, then I have to ask help again :-\
Thanks anyway ;D
Hey Scummbuddy. Can you give me a example how to do those MoveCharacterDirect commands? I tried, but it did not work :'(
take a look at this thread. its has a lot of code for you to look at. if it still doesnt help, dont fret, and write us back and let us know!
good luck!
http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=11038;start=msg133101#msg133101
Where do I put the script?
When the player choose the correct option in dialoque I want, that the other character moves and get the object. I now know the script, but where do I put it? Do I have to put it in dialoque script or somewhere else?
Here is the dialoque script:
// dialog script file
@S // dialog startup entry point
return
@1 // option 1
KAVERI: "Perfect. Where it is?."
EGO: "It is there. In the self."
KAVERI: "Ok. I will go and get it." :P
stop
@2 // option 2
KAVERI: "Come back when you have the key."
stop
The line where is the smiley, is the line when the character should move to self. So where do I put the movescript?
just alittle bit offtopic, but you should really ask someone to check your whole game for spelling mistakes because
// dialog script file
@S // dialog startup entry point
return
@1 // option 1
KAVERI: "Perfect. Where it is?."KAVERI: "Perfect. Where is it?."[
EGO: "It is there. In the self."EGO: "It is there. In the shelf."
KAVERI: "Ok. I will go and get it."
@2 // option 2
KAVERI: "Come back when you have the key."
stop
so that's two mistakes in only 4 lines...
And about your problem... put it into the mainscript, and use run-script command in your dialoguescript.
Thanks for reporting the spelling mistakes Minimi, but this is not a serious game that I make. It is only a game that I make to practice using AGS. And I know that my english is not so good ;D
But thanks for the help anyway ;)
Is there somebody, who could do the script for me, maybe you Scummbuddy? Then I could see exactly how that script should be done. I just don't get it now :(
I could send my game to you by e-mail. How does that sound?
I asked previously about that scripting problem in my dialoque.
I now know excatly how the script goes, but I don't know how to do it.
// dialog script file
@S // dialog startup entry point
return
@1 // option 1
KAVERI: "Perfect.Where is it?"
EGO: "In the shelf."
KAVERI: "Ok. I will go and get it."
Run-script x <----- Is this right?
@2 // option 2
KAVERI: "Come back later when you have it."
stop
When the player choose option 1, I want that the KAVERI moves to get the object and moves back. I have place the run-script in there, is that in right place? The x is there because I don't know what should be in that place. Where do I put the Movecharacter script? Do I put it in the main script, or where?
When I get back from work tonight, I should put up some workable code for you to work with. It would help me to know exactly what you want to happen. be as specific as you can.
You need to put a number instead of x, like:
// dialog script file
@S // dialog startup entry point
return
@1 // option 1
KAVERI: "Perfect.Where is it?"
EGO: "In the shelf."
KAVERI: "Ok. I will go and get it."
run-script 5 <----- run script with the parameter value 5
return <--- don't forget to return
@2 // option 2
KAVERI: "Come back later when you have it."
stop
Then yes, goto the main global script and add the dialog_request() function declaration unless you already have one:
//main global script
function dialog_request(int parameter) {
Ã, Ã, Ã, if (parameter == 5) { // the one we pass via run-script 5
Ã, Ã, Ã, Ã, Ã, Ã, MoveCharacter(KAVERI, X, Y);
Ã, Ã, Ã, Ã, Ã, Ã, character[KAVERI].inv[ INVENTORY_NUMBER ]=1;
ObjectOff(OBJECT_NUMBER);
Ã, MoveCharacter(KAVERI, X1, Y1);
Ã, Ã, Ã, }
}
note: replace X,Y,X1,Y1, OBJECT_NUMBER and INVENTORY_NUMBER with the values you want.
This is what I want:
When the player talks to other character (script name KAVERI) and he choose the correct answer, then the other character walks to a shelf, takes a key and walk back to where he was.
I have done the dialoque and I think that I know how to do that script code. What I don't know, is that where should I put this code. Do I have to make run-script command to the dialoque code?
This is the dialoque:
// dialog script file
@S // dialog startup entry point
return
@1 // option 1
KAVERI: "Perfect.Where is it?"
EGO: "In the shelf."
KAVERI: "Ok. I will go and get it."
Run-script x <----- Is this right?
@2 // option 2
KAVERI: "Come back later when you have it."
stop
QuoteWhen the player talks to other character (script name KAVERI) and he choose the correct answer, then the other character walks to a shelf, takes a key and walk back to where he was.
//main global script
function dialog_request(int parameter) {
Ã, Ã, Ã, if (parameter == 5) { // the one we pass via run-script 5
Ã, Ã, Ã, Ã, Ã, Ã, int curX = character[other character].x;
Ã, Ã, Ã, Ã, Ã, Ã, int curY = character[other character].y;
Ã, Ã, Ã, Ã, Ã, Ã, MoveCharacterBlocking(other character, shelf X, shelf Y, 1);
Ã, Ã, Ã, Ã, Ã, Ã, character[other character].inv[ key num ]=1;
Ã, Ã, Ã, Ã, Ã, Ã, MoveCharacterBlocking(other character, curX, curY, 1);
Ã, Ã, Ã, }
}
To specify: other character, shelf X, shelfY, key num.
How does it go?
It still does not work :'(
Here are the scripts that I made:
// dialog script file
@S // dialog startup entry point
return
@1 // option 1
KAVERI: "Perfect.Where is it?"
EGO: "In the shelf."
KAVERI: "Ok. I will go and get it."
Run-script 5
return
@2 // option 2
KAVERI: "Come back later when you have it."
stop
This is the main script:
// main global script file
function game_start() {
// called when the game starts, before the first room is loaded
}
function repeatedly_execute() {
// put anything you want to happen every game cycle here
}
function show_inventory_window () {
// This demonstrates both types of inventory window - the first part is how to
// show the built-in inventory window, the second part uses the custom one.
// Un-comment one section or the other below.
// ** DEFAULT INVENTORY WINDOW
InventoryScreen();
/*
// ** CUSTOM INVENTORY WINDOW
GUIOn (INVENTORY);
// switch to the Use cursor (to select items with)
SetCursorMode (MODE_USE);
// But, override the appearance to look like the arrow
SetMouseCursor (6);
*/
}
function on_key_press(int keycode) {
// called when a key is pressed. keycode holds the key's ASCII code
if (IsGamePaused() == 1) keycode=0; // game paused, so don't react to keypresses
if (keycode==17) QuitGame(1); // Ctrl-Q
if (keycode==363) SaveGameDialog(); // F5
if (keycode==365) RestoreGameDialog(); // F7
if (keycode==367) RestartGame(); // F9
if (keycode==434) SaveScreenShot("scrnshot.bmp"); // F12
if (keycode==9) show_inventory_window(); // Tab, show inventory
if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
if (keycode==22) Debug(1,0); // Ctrl-V, version
if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
}
function on_mouse_click(int button) {
// called when a mouse button is clicked. button is either LEFT or RIGHT
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button==LEFT) {
ProcessClick(mouse.x, mouse.y, GetCursorMode() );
}
else { // right-click, so cycle cursor
SetNextCursorMode();
}
}
function interface_click(int interface, int button) {
if (interface == ICONBAR) {
if (button == 4) { // show inventory
show_inventory_window();
}
else if (button == 5) { // use selected inventory
if (character[ GetPlayerCharacter() ].activeinv >= 0)
SetCursorMode(4);
}
else if (button == 6) // save game
SaveGameDialog();
else if (button == 7) // load game
RestoreGameDialog();
else if (button == 8) // quit
QuitGame(1);
else if (button == 9) // about
Display("Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2003 Chris Jones");
} // end if interface ICONBAR
if (interface == INVENTORY) {
// They clicked a button on the Inventory GUI
if (button == 1) {
// They pressed SELECT, so switch to the Get cursor
SetCursorMode (MODE_USE);
// But, override the appearance to look like the arrow
SetMouseCursor (6);
}
if (button == 2) {
// They pressed LOOK, so switch to that mode
SetActiveInventory(-1);
SetCursorMode(MODE_LOOK);
}
if (button == 3) {
// They pressed the OK button, close the GUI
GUIOff (INVENTORY);
SetDefaultCursor();
}
if ((button == 4) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
// scroll down
game.top_inv_item = game.top_inv_item + game.items_per_line;
}
if ((button == 5) && (game.top_inv_item > 0)){
// scroll up
game.top_inv_item = game.top_inv_item - game.items_per_line;
}
}
}
function character1_a() {
// script for character1: Talk to character
MoveCharacterBlocking(EGO,239,210,0);
FaceLocation(EGO,300,211);
AnimateCharacter(EGO,2,2,0);
RunDialog(0);
}
function character1_b() {
// script for character1: Talk to character
}
function dialog_request(5) {
if(5) {
MoveCharacterBlocking(KAVERI,200,150,0);
MoveCharacterBlocking(KAVERI,120,75,0);
}
Because the dialog_request() function should be like this (didn't check other things tho):
function dialog_request(int value) {
if(value==5) {
MoveCharacterBlocking(KAVERI,200,150,0);
MoveCharacterBlocking(KAVERI,120,75,0);
}
}
[EDIT]!!! I just doesn't work :(
I have tried all the things that you guys have explained, but still doesn't work.
This are what I have tried:
function dialoq_request(5){
if(value==5){
MoveCharacterBlocking(KAVERI,200,150,0);
MoveCharacterBlocking(KAVERI,120,75,0);
}
}
I have also tried to put int 5 in dialoq_request.
I tried to put only number 5 in the if line.
I get this error message when I try to run my game:
There was an error compiling your script. The problem was in 'main script':
Error (line 126):PE03: Parse error at '5'
Do you want to fix the script now? (Your game has not been saved)
There is no need to curse, my friend!
You just didn't listen to Gilbot. He said...
function dialoq_request(int value){
if(value==5){
MoveCharacterBlocking(KAVERI,200,150,0);
MoveCharacterBlocking(KAVERI,120,75,0);
}
}
so... no 5, or int 5.. just int value!
Sorry, I have been a stupid :-[
I now got the game working, but the other character still doesn't move. Any ideas why this happpens?
I place in the dialoq that run-script command and main global script the script that you guys told me. By the way, can I put the run-script value whatever I want? It is 5 now.
Who is the other character? If it's not KAVERI that yes he won't move until you add appropriate script code. In case you are talking about KAVERI himself try modify the dialog_request code a bit:
function dialoq_request(int value){
if(value==5){
MoveCharacterBlocking(KAVERI,200,150,
1);
MoveCharacterBlocking(KAVERI,120,75,
1);
}
}
QuoteBy the way, can I put the run-script value whatever I want? It is 5 now.
Yes, you can use any value you want. Just make sure it's the same one you are checking in the dialog_request for.
I have tried both, but didn't work.
Thisis the script now. I have place it for bottom in the main global script.After the dialoque script. Like this:
function character1_a() {
// script for character1: Talk to character
MoveCharacterBlocking(EGO,239,210,0);
FaceLocation(EGO,300,211);
AnimateCharacter(EGO,2,2,0);
FaceLocation(KAVERI,75,194);
RunDialog(0);
}
function dialoq_request(int value){
if(value==5){
MoveCharacterBlocking(KAVERI,170,192,0);
MoveCharacterBlocking(KAVERI,200,150,0);
}
}
I got the cutscene working when I remaked my game 8)
Now I started to make a new game and that cut-scene is againg making me nuts.
I have make all the things like they should be and the game works. But when the other character should move, he doesn't. It just got back to the dialog.
This is the script:
function character2_a() {
// script for character2: Talk to character
FaceCharacter(OLLI,ARI);
FaceCharacter(ARI,OLLI);
RunDialog (0);
}
function dialoq_request(int value){
if (value==1){
MoveCharacterBlocking(ARI,249,194,1);
}
}
I noticed this. When I try to click the script/dialoq_request I got this message:
Function dialoq_request was not found in the script file. Consult the manual for the correct way of creating it.
Could that be the problem? I haven't found a solutuon for this :'(
Please help.
Because you mispelt dialog as dialoq in the script...