Hotspot only Appear w/ Variable?

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Hotspot only Appear w/ Variable?

Postby ginchpuppy » Sun Nov 13, 2011 11:06 pm

Hello,
I am new to AM, but know how variables work and have experience with using them. What I'm trying to figure out is if its possible to have a screen automatically check for a variable.

I basically have a hotspot that I want to show up only if a variable has been triggered.
Sounds basic, but I can seem to figure out the best way to do this. Thanks in Advance!
ginchpuppy
New Member
 
Posts: 4
Joined: Sun Nov 13, 2011 11:00 pm

Postby reneuend » Sun Nov 13, 2011 11:23 pm

Welcome to the AM forums!

When do you want to set the variable?
If you want to set it to a certain value at the start of the game, then set it in the frame properties on your first frame.

You could also set the variable when the player clicks on a hotspot.

I don't use AM's built-in tool for setting variables. I like using the advanced tab. But it is just a personal preference.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby ginchpuppy » Mon Nov 14, 2011 3:39 pm

Thank you reneuend, I did not know that was a function.

How exactly would you code that in the advanced tab?
What is the benefit of coding it in the advanced tab v.s. the AM Variable functions?

I keep getting on error in this string:
If computer clicked = 1 then Action.GoToFrame "room1v1-3"

every time I click that hotspot. it brings up an error that says:
Error executing script
The Scripting engine returned the following error message:
Expected 'then'

Do I have that string of code wrong? I thought I would code it like:
if (name of variable) = 1 then Action.GoToFrame "(name of frame)"
Is that incorrect?

Again, thank you for your help.
ginchpuppy
New Member
 
Posts: 4
Joined: Sun Nov 13, 2011 11:00 pm

Postby reneuend » Mon Nov 14, 2011 4:48 pm

Hi!

If this is your exact code, then the variable is defined incorrectly.

Code: Select all
If computer clicked = 1 then Action.GoToFrame "room1v1-3"


You need to go to the advanced tab, look for the "variables" button at the bottom and click on it. Then define a "variant" variable for string variables. The variable name must be letters, numbers, and underscores only.

Here is how it might look if I defined a variable called, "computer_clicked":

Code: Select all
If computer_clicked = 1 then
    Action.GoToFrame "room1v1-3"
end if



Coding in the "advanced tab" allows for much more flexibility. You can define any value to a variable as opposed to just switching between 0 and 1.

When i get a chance, I'll send a simple project with notes to get you started.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby ginchpuppy » Mon Nov 14, 2011 5:08 pm

Ahhh, I see, I see.

So, to start string its If
and end the string with end if correct?

I think I understand the language a lot better now. Thank you very much.

Can you tell me anything about the limitations of embed a finished game into a web browser? Or, is this even possible? Again thank you very much.
ginchpuppy
New Member
 
Posts: 4
Joined: Sun Nov 13, 2011 11:00 pm

Postby reneuend » Mon Nov 14, 2011 6:18 pm

HTML Games are limited to the basic AM functionality. In other words, you can't use scripting, plugins, ...

Basically, you're limited to a point-and-click game.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby ginchpuppy » Mon Nov 14, 2011 6:42 pm

Wow, so you cant use any VBScript huh? Thats quite a downer.
Also, no .png support or any other image files that can support transparency?

Thanks again, you helped me out quite a bit.
ginchpuppy
New Member
 
Posts: 4
Joined: Sun Nov 13, 2011 11:00 pm

Postby reneuend » Tue Nov 15, 2011 1:31 am

If I were going to build a game for the web, I would use Javascript. If you really want to get into it, then learn either Flash or SilverLight.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Gumbro » Tue Nov 15, 2011 9:22 pm

@ginchpuppy, if I understood you correctly, you don't have to do scripting.

From the help document available here:

http://www.adventuremaker.com/help/techniques.htm

--------

1. Is there a way for a hotspot to be activated after I click on another hotspot at a different location (without scripting)?

Yes, through the use of variables (NO scripting is required). Just follow these steps:

1. Go to the "Hotspot Properties" of your first hotspot and change the first option that is under the "variables" tab so that a variable becomes 1 when the hotspot is clicked.

2. Go to the Hotspot Properties of your second hotspot and change the second option that is under the "variables" tab so that the hotspot is activated (i.e. "visible" or "enabled") only when the value of the variable is 1.

--------

@reneuend, are you sure about recommending Flash or Silverlight? Adobe just stated they are going to ditch mobile Flash and did Silverlight ever make it? The current way to go for browser games seems to be html5 along with javascript. For hobbyists a good starting point is to use one of the free html5 game engines such as Scirra 2 or Tululoo.

Then again, while it is possible to make adventure games which run in a browser (today you can even have a 'save game' feature there), I still prefer the highly optimized AM interface for developing. I just hope one day AM will output html5 :D
User avatar
Gumbro
Active Member
 
Posts: 88
Joined: Thu Oct 05, 2006 7:33 pm


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron