Inventory item close-up problem

Started by Grim, Sun 30/09/2007 11:21:20

Previous topic - Next topic

Grim

I have a problem.
In my game character picks up few items which require closer look and looking at them in the inventory should preferably show different room with a close-up of the item. BUT- how do I make character go back to the previous room where he was before he examined that item? Because item can be looked at at any point in the game. I'm sure it can be easily done but I just can't find it in help index. If someone could help me out with the correct scripting I'd be very grateful.

Rui 'Trovatore' Pires

Character PreviousRoom property.

player.ChangeRoom(player.PreviousRoom);

Give or take whatever fine detail, like maybe the actual function's name, I'm forgetting.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Ashen

#2
Damn, beaten to it...

You might need to add some variables to store the player's position before changing rooms - I'm not sure how it'll interact with scrolling rooms otherwise - but Rui's pretty much nailed it. A forum search for 'previous room' should turn up a load of answers, if you're not sure about adding the variables.

(Shouldn't this be in Beginners Tech?)

EDIT after Rui's post below:
You're probably right. I'm pretty sure it won't be necesary to store the coords if the player can't move in the Item room (where they'll most likely be hidden anyway), but I wasn't certain, and couldn't be bothered checking ;)
I know what you're thinking ... Don't think that.

Rui 'Trovatore' Pires

Hopefully he shouldn't have to store too much - just check "Hide Player Character" in the closeup room. That way, when he closes-up he'll remain at the same coordinates. Shouldn't make a difference with scrolling room, should it? Characters can be placed outside the boundaries of the room.

(Sure it should. :) )
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Grim

That's great, thanks guys. I can do some things using scripting but this one was a tough one for me. Kudos for that.

SMF spam blocked by CleanTalk