Regarding Hotspot functions...

Started by monkey0506, Sun 07/11/2004 17:58:52

Previous topic - Next topic

monkey0506

How does the game determine what method of interaction it should use in the room script? The functions are named as "function hotspot2_a", "function hotspot2_b", etc. as they are created in the interaction menu. So if I make a script for "Look at hotspot" --> Run script, and then I make one for "Any click on hotspot" --> Game - Display a message, and then I delete the look at function in the interaction editor menu, any click is defined by "function hotspot2_b". But if I make the any click function first, it is named "hotspot2_a". The only distinguishing characteristics that I can see are the comment lines which read, i.e., "//script for hotspot2: Look at hotspot". So how does the game determine what you are intending to do with the function (what method of interaction)?

EDIT: Also, would changing the hotspot NAME affect this interaction? I have an extension in the hotspot name that I am using to determine the default right-click interaction for the hotspot, but I remove it in my script, so would that affect my scripts? (i.e. hotspot 2 is named "sky>o" but the ">o" part should be removed from the name so when it is added to my label it appears as "sky".

Edwin Xie

Actually, that function is only for the script interactions. For example, you choose "Look at Hotspot" and for it, you display a message and your didn't do it by script. Then if you look at the script for that hotspot, there is nothing. It actually saves it.
Yes, it will, the game will not know which hotspot you mean to add the script.
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

monkey0506

Well actually what I meant to put, but didn't is "Run Script" and have the script read:

Display("SOMETHING");

And, I realized that I didn't actually change the name of the hotspot, if that's even possible, but just the text that gets put on the label. And to avoid getting off topic, you didn't actually answer my initial question. HOW does the game determine what method of interaction function hotspot2_a is vs say hotspot2_c?

Ashen

Quote
HOW does the game determine what method of interaction function hotspot2_a is vs say hotspot2_c?
Magic. That, or golbins. Maybe goblin magic.
By which, of course, I mean - I think it's handled by AGS internaly, the sections and comment lines (Hotspot2_a, etc) are generated more for our reference & convenience than anything else, and are, as you said, based on the order the interactions were set.

They may, however, be a hold-over from earlier versions, where you could create the hotspot/object interactions directly in the Room Script (i.e. without selecting the hotspot/object, opening the editor, selecting 'Run script'. Obviously, you can still edit them in the Room Script), when they would probably have followed some system. Not totally sure about this bit, though - you'll have to ask a longer-term user than me.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk