SetPlayer and 2 inventories Conundrum **SOLVED

Started by Joseph, Sat 15/05/2010 22:06:00

Previous topic - Next topic

Joseph

Ok, second question and last question of the day!

Im using a trick I found in the forums to fake 2 inventories for the same player (create a dummy character with its own inventory and scripting "InvWindow.CharacterToUse" +  "Character.SetAsPlayer" as needed).

The problem is this, however:

Say I switch the playable character to the dummy character to gain access to his inventory. I select an item in the dummy inventory, and return to the room. Cool, the mouse cursor has the right item cursor, and I can do interactions with it. BUT...when I go to walk, talk, look, etc...its still the dummy character, so my "real" main character doesnt move or do anything.

What I want to know is:

How do I change it back to the "real" main character without losing the dummy inv item I took from the dummy inventory?

What I though of trying but seems stupid (perhaps in rep_exec?):
Code: ags

	if (mouse.mode != 4)
	{
		if (player != cMainChar) cMainChar.SetAsPlayer();
	}


as in...if the mouse mode isnt an inventory item being used, set the player to my "real" main character (and not the dummy).

Is there a better way?

EDIT--->

Ok, I found a solution: in on_mouse_click
Code: ags

    if (mouse.Mode == eModeWalk)
    {
      if (player != cMainChar) cMainChar.SetAsPlayer();
    }


I just do that for all the mouse modes except the use inv.
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

SMF spam blocked by CleanTalk