Text Stay Disappeared?

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

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

Text Stay Disappeared?

Postby Ikonz101 » Mon Sep 28, 2009 6:34 am

I have this text that is a variable for a item that is the most valuable within the level. When you find that item it changes the variable text to "Found". The only problem I am having is that when you switch frames it goes make to the name of the item not the text "Found". Can anyone help me fix this?

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

Postby reneuend » Mon Sep 28, 2009 7:54 am

The issue you are trying to explain is a bit confusing.

Did you create a string variable? If so, what is the name of the variable?
Did you set this variable = "Found"?

What are you setting in the next frame to set the variable? What kind of object is getting affected in the second frame? Is it an inventory item? or a hotspot?

Please try to be very specific so we can understand. It would help if you explain what in AM you are setting exactly.

Thanks!
---


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

Postby Ikonz101 » Mon Sep 28, 2009 1:31 pm

The name of the variable is MVI (Most Valuable Item). I set the variable to the name of the item to be found. When that item (a hotspot) is clicked on it changes the name of the item (variable) to the text "Found". But when you click to go to the next frame (room) it changes the variable MVI (Most Valuable Item) to the name of the item to be found instead of keeping it as "Found". I believe that has something to do with where the code is being placed in AM. The reason I made this variable is so that I can change the MVI (Most Valuable Item) in each level easily. I hope this explains it more in detail.

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

Postby Imari » Mon Sep 28, 2009 2:03 pm

I'm not sure I understand and you've probably already thought of this, but...

How about just making separate variables for each Most Valuable Item(MVI1, MVI2, etc.)? Then, when the hotspot is clicked, remove the original hotspot permanently and change the variable to "Found" for each variable.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Mon Sep 28, 2009 4:28 pm

Does this look like what you are doing? I'm wondering where and when you set the MVI variable to be the name of the item.

'Create a global String Variable with name, MVI

Frame1
---------------------
Properties:
MVI = "Item1"

hotspot:
MVI = "Found"

another hotspot to go to another frame:
Action.GoToFrame "Frame2"
---


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

Postby Ikonz101 » Mon Sep 28, 2009 10:37 pm

I set the variable MVI in a merged frame as text not hotspot. The merged frame contains the score, time countdown, and how much score you need to obtain to go to the next level. Under the item that needs to be collected (hotspot) I put the code:

Text(7) = "Found" (Text 7 is MVI variable)

Under Frame Properties I put:

i = Action.GetMergedTextIndex
Text(7).Caption= "Rare Lamp" (This is what you see when the frame loads and when you find the item it changes to "Found")

But when you click to go to the next frame it changes back to "Rare Lamp" and doesn't stay as "Found". I know I am putting the code in the wrong spot somewhere. I made it this way so I can easily change the Most Valuable Item. So I made MVI variable as text and not a hotspot. All I want to do is change the text and keep it as "Found" when the item is found. And when you finish the level and go to the next level I can change the MVI variable to another item for example "Rare Stamp" or something else.

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

Postby Ikonz101 » Thu Oct 01, 2009 1:38 am

Still haven't figured it out so it anyone has a idea plz let me know.

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

Postby reneuend » Thu Oct 01, 2009 1:49 am

Ikonz101 wrote:I set the variable MVI in a merged frame as text not hotspot. The merged frame contains the score, time countdown, and how much score you need to obtain to go to the next level. Under the item that needs to be collected (hotspot) I put the code:

Text(7) = "Found" (Text 7 is MVI variable)

Under Frame Properties I put:

i = Action.GetMergedTextIndex
Text(7).Caption= "Rare Lamp" (This is what you see when the frame loads and when you find the item it changes to "Found")

But when you click to go to the next frame it changes back to "Rare Lamp" and doesn't stay as "Found". I know I am putting the code in the wrong spot somewhere. I made it this way so I can easily change the Most Valuable Item. So I made MVI variable as text and not a hotspot. All I want to do is change the text and keep it as "Found" when the item is found. And when you finish the level and go to the next level I can change the MVI variable to another item for example "Rare Stamp" or something else.

Thank You
Ikonz101



Text(7) isn't a variable. It's a text object.

You should set and maintain a separate variable for controlling the status of this text object or just check the value that the text object contains.

If you enter the frame with text(7).caption = "Rare Lamp" then every time you enter that frame it will be set to this text.

Since it appears you want to display "Found", here is what you need to do:

Code: Select all

If text(7).caption <> "Found" then
    text(7).caption = "Rare Lamp"
End If


This code should replace where you put the text(7).caption = "Rare Lamp" in the frame properties. Basically, you're checking if the caption has been set to Found. If it hasn't, then you display "Rare Lamp".

Hope this helps. :)
---


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

Postby Ikonz101 » Thu Oct 01, 2009 8:59 am

It works but the only problem now is that when I go back to a frame using go to last frame visited it changes it back to "Rare Lamp". I even put the code into the hotspot that takes you back to the last frame visited.

Thank You
Ikonz101

P.S. Actually its not working at all. I put this code into the Frames Properties but for some reason it isn't recognizing any of the code. The text is changed on a merged frame. Would that have anything to do with it? The merged frame is used in all the frames for the score, time countdown, etc., etc. When I click on the item (hotspot) to be found it changes the text to found but after that it doesn't stay the same.

This is the code I have when the 1st frame is loaded (frame properties):

i = Action.GetMergedTextIndex
If text(6).caption <> "Found" then
text(6).caption = "Rare Lamp"
End If

(I changed the text to 6 cause I got rid of another text object)

This is the code I have when you click on the Most Valuable Item to be found:

i = Action.GetMergedTextIndex
Text(6).caption = "Found"

This is the code I have when you go to the next frame in the frame properties:

i = Action.GetMergedTextIndex
If text(6).caption <> "Found" then
text(6).caption = "Rare Lamp"
End If

It almost seems like it isn't calculating the code to see if the text is set to "Found"
User avatar
Ikonz101
Frequent Poster
 
Posts: 128
Joined: Wed Nov 28, 2007 11:23 pm

Postby reneuend » Thu Oct 01, 2009 1:57 pm

Try this:
Create an integer variable. I'm going to call it "Status" in this example.
When you create an integer variable, the default value = 0.

This is the code I have when the 1st frame is loaded (frame properties):

'First Frame - Advanced Properties

i = Action.GetMergedTextIndex

If Status = 1 then
text(6).caption = "Found"
Else
text(6).caption = "Rare Lamp"
End If


This is the code I have when you click on the Most Valuable Item to be found:
NOTE: Don't forget to set Status = 1 !!!!!!!!!

i = Action.GetMergedTextIndex
Text(6).caption = "Found"
Status = 1


This is the code I have when you go to the next frame in the frame properties:

i = Action.GetMergedTextIndex
If Status = 1 then
text(6).caption = "Found"
Else
text(6).caption = "Rare Lamp"
End If
---


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

Postby Ikonz101 » Thu Oct 01, 2009 4:03 pm

I am away from my PC right now but will definitely try when I get home. I do want to thank you for taking the time out to help me with the scripting aspect of AM. This community has been nothing less then great when it comes to helping and I do appreciate this greatly.

Thank You
Ikonz101

P.S. IT WORKED!!! THANK YOU AGAIN VERY MUCH!!!
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

cron