Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: SGK on Tue 24/02/2004 23:19:01

Title: o this sounds real stupid: intro room and speech variables
Post by: SGK on Tue 24/02/2004 23:19:01
well how do i make the game start with the intro.crm room? ive saved the room as "intro" and it was supposed to start in it, isnt it?

i should define that the player starts in intro? but how? it doenst acccept letters! ???

****===****

And how do i set variables using a dialog scripting? sounds easy and all (its in thte manual too i know) but look at its explanation:

"set-globalint GI VAL

Changes text script GlobalInt number GI to have the value VAL. This is equivalent to the SetGlobalInt text script command, and allows you to quickly set things without having to go through a run-script just to set an int value. "

The name of the global variable im using is QUEST. So ive done this in the dialog:

// dialog script file
@S  // dialog startup entry point
EGO: Hi!
Q: What are you? A Sphero?! HAHAHA
EGO: Im an owl... Well:
set-globalint QUEST 511
return

and it doenst work. NOTE: 511 is the number of the global message i want to change to. The normal value of QUEST is 510 and i want to change it to 511! its simple someone help me!
Title: Re:o this sounds real stupid: intro room and speech variables
Post by: Gilbert on Wed 25/02/2004 02:12:09
Just set the player character to start in room 0, then the game will start in intro.crm, that's how the engine was designed.

For the globalint problems, there are actually 50 globalints already defined by the engine, not something you defined yourself in the scripts.

So, for example if you want to set globalint #6 to 500, just do in dialog script:

set-globalint 6 500

I'm not sure but I think you cant use variables for the globalint # in dialog scripts.

For more info on globalints and how to manage them in text scripts, read the SetGlobalInt() and GetGlobalInt() function entries from the manual.
Title: Re:o this sounds real stupid: intro room and speech variables
Post by: SGK on Wed 25/02/2004 21:09:51
ive read it all and put an excerpt from it  :P

look:
"set-globalint GI VAL

Changes text script GlobalInt number GI to have the value VAL. This is equivalent to the SetGlobalInt text script command, and allows you to quickly set things without having to go through a run-script just to set an int value. "

tahts whats in the manual about dialog scripting functions.

now i wanna know whats the GI thingy!

in ur example you said 6, but how do i know whats the number of the variable? it doenst have numbers! its just a list of all existing ones!

--==--
Ive set to room 0 but it appears an error message!
Title: Re:o this sounds real stupid: intro room and speech variables
Post by: Scorpiorus on Wed 25/02/2004 21:35:12
Ah, you probably add your global variables in the interaction editor but they are different than the "real" global variables that are operated via Set/GetGlobalInt() functions. Unlike interaction editor global variables these are referenced by numbers:

SetGlobalInt(3, 100);
Sets the value of global int number 3 to be qual 100.

It is them you have to use in the dialog script.

QuoteIve set to room 0 but it appears an error message!
What error text message did you get?
Title: Re:o this sounds real stupid: intro room and speech variables
Post by: SGK on Thu 26/02/2004 00:46:21
ok thanks!

heres the message:

Room 0 script line 5:
ERROR: a text script run in the PlayerEntersScreen event caused the screen to be updated. if you need to use Wait(), do so in After Fadein.

Ive fixed it already now thanks!

hey! wait! how do i set real global variables? ill have to use scripting??  
Title: Re:o this sounds real stupid: intro room and speech variables
Post by: Scorpiorus on Thu 26/02/2004 17:04:57
Quotehey! wait! how do i set real global variables? ill have to use scripting??
Yes, use SetGlobalInt() function:

SetGlobalInt(1, 5);

i.e. Set global int number one = 5

~Cheers
Title: Re:o this sounds real stupid: intro room and speech variables
Post by: SGK on Thu 26/02/2004 23:29:52
ok thanks again, ive discovered that when the autocomplete box appeared with SetGlobalInt.

But the problem now is that how do i say to the program that the number or the variable is the global message?

EDIT: Ive found the solution! thanks!

Need now help in: dialog requests. for the run-script 1 , i use
function dialog_request (int dialog) {
if (dialog == 1) {


but what do i use for another dialog request?
Title: Re:o this sounds real stupid: intro room and speech variables
Post by: Gilbert on Fri 27/02/2004 02:47:37
Just add more contents to dialog request if you want more.

eg.

function dialog_request (int dialog) {
if (dialog == 1) {blah bla bla
} else if (dialog == 2) {blah bla bla
} ...

Then it will respond to run-script 2, ... etc