How to Get the Verbcoin to Show Only Available Options

Started by parmeisan, Sat 18/02/2012 23:24:10

Previous topic - Next topic

parmeisan

OK, I wouldn't be surprised if the answer exists elsewhere on this forum, but I couldn't find it, so what's the harm in adding one more thread that people might find depending what they try searching by?  (Also, it seems to me that this better belongs in the modules/plugins forum, but I can't seem to post there, so mods, feel free to move it without comment if you agree).


First, split up your Verbcoin images so that the background of gVerbcoin is the base only (ie, no hand, eye, etc).  HOWEVER, even if this base image will never change, you must still have multiple sprites for it, and set them in GlobalScript.asc, because the Verbcoin code uses the sprite number to identify which option the player has selected.  Now, edit interact_button/look_button/etc to have Image, MouseOverImage, and PushedImage set to your icons.

Now, In order to make these icons visible (and therefore selectable) only when they need to be, (ie when you've attached a function that does something when they choose it), you'll need to find the following in SCUMM Verbcoin GUI.asc:

Code: ags

          // ok, now activate the gui
          gui[verbc_id].SetPosition(guix, guiy);	// put the verbcompass on the right spot
          gui[verbc_id].BackgroundGraphic = verbgraphic_button0;  
          gui[verbc_id].Visible = true;						// activate


And add some lines immediately afterward, as necessary for your application (mine uses the custom interaction for a PickUp action, yours may not):

Code: ags

	interact_button.Visible = IsInteractionAvailable(mouse.x, mouse.y, eModeInteract);
	look_button.Visible = IsInteractionAvailable(mouse.x, mouse.y, eModeLookat);
	custom_button1.Visible = IsInteractionAvailable(mouse.x, mouse.y, eModeUsermode1);
	talk_button.Visible = IsInteractionAvailable(mouse.x, mouse.y, eModeTalkto);


That's it!  Enjoy.

SMF spam blocked by CleanTalk