How to code collecting items e.g. You have collected 1/3 items

Hi,

I am in the middle of writing a chapter of my story where you have to collect 3 items. I was wondering how I might code this, obviously I use the reader message bar at the top of the screen to notify the reader that they have collected an item. But how would I code it to say for example: You have collected 1/3 items, 2/3 items, 3/3 items. The issue is, the reader can choose in which order they collect them so I cannot just write it if that makes sense as they may have already collected 2/3 for example before they collect the last one (which other readers may have collected first)

I wanted it so that once all three items had been collected they can continue with the story, but I’m not sure how to code it to be table to tell when they’ve collected them all!

Sorry if this doesn’t make sense, it’s pretty hard to explain.
I’ve thought about using gains, but again not sure how this would work with multiple items being collected in different orders.

Stumped trying to figure it out!

You can use the point system for this. Create characters for each one. For example. A character named ITEMS and when they have collected it, underneath in the script put
@ITEMS +1
At the end, use the if/elif/else to determine how many the have
If (ITEMS =1){
NARRATOR
You have collected 1 item.
}elif (ITEMS =2){
NARRATOR
You have collected 2 items.
}elif(ITEMS =3){
NARRATOR
You have collected all 3 items.
}else{
NARRATOR
You haven’t collected any items.
}

Hope that helps :blush:

1 Like

It’s a little confusing to me haha!

So for example I have the main scene, where they tap on an overlay which will take them to a certain scene e.g. the woods, a cabin or a rock pool.

After they have collected an item from each of those scenes how would I code this so that once they have collected all of them they proceed to a different scene instead of going back to the main screen?

With labels (@Jade.epi I use your example)

@ITEMS =0

ADD OVERLAYS HERE

label collect_items

tappable
“ITEM1”{

@ITEMS +1

@overlay ITEM1 clear

goto already_done

}“ITEM2”{

@ITEMS +1

@overlay ITEM2 clear

goto already_done

}“ITEM3”{

@ITEMS +1

@overlay ITEM3 clear

goto already_done

}

label already_done

If (ITEMS =1){
NARRATOR
You have collected 1 item.

goto collect_items
}elif (ITEMS =2){
NARRATOR
You have collected 2 items.

goto collect_items
}elif(ITEMS =3){
NARRATOR
You have collected all 3 items.

goto done
}else{
NARRATOR
You haven’t collected any items.

goto collect_items
}

label done

1 Like

I’ve done it! thanks guys!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.