Help with Inventory

Talk about making games.

Help with Inventory

Postby ALK3_Steph » Tue Oct 04, 2005 10:55 pm

Hello all! Ok new problem involving view. I want to make an inventory screen (Im not worried about coding for picking things up, using them, etc, just how to change the view)

So far, the player is parent to the view, so ti follows him in a fixed position. I want to hit the ' I ' key, and it switch to a screen that will show various things. So I tried to make a key down event for ' I ' and change the parent of view, to inventory, but it didnt work. Is there a special way I need to do this?
"Take your wings outside, you cant fly in here, besides purple skies are betting soaring for you my angel, you're an angel, you little devil. As for me I'll be just fine as I stay inside and watch from the window" -Alkaline Trio (Goodbye Forever)
ALK3_Steph
 
Posts: 27
Joined: Sat Sep 10, 2005 2:40 am
Location: Norfolk, VA
Score: 0 Give a positive score

Postby Joshua Worth » Tue Oct 04, 2005 11:52 pm

Try somthing like this on your key down event:
Code: Select all
if (inventory_on==1){inventory_on=0;)
if (inventory_on==0){inventory_on=1;)
if (inventory_on==1) {
  ChangeParent("view", "inventoryscreen");
  view.x=inventoryscreen.x;
  view.y=inventoryscreen.y;
                     }
                     
if (inventory_on==0) {
  ChangeParent("view", "player");
  view.x=player.x;
  view.y=player.y;
                     }
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby Joshua Worth » Sun Oct 09, 2005 5:07 am

Did you try it, did it work?
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby ALK3_Steph » Mon Oct 10, 2005 2:01 pm

OH! Sorry I didnt reply. I havent tried it yet, because my trial ran out and I gotta wait til Friday (payday, woo!) then I get it and give it another try. I WILL keep you posted on this one
"Take your wings outside, you cant fly in here, besides purple skies are betting soaring for you my angel, you're an angel, you little devil. As for me I'll be just fine as I stay inside and watch from the window" -Alkaline Trio (Goodbye Forever)
ALK3_Steph
 
Posts: 27
Joined: Sat Sep 10, 2005 2:40 am
Location: Norfolk, VA
Score: 0 Give a positive score

Postby Joshua Worth » Tue Oct 11, 2005 5:57 am

OK
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby ondy1985 » Tue Oct 11, 2005 7:46 pm

Joshua Worth wrote:Try somthing like this on your key down event:
Code: Select all
if (inventory_on==1){inventory_on=0;)
if (inventory_on==0){inventory_on=1;)
if (inventory_on==1) {
  ChangeParent("view", "inventoryscreen");
  view.x=inventoryscreen.x;
  view.y=inventoryscreen.y;
                     }
                     
if (inventory_on==0) {
  ChangeParent("view", "player");
  view.x=player.x;
  view.y=player.y;
                     }

Imho this WILL NOT work. Not correctly. The last "inventory_on==0" branch will never be executed.
Image

Motto: "I never let my schooling interfere with my education" --- Mark Twain
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby ALK3_Steph » Wed Oct 12, 2005 12:33 am

Oh, why not? I dont fully understand the code or the whole statement so, could you explain more why it wont?
"Take your wings outside, you cant fly in here, besides purple skies are betting soaring for you my angel, you're an angel, you little devil. As for me I'll be just fine as I stay inside and watch from the window" -Alkaline Trio (Goodbye Forever)
ALK3_Steph
 
Posts: 27
Joined: Sat Sep 10, 2005 2:40 am
Location: Norfolk, VA
Score: 0 Give a positive score

Postby Joshua Worth » Wed Oct 12, 2005 3:31 am

Right :oops: I didn't think of that. You might have to set another variable to skip the second line :roll:
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby ALK3_Steph » Sat Oct 15, 2005 2:43 am

Woo Im official. Haha
"Take your wings outside, you cant fly in here, besides purple skies are betting soaring for you my angel, you're an angel, you little devil. As for me I'll be just fine as I stay inside and watch from the window" -Alkaline Trio (Goodbye Forever)
ALK3_Steph
 
Posts: 27
Joined: Sat Sep 10, 2005 2:40 am
Location: Norfolk, VA
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron