TEMPLATE: SCUMM VERBCOIN GUI v1.2 (for AGS 3.0 only)

Started by Electroshokker, Thu 06/07/2006 10:57:40

Previous topic - Next topic

Electroshokker

Hi there, guys.

Seeing as a bunch of you guys probably want this, I transformed the global script of our game to an easy to use module.

Initially called Enhanced Verbcoin module, I've since redesigned it so it can do so, so much more. See the PDF for a description of it's functionality and all changes.

EDIT: This module is outdated. There is a brand-new template (for AGS 3.0) which has full functionality and pretty much all issues sorted out.

See http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32745.0

SSH

Why not save out GUE files (Export single GUI menu options) so people don't ahve to follow instructions to recreate them?

Also, what version of AGS is required?
12

strazer

Quote from: storyteller on Thu 06/07/2006 10:57:40This module is made for a game resolution of 640x480. If you want to use it in another game resolution, you'll have to alter the module script.

I'm pretty sure you can update it yourself to make it work in all resolutions. Check out the system.viewport_width/_height and system.screen_width/_height variables.

jasonjkay

Wouldnt a template version of this be better? Anyway i'll add it to my site.
http://www.americangirlscouts.org/agsresources/ - Mods, plugins and templates.

Electroshokker

#4
Ok, thanks for the suggestions.

I'll get right on it.

Oh, and: I made it with AGS v2.72RC2a, though it should also work with v2.71.

EDIT: label.SetText no longer works in v2.72final

The next releases will be made for AGS v2.72 final only.

Radiant


Electroshokker

#6
Quote from: Radiant on Thu 06/07/2006 15:07:50
Does it have keyboard support?

from v1.0a basic keyboard support is included. There's still a bug which gets you stuck after a player.Say function is called in the inventory. Apparently, pressing any key won't work, only a mouseclick continues the game.

Don't know if this is a bug in the module or in the game engine.

Anyways, I'll see if I can find a way to fix this.

EDIT: nope, can't seem to fix it.

v1.0c is up now. I added an optional bool to the functions so you can get a full replace of action text

example: instead of "Read Plaque" with Plaque being the hotspot name, you can now "Read Inscription" if you set the bool to true

I think the module now has all the functionality it needs.

Alynn


Electroshokker

Quote from: Alynn on Mon 17/07/2006 21:25:47
Is there any way to have more than 4 interactions?

There are currently only 3 buttons on a verbcoin, with the 'interact' button having different standard named actions in regular scenes and inventory.

(pick up in a scene, use in inventory => both give the 'interact' response)

Now, if you want more then those 4 interactions, it depends on wether you want more buttons on a verbcoin, or simply another action for an existing button.

The custom_ functions (see the header) can be used to change the standard action that is shown when moving the mouse over a button.

simply add a script name to a hotspot/object/... and some code like this in a room's repeatedly execute script:

Code: ags
 if(gGui3.Visible == false){
		if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hmonkey){
			custom_look("Read");  
		}
		if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hbed){
			custom_pick_up("Go To Sleep",true);
		}
		if (Character.GetAtScreenXY(mouse.x,mouse.y) == cMurray){
			custom_talk("Chat with");
		}
	}
	else{
	  if(InventoryItem.GetAtScreenXY(mouse.x,mouse.y) == irum){
	    custom_talk("Drink from");
	  }
	}


This only changes the action names which pop up on the label gui. All actions are still look at, talk to and interact, but with other action names. (Hey, if you want to change all talk to actions to 'push' actions, you can. As long as you customize all action names and don't forget to set your script response under 'talk to')

If you want more buttons on the verbcoin, then the module won't do. It's designed for a 3-button verbcoin. (Never saw any need for more)

Hope this answers your question.

Phemar

I think I found an error in your template.

If you bring up the verb-coin and then move your mouse away from the coin while holding in the mouse button everything just freezes and the only way to fix it is by right clicking.

You should probably just check to see if the mouse is over the gui and if not then to switch it off.

Easy stuff ;)

Alynn

Well the reason I was asking is I have 9 different cursor modes of which 6 would have to be on the GUI. It's ok though If I feel like making my own I will, but if not I'll just stick with the verb bar at the bottom.

Thanks

Electroshokker

Ok, a lot's happened since I first posted this module/template.

changes I'm working on for v1.1:

- create as many popup verbgui's as you like, customize how they should be called upon (left-click, right-click, keyboard button), or even when.
- add as many buttons as you like to the popup verbthingy => write your own custom response to them or set them to standard actions like interact, talkto, ...!!!
- special commands to set which gui is which (guis no longer fixed to certain names/numbers)
- fixes for all those little bugs that don't break the game but are just plain annoying


multipurpose, multiple possibilities: create entirely new popup gui systems the way you like in minutes!!!

...Well, that's the plan anyways. I got several things figured out already, but it'll be a while before it's finished.

Candle


Janik

Great module, but I think I've found a bug, of sorts...

When using the verb coin on an item in the inventory, the whole inventory GUI gets hidden for a second while the interaction runs. That is fine when using player.say(), but it is distracting when using Display(), which could simply be overlaid on top of the GUI.

The interesting thing is that I made some modifications to the code so that right-clicking an item shows the description. The code is in "on_event" and I use "item.RunInteraction". In that case, right-clicking simply displays the text and does not hide the GUI. However, the same interaction run with the verbcoin (on the look button), does hide the GUI, as do all other interaction, whether or not they are .Say() or Display().

Any ideas how to avoid that?
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

Electroshokker

Oh boy. Sorry for the late reply, guys, but with all the recent events (job, moving, ...) and continuing to work on our game (now called: MI - The Lost Years), I've been too busy to get any work done on improving this module.

Once all the crazyness is over and the dust settles I'll get back on it, though. (probably in a month or two)

@Janik: it's a known bug, and I'll fix it in the next version. If you still haven't fixed it yourself by now, lemme know, and I'll take a look at it first chance I get.

joelphilippage

ive got a problem with the enhanced verbcoin module. I tried running it in 800 by 600 and the verbcoin always pops up in the top lefthand corner.



Electroshokker

Quote from: joelphilippage on Sun 28/01/2007 20:28:36
ive got a problem with the enhanced verbcoin module. I tried running it in 800 by 600 and the verbcoin always pops up in the top lefthand corner.

That's odd. How large is your verbcoin? (or are you trying to run the template in 800*600 without replacing the graphics, in which case you would indeed experience problems)

(And btw, I've started working on this thing again. I hope to have some of the promised features done very soon.)

joelphilippage

My verb coin is 85 by 75 pixels. I have replaced the graphics with my own.



Electroshokker

Quote from: joelphilippage on Fri 02/02/2007 21:58:55
My verb coin is 85 by 75 pixels. I have replaced the graphics with my own.

Ok, I see the problem. (Just tested it) I'll put a patch for the template/module code up sometime this weekend, to quickfix some of these obvious bugs.

quick solution to your problem:

remove the following lines out of the module script:

Code: ags
if(System.ViewportHeight == 200){


Code: ags
else if(System.ViewportHeight == 240){									
			verbc_border_x = 259;
			verbc_border_y = 179;
		}


and change the verbc_borders to:

Code: ags
verbc_border_x = 339;
verbc_border_y = 239;


and everything should work (tried it with a verbcoin of 120x120, you might have to move the verbc_borders a little by increasing these values.

Electroshokker

#19
For the viewport issues:

I'm planning to replace the viewport readouts by the room edges.

So once you've defined the edges of a room the verbcoin will only show INSIDE these edges, which should resolve ALL of these verbcoin positioning problems. (But you will be required to properly set the edges in all rooms)

this is how it works:

Code: ags
function on_event (int event, int data) {
  if (event==eEventEnterRoomBeforeFadein){			
			verbc_border_x = Room.RightEdge - gGui2.Width;
			verbc_border_y = Room.BottomEdge - gGui2.Height;
  }


other simplification/bug fix I'm working on is to replace the repeatedly_execute section for custom interactions with element properties.

EDIT: the new version 1.0e is out, featuring:

- custom_interaction properties instead of having to put code in your room's repeatedly_execute script!
- the "act" bool property, which, when set,  triggers an immediate eInteract response, instead of calling the verbcoin
- no more bugs related to game resolution!

enjoy!

(note: I am no longer supporting the old template at this time. I'm going to make a new one alltogether, using a different graphics once I got all the features for v1.1 all worked out.)

SMF spam blocked by CleanTalk