Suggestion: automatic script calling

Started by stuh505, Wed 14/04/2004 03:55:38

Previous topic - Next topic

stuh505

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.

Gilbert

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.

stuh505

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?

Gilbert

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.

stuh505

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.



Las Naranjas

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.
"I'm a moron" - LGM
http://sylpher.com/novomestro
Your resident Novocastrian.

MillsJROSS

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

Rui 'Trovatore' Pires

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?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

As redruM says, the on_event global script function is called whenever a new room is entered.

SMF spam blocked by CleanTalk