Variable Bug in AM?

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

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

Variable Bug in AM?

Postby drdna » Tue Jun 15, 2010 1:49 am

Hi there,

An issue came up when I was testing a game I'm creating. I have 10 buttons on the left of my screen. Each is an independant "path" that the players can take. Anyway, when a button is pushed, the player is prompted with their name, which is stored in a variable. Their name is displayed on the right of the (main) screen. If you click on their name, the game goes to that players current position. I wish I could figure out how to link an image because I have screenshots. LOL.

It's difficult to explain really, but here's the main problem: If only one player (Player 1) is playing, the code works perfectly. However, if more than one player is playing, the hotspots on their name will NOT respond. Here is the code for the player names:

if P1_1 = 1 then Action.GoToFrame "ID-1", 1, 1
if P1_2 = 1 then Action.GoToFrame "ID-1_2", 1, 1
if P1_3 = 1 then Action.GoToFrame "ID-1_3", 1, 1

This would be for player 1. Player 2's hotspot would be "P2_1 and ID-2", and player 3 "P3_1, ID-3" etc.

Individually they work perfectly. But if more than 1 player is "active", only the current player will work. All other hotspots seem like they are disabled and won't respond.
This doesn't make sense because EVERY player's variable is different. Is this a bug in AM?

Thanks in advance.
drdna
Member
 
Posts: 49
Joined: Fri Dec 29, 2006 10:16 pm

Postby ShadowHunter » Tue Jun 15, 2010 6:15 am

Hi,

Shouldn't you reset the other variables first before a another player starts? Make sure to use global variables...

If you use more than one frame point to the routine, not responding sounds like no code is behind it.

With best regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby drdna » Tue Jun 15, 2010 6:41 am

Hi Shadow, thanks for the reply.

I was in a hurry when I wrote the post so I probably wasn't clear on my project. I'm going to an event in a couple months where I always have a fun and twisted interactive adventure of sorts. AM has served me well.

This project is like a scavenger hunt, only the items the (Live) players must find are generated randomly. 10 players can be "active" at one time. As they find an item and turn it in, "their" screen advances. So, at any one given time, 10 different people can be on different things. This app keeps track of each player (and works beautifully except for this one bug) and what item they are on.

All their names are listed on the main screen (held in a variable "Player1, Player2, etc.) and when I click on their name, it goes to their current item screen (held by another variable).

The game works great all the way through. But, if I have more than one player, RANDOM hotspots go dead, except for the first name entered it seems. The coding is VERY simple. Mostly variable checks (if, then, else statements). I just had a friend double check my coding and even he says it's clean. I just can't find a error anywhere.

So, to directly answer you question.... No, I can't reset the other variables because it would reset the other players. I don't really understand your second line, however all code is in place. Each one works individually all the way through. It's only when others join in, and it's completely random which hotspots go dead. Sometimes half don't work, other times only one won't work. Frustrating! I'll keep working at it.
drdna
Member
 
Posts: 49
Joined: Fri Dec 29, 2006 10:16 pm

Postby drdna » Wed Jun 16, 2010 3:17 am

Wow! I just found out something that is completely baffling me. I have tested this for hours with definate results, but have no clue why.

I created 3 simple frames, with 1 master (similar to my game above). On each frame I set a variable upon entering the frame. The variables are PQ11, PQ21, and PQ31 respectively. Now, I have 3 hotspots on the main page, each going to the 3 frames. Upon entering each frame it changes the variable to 1 ( PQ11 = 1, PQ21 = 1, and PQ31 = 1 ). I click a blank hotspot on each page to go back to the main page. here's what happens:

I go to the first frame. Then click to go back. I check the VAR and it is a 1.
I go to the second frame and back. VAR is a 1 as it should be.
The third frame is the same.

However, I cannot go backwards!
I go to the third frame and back and it's a 1.
The second and first frame remains a 0.

It's consistant also. If the first frame is frame #2 it's ok. But if I go to #1, the VAR doesn't change. Then #3 will.

The variables will ONLY change if I go to them in order from 1st to last.

This doesn't make sense. ANY help would be appreciated.
drdna
Member
 
Posts: 49
Joined: Fri Dec 29, 2006 10:16 pm

Postby Mystery » Thu Jun 17, 2010 6:46 am

Hi drdna,

Would it be possible to provide us with that test project folder (that we could add in AM as project folder to test it) with the 3 frames and the master that you have described above?

Can you zip up this test project folder, and either attach it here, or provide it as download from somewhere else?

It would help me to better understand the problem :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby drdna » Fri Jun 18, 2010 3:25 am

I just found the problem I think. It was in this block of code, which was the initial button press:

sub inputcheck
If ID1 = 1 then Action.GoToFrame "Player1Q"
If ID2 = 1 then Action.GoToFrame "Player2Q"
If ID3 = 1 then Action.GoToFrame "Player3Q"
If ID4 = 1 then Action.GoToFrame "Player4Q"
If ID5 = 1 then Action.GoToFrame "Player5Q"
If ID6 = 1 then Action.GoToFrame "Player6Q"
If ID7 = 1 then Action.GoToFrame "Player7Q"
If ID8 = 1 then Action.GoToFrame "Player8Q"
If ID9 = 1 then Action.GoToFrame "Player9Q"
If ID10 = 1 then Action.GoToFrame "Player10Q"
End Sub

I still don't understand why it was doing what it was doing. I solved it by eliminating this block completely and adding each line to each button. Seems to work ok now. Whew!
drdna
Member
 
Posts: 49
Joined: Fri Dec 29, 2006 10:16 pm

Postby Mystery » Mon Jun 21, 2010 1:10 pm

Glad to hear that you figured it out - or better said found a workaround :)

Since I still cannot imagine exactly how it was set up, I don't know what your mistake might have been.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests