Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Independent Menu for each playable character  (Read 3435 times)

0 Members and 1 Guest are viewing this topic.

Chaos

  • supporter
  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 45
  • "WME rocks!"
    • View Profile
Independent Menu for each playable character
« on: January 30, 2009, 09:04:05 AM »

Hi Wintermuties:

  I'd like to know if there is a way to make the Interactive Menu(Hand-Eye-Mouth) show a different set of sprites every time you switch between characters,according to the one you are currently playing.In my game I have two playable characters(a female,and a male)and my idea was that the Menu shows the hand,eye,and mouth of the one you selected. I've already put the animated sprites of the hand,eye,and mouth of the female character,but I still can't find a way to have two Menues.Also when I think of all the WME games I had played in the past ("FMA","Lotl","Dirty Split")in all of these adventures the Menu never changes,so I started to believe that there could only be one Interactive Menu,and now I am even thinking on discarding the idea and create a brand new generic Menu identical for both.I believe many surely had already tried this in case it is possible(it's not like inventing the wheel,is just a simple feature)and will have no trouble on helping me on this matter.Bye! ::wave   
« Last Edit: February 07, 2009, 05:46:05 AM by Chaos »
Logged

Net

  • Gripped Software Programmer
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • View Profile
    • Čurina
Re: Independent Menu for each playable character
« Reply #1 on: January 30, 2009, 01:34:40 PM »

I'm not really sure, but I think, you can make such menu style by adding some IF to game.script.

Exactly here:
Quote
// load the right-click menu
if(actor.gender == "male")
{
  global WinMenu = Game.LoadWindow("interface\menu\menu_male.window");
}
else
{
  global WinMenu = Game.LoadWindow("interface\menu\menu_female.window");
}

and you'll need to add to your actor.script variable gender, which says, what gender he/she is.

But, like I said, I'm not really sure, I made this from head :), that's only my opinion.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Independent Menu for each playable character
« Reply #2 on: January 31, 2009, 01:18:31 PM »

Something what Net suggests is probably the easiest way. There's probably some point in your game where you're switching the player character. At that point you can unload the old menu and load a new one. The unloading part is very important. You don't want to just keep loading new menus all the time, you must get rid of the old ones too.

Code: WME Script
  1. method SwitchPlayer(IsMale)
  2. {
  3.   global WinMenu;
  4.  
  5.   // if there already is some menu loaded, just destroy it
  6.   if(WinMenu != null) Game.UnloadObject(WinMenu);
  7.  
  8.   // and load a new one depending on the requested gender
  9.   if(IsMale) WinMenu = Game.LoadWindow("interface\menu\menu_male.window");
  10.   else WinMenu = Game.LoadWindow("interface\menu\menu_female.window");
  11.  
  12.   // and do some other stuff related to character switching, such as loading a different
  13.   // actor file, switching inventories etc.
  14.   // ...
  15. }
  16.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Chaos

  • supporter
  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 45
  • "WME rocks!"
    • View Profile
Re: Independent Menu for each playable character
« Reply #3 on: February 11, 2009, 07:32:39 AM »

Well,that's great!! ;D Thank you Net and Mnemonic for your most welcomed help!Yes,I understand very well the need to delete the previous Menu,it's exactly as when I set the script to create and attachment shadow for the actor every time the scene is loaded;you have to always delete the previous attachment,or you could end up having two shadows overlapping.Honestly,it was really important for the design of the game to have this feature,and now I'm very glad I finally have the answer so thank you again.Au revoir!!! 

P.S:In fact I believe now I could easily adapt this to have a 3rd character,an idea I'm considering right now.
« Last Edit: February 13, 2009, 05:02:58 AM by Chaos »
Logged
 

Page created in 0.029 seconds with 19 queries.