Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: stuh505 on Wed 14/04/2004 03:55:38

Title: Suggestion: automatic script calling
Post by: stuh505 on Wed 14/04/2004 03:55:38
Hello,

I am in a situation where it would be really nice to be able to write a script that would exectute every time a room is loaded.  This is because my mouse cursor icon is displayed as a RawDraw image whenever the icon is changed.  There is only one way I know of to do this, and that is to draw the image continuously.

Other game design systems such as Bioware's Aurora Engine for NWN offer a MUCH cleaner way to get around problems like this.  Instead of having just one "global" script, the game can accept a number of script files defining notable events.  In AGS, you could allow any number of script files which could be named by the designer, and then allocated into runtime slots such as "continous", "game start", "room load", and anything else you might think of.  This would allow much cleaner code by breaking up large script files in addition to allowing for less hack-jobbing.
Title: Re:Suggestion: automatic script calling
Post by: Gilbert on Wed 14/04/2004 04:05:23
What's the problem with putting it in the repeatedly execute, player enter screen, etc. room script functions? You know that it is always possible right? Did you read the manual ?

On the other hand, I think the raw-drawing cursor idea is not very practical (unless that's what you want to do), as raw draw always draw on the background, so it'll be behind most of the stuffs (objects, characters, etc.) and you may need to restore the screen every game loop to wipe clean of it.
Title: Re:Suggestion: automatic script calling
Post by: stuh505 on Wed 14/04/2004 05:21:57
QuoteWhat's the problem with putting it in the repeatedly execute, player enter screen, etc. room script functions? You know that it is always possible right? Did you read the manual ?

Qui pro quo, Mr. Gilbot.

Perhaps you did not read my post?
Title: Re:Suggestion: automatic script calling
Post by: Gilbert on Wed 14/04/2004 05:27:49
Actually I couldn't understand much about what you really want to do.

I'm not sure, but maybe what you want is to break the room and global scripts into pieces, but I think using the search feature of the scripter is good enough for looking up infos of them already.
Title: Re:Suggestion: automatic script calling
Post by: stuh505 on Wed 14/04/2004 06:14:50
If you ever program in C++ (the language this is based on) you will realize that code doesn't need to be so sloppy.

The main content of the global script file would normally be part of the header file.

The loading of a room is a key event which cannot be used to trigger an event in scripts currently.


Title: Re:Suggestion: automatic script calling
Post by: Las Naranjas on Wed 14/04/2004 07:23:31
I'm sorry mate, but you've confuzzled me as well, it's really hard to understand just what you're talking about. Could you start again, hopefully without antagonising Gilbert, who is only trying to be helpful.
Title: Re:Suggestion: automatic script calling
Post by: MillsJROSS on Wed 14/04/2004 07:36:13
I think the problem Gilbert has in trying to help you is that you're too vague. Perhaps, if he could have more information, as to why your cursor is employing RawDraw. I've read through your post several times, and asked some others to read over it. And quite simply put, no one has been able to decipher what you're saying.

It's also problematic, when your responses to Gilberts help, are sarcastic and belittling. He's trying to help you out, but your post was so unclear he doesn't know from what angle you're comming from. Please try to respect people on these forums. Gilbert is renowned for being one of the most technical helpful members of this forum. So, yes, I'm sure he's programmed in C++ to be such a great help.

Now please clarify what your problem is...and pretend for just a moment that the poeple here not only know C++ but know the ins and outs of AGS. It'll make things easier. Also pretend that everyone is your equal, and things shall go smoothly when asking for help.

-MillsJROSS
Title: Re:Suggestion: automatic script calling
Post by: Rui 'Trovatore' Pires on Wed 14/04/2004 08:32:00
QuoteI am in a situation where it would be really nice to be able to write a script that would exectute every time a room is loaded.
Aren't we talking on_event, ENTER_ROOM?
Title: Re:Suggestion: automatic script calling
Post by: Pumaman on Wed 14/04/2004 20:36:11
As redruM says, the on_event global script function is called whenever a new room is entered.