Point System Real Time Update?

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

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

Point System Real Time Update?

Postby Ikonz101 » Fri Sep 18, 2009 5:54 am

I just did the score tutorial and was wondering if there is a way to have real time update. For example when you click on a item it adds 10 points to your score and shows it instantly. In the tutorial it shows the score after you go to another frame.

Thank You
Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby Candle » Fri Sep 18, 2009 6:06 am

Just reload the frame and it is so fast they won't see it refresh.
Please don't PM me questions, ask here in the forums!
``````````````
Between grand theft and a legal fee, there only stands a law degree.
User avatar
Candle
Administrator
 
Posts: 3077
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Postby Ikonz101 » Fri Sep 18, 2009 6:29 am

Do I use the RefreshWindow command?

Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby mercedes » Fri Sep 18, 2009 7:09 am

Action.GetCurrentFrameName I gather..RefreshWindow is bug related normally....

But if u are wanting to add ten points to the counter..U can put in a hotspot
Counter = Counter + 10 --not sure if this is what u mean or not..~

Here are some useful tips to help guide u...Depending on what it is u are doing...u can pick from which command..:D

http://www.adventuremaker.com/help/vbscript_reference.htm
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Ikonz101 » Fri Sep 18, 2009 7:36 am

I was just wondering if the score would update without having to change frames. The score is also in the main project properties along with the time. So this is being increasingly difficult because of the global procedure that is needed for the time in each frame.

Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby mercedes » Fri Sep 18, 2009 9:11 am

Try that code where u want it...If they have to click a hotspot to get it to go up in time...then put that into the hotspot...It should raise it automatically..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Ikonz101 » Mon Sep 21, 2009 7:52 am

Nah I was trying to get the score to go up not the time. I am trying to make it so your score instantaneously and NOT every time you jump to a different frame. When you jump to a different frame it shows your score total but that makes it kinda weird for players. I followed the score tutorial and it said to put the score code into the Properties - Every Time A Frame Is Load section. I know this is what is causing it but it doesn't seem to work anywhere else I put the code.

Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby mercedes » Mon Sep 21, 2009 10:08 am

By now I'm assuming this is fixed..?

I see u say it worked...--in the other thread...

Nah I was trying to get the score to go up not the time


Obviously I meant the score.....it's what we've been dealing with...:lol: and I see u said it worked...? S'all good..?

I followed the score tutorial and it said to put the score code into the Properties - Every Time A Frame Is Load section. I know this is what is causing it but it doesn't seem to work anywhere else I put the code.


This should work in the frame's property as well...as Project properties...and yes that would be why it would appear on each frame..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Ikonz101 » Mon Sep 21, 2009 4:47 pm

It works but not like how I want it to. When you click on a item I want the score to be updated instantly not when you go to another frame.

Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby reneuend » Mon Sep 21, 2009 8:19 pm

If you want it instantly, you'll have to use the KeyGuard Plugin. Then detect the click event at the hotspot in question, and then update the score within the keyguard procedure for this frame. It's not as hard as it might sound. If you follow the documentation that comes with Keyguard as well as look at the code used in the demo that comes with it, you should be fine. Also, I might have a tutorial on it in the "tutorial" forum.

let me know if you have more questions on this.
---


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

Postby Ikonz101 » Mon Sep 21, 2009 11:24 pm

The score isn't a hotspot though it is a text. It is a merged frame with all other frames and is a global procedure as well. So I am not understanding how this would work at all. :D If I can get the score to update instantly I am finally on my way to completing the level design and then the game itself.

Thanks
Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby reneuend » Tue Sep 22, 2009 12:17 am

I think I understand now. I didn't read the entire thread!

If I understand correctly, you would like the score to update independent of everything. but how is the score activated in the first place? What causes the score to change? It can't be totally independent unless it's purely based on time.


The only way I know of running something independent would be to build a plugin specifically for this.
---


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

Postby Ikonz101 » Tue Sep 22, 2009 12:43 am

The score is activated when a frame loads (when you change rooms it shows the score update). It doesn't update automatically on the same frame. I used the score tutorial found in the FAQs to get this working. I tried to make it so that it would update instantly but it didn't work. So I might have to stick with the way it is now. Its just not convenient for the players not knowing their score instantly. This game is based on highscore and level completion system.

Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby reneuend » Tue Sep 22, 2009 12:50 am

Almost there, but not quite what I meant!

What does the player do to increase their score? This is where it needs to update the score. Is it based on amount of time?
---


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

Postby Ikonz101 » Tue Sep 22, 2009 1:13 am

Nope its not based on time (even though I would like the player to get a higher score if they finish the level fast). When a player collects a item or cash (this will be hotspot icons) the score will increase by a certain amount. The player doesn't see this certain amount until you go to another frame. So the player doesn't know their score instantly.

Ikonz101

P.S. That does give me a great idea for a time based score though. After the end of the level it would calculate how much time it took (if the time was less then 10:00 minutes then the player would get a time bonus of 30 or something).
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby reneuend » Tue Sep 22, 2009 1:32 am

Whatever hotspot the player clicks on should increment the score AND redisplay the score. Is your score displayed using a Text object? If so, just use Text(index).Caption = score. Where index is the correct index...probably 0 or 1, and the score is the updated score.
---


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

Postby Ikonz101 » Tue Sep 22, 2009 4:03 am

It works but the only problem is that when it adds the score it takes out the text Score: and replaces it with the score number 10. This is the code for the Score: part -

i = Action.GetMergedTextIndex
Text(2).Caption="Score: "+CStr(MYSCORE)

What I what it to do is place the score like this - Score: 10 (then the 10 updates depending on what other items you find) For example you find money worth 30 it would have Score: 30. Thank You very much I am so close to getting this.

Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby mercedes » Tue Sep 22, 2009 5:46 am

Then u would put the code lyberodoggy or I gave u ...If i understand this correctly in each hotspot..You have a few threads going here...so its making it hard to keep track of..But, if u want the score to increase +10 when they collect the money...put it in the money hotspot..?..

Are u still talking about the same thing...as the other thread..? or something entirely different..?
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Ikonz101 » Tue Sep 22, 2009 6:00 am

Yeah you got it right. When you collect the money it adds +10 to the score. I have it in the money hotspot. But it replaces the Score: text field with 0 when it is collect (clicked on).

Ikonz101

Ok I got the numbers to display instantly but now they aren't adding up each other. They are just replacing each other. I have one item that is worth 10 points and the other is worth 30 points. I click on the 10 item first and it displays the 10 on the Score: 10. When I click on the 30 its replaces the 10 with Score: 30. It doesn't add them up. This is the code I am using. I have this code in both hotspots (except the 30 is replaced with a 10 on the other hotspot)

i = Action.GetMergedTextIndex
Text(2).Caption="Score: "+CStr(MYSCORE)

MYSCORE = MYSCORE + 30

EDIT: (UPDATE) When I click on the 30 point item it doesn't show up but when I click on the 10 point item it displays the 30 point number. Confusing. I know its a simple fix I am just not seeing.

Ikonz101
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby reneuend » Tue Sep 22, 2009 4:01 pm

to add them up they need to be the same variable:

MyScore = 10

Click to add 10:

MyScore = MyScore + 10

click to add 30:

MyScore = MyScore + 30


Be sure to redisplay the updated score AFTER adding the new count!!!!
---


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

Postby mercedes » Tue Sep 22, 2009 5:47 pm

You were using Counter as the variable..that might be why it wasn't working..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Ikonz101 » Tue Sep 22, 2009 8:30 pm

Counter was used for the time limit. I posted a few topics in that thread regarding score. I apologize for this mistake.

Ikonz101

UPDATE: IT WORKED!!! JUST HAD THE CODE IN THE WRONG ORDER!!! THANK YOU ALL FOR YOUR HELP!!
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests