Post by patriotadamrogers on Jul 16, 2012 14:11:50 GMT -8
Hey everybody. I have a simple question, but one I can not seem to figure out. I am working on a game based on bartering, (i.e. you need a knife. NPC 1 has a knife, but you need to trade him a hamburger for it. So NPC 2 has a hamburger, and you barter for that, etc.) like the classic (for me anyway) Cartoon Cartoon Summer Resort games Cartoon network ran a few years back. I made a Sim a while back based on this, but the player just had to remember which items he/she had because I couldn't figure out the Inventory.
I want to have an inventory system that would show which items you have. It is a simple enough idea. Even the most basic text adventure game has it. My main character (Wally) is in the Follow Me, so I have the Inventory rule moving to an Inventory scene, while removing Wally from Follow Me. It works, and shows me my Inventory (which will be controlled by Global Variables, easy enough), but I can't figure out how to return to the scene you left from. I figured if I could get Wally back in the Follow Me, it would work, but he is not on the Inventory Screen and therefore can't be included in the Return rule.
There is probably an easy fix for this I am overlooking, but I have racked my brain and can't come up with it. Does anyone have an idea on how I could make this work? I appreciate it. Thanks!
Post by BusterTheFox on Jul 20, 2012 15:51:18 GMT -8
Welcome to the forum!
I'm not sure I understand it completely, so I think it goes like this:
The player is playing the game, moving Wally around, etc. The player presses a key and opens a menu that shows what items they have You get stuck trying to figure out how to return from that menu.
If that's what's happening, you can try this:
Make a new Global variable. Make a rule on Wally: IF (The new global variable) IS NOT (The stage Wally is on) THEN Put (The stage Wally is on) into (global variable) keep this at the top of his rule list so it happens as soon as it needs to. This should copy the name of the stage Wally's on into that variable.
Next, when making the rule for leaving the inventory screen, utilize that new variable: IF (whatever key is pressed, character is clicked, whatever) THEN Switch stage to (global variable) OR, since you said something about having another character in the Follow Me: PUT (Global Variable) into "Inventory"'s stage
To do the Switch Stage thing, just drag a new stage onto the game window while making the rule. Then you can delete the stage out of there and put in the Global Variable. The Switch Stage function works for just names, too, so it'll switch properly.
Also, if you did the above, you'll probably have to make a rule that says "If Wally is not in the Follow Me, Put Wally into the Follow Me". This'll get the game to start following him again.
If you don't understand that stuff, I can make a demonstration for you. Or you could upload the .sim file and I could edit it for you.