Use pictures only once?

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

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

Use pictures only once?

Postby Netjera » Sun Jan 24, 2010 8:54 am

Greetings,

I was wondering if there was any way to check use on a picture? For example, let's say I wanted to randomly show a sequence of 30 pictures in hotspots, but I wanted to only show each picture once, what's the best way to keep track of the pictures, and then to check to see if any of them have been used already?

I tried putting values into an array, but then I couldn't figure out how to link it to the pictures themselves. I'm wondering if I'm over complicating, and if there's actually a way to do this without scripting. (I'm far from the best coder. >.< ) I also contemplated somehow deleting or disabling each picture, but then I was concerned that if someone wanted to restart the game, they wouldn't be there, or would have to be reloaded. I'm a bit confused, if you can't tell. =D

Thanks!

Oh! Forgot to ask - also is there any way to check to see what picture is loaded into a hotspot (NOT a frame)? I couldn't find a "GetPicture.." or something similar. >.<
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States

Postby Lyberodoggy » Sun Jan 24, 2010 1:16 pm

The way I 'd go is
create a variant variable named photosused
use the code
photosused=photosused+";"+filename
each time a file is loaded on a hotspot
then check if the file had been loaded again using
phar=split(photosused,";")
used=0
for i=0 to ubound(phar)
if phar(i)=filename then
used=1
end if
next
if used=0 then
loadapicture hotspot(num), filename
end if
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Netjera » Sun Jan 24, 2010 3:52 pm

Thanks for the reply! I've been pulling my hair out over this. I'm not sure I'm understanding what's going on in your code. (As I said, I'm not a really good coder, lol.)

Are you concatenating a variable with photoUsed and the picture name as the variable?

UBound, isn't that something you use with arrays? So I'd still need to use an array with this?

I've been poring over VBScript docs for days, and they really don't explain stuff very well. I always feel like I'm trying to read Cyrillic or something. First I have to figure out which symbol I'm looking at, then I need to pick apart they symbols to figure out what's going on. The only stuff I could find on arrays was how to declare them: SomeName = Array(someStuff, someMoreStuff, anotherValue, etc..)

Anyways, thanks for the help and sorry about the confusion. >.<

P.S. - I had intended to post a request for this in the tutorial thread, but I guess hit "New Topic" instead of "Reply", since my post wound up out here.
User avatar
Netjera
Frequent Poster
 
Posts: 127
Joined: Sun Jan 24, 2010 8:48 am
Location: United States


Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

cron