Jibble

Author Topic: TEMPLATE: SCUMM VERBCOIN GUI v1.2 (for AGS 3.0 only)  (Read 10755 times)

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
« Last Edit: 01 Dec 2007, 10:18 by Electroshokker »

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    • SSH worked on a game that won an AGS Award!
    •  
    • SSH worked on a game that was nominated for an AGS Award!
Re: MODULE: Enhanced Verbcoin Gui v1.0 (Think CMI)
« Reply #1 on: 06 Jul 2006, 11:14 »
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?

Re: MODULE: Enhanced Verbcoin Gui v1.0 (Think CMI)
« Reply #2 on: 06 Jul 2006, 11:26 »
This 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.

Re: MODULE: Enhanced Verbcoin Gui v1.0 (Think CMI)
« Reply #3 on: 06 Jul 2006, 11:50 »
Wouldnt a template version of this be better? Anyway i'll add it to my site.

Re: MODULE: Enhanced Verbcoin Gui v1.0 (Think CMI)
« Reply #4 on: 06 Jul 2006, 12:33 »
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.
« Last Edit: 06 Jul 2006, 13:26 by storyteller »

Radiant

  • Return once more to the Two Kingdoms!
    • I can help with publishing
    • I can help with story design
    • Radiant worked on a game that won an AGS Award!
    •  
    • Radiant worked on a game that was nominated for an AGS Award!
Re: MODULE: Enhanced Verbcoin Gui v1.0 (Think CMI)
« Reply #5 on: 06 Jul 2006, 15:07 »
Does it have keyboard support?

MODULE (+ TEMPLATE): Enhanced Verbcoin Gui v1.0a (Think CMI)
« Reply #6 on: 07 Jul 2006, 09:56 »
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.
« Last Edit: 07 Jul 2006, 15:02 by storyteller »

Alynn

  • I'm ugly because I'm pixelated, what's your excuse
    • I can help with scripting
Is there any way to have more than 4 interactions?

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: [Select]
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.

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

  • I'm ugly because I'm pixelated, what's your excuse
    • I can help with scripting
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

Re: MODULE: Popup VerbGui v1.1 (The Sky's the limit)
« Reply #11 on: 06 Oct 2006, 12:08 »
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

  • Truly Hated
Looking forward to it.

Janik

  • (Working on a RON game (sort of) )
    • I can help with play testing
    • I can help with scripting
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!

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.

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.



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.)

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



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: [Select]
if(System.ViewportHeight == 200){
Code: [Select]
else if(System.ViewportHeight == 240){
verbc_border_x = 259;
verbc_border_y = 179;
}

and change the verbc_borders to:

Code: [Select]
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.
« Last Edit: 03 Feb 2007, 10:15 by MI - TLY »

Re: MODULE: Enhanced Verbcoin Gui v1.0e *updated*
« Reply #19 on: 03 Feb 2007, 10:24 »
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: [Select]
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.)
« Last Edit: 03 Feb 2007, 13:13 by MI - TLY »

Oh boy, looks like a few new bugs crept in...

I'm in the process of fixin' them (almost done, will upload soon), but it still has the display text closes inventory bug (even more so, since now for some reason it won't automatically close the inventory guis but gets stuck. only workaround I see is to scrip the closing of the guis, OR just ditch the entire gui label code, as I suspect the two are linked.)

Anyways, I'll upload the "fixed" version soon, and continue to look into this display bug.

EDIT:

In order to get "cleaner" code, I decided to split up the module in two seperate modules, one for the basic interface (inventory gui, verbcoin) and another for the gui-label.

This should make the code more manageable and easier to fix (I hope).
« Last Edit: 04 Feb 2007, 17:03 by MI - TLY »

Re: MODULE: Enhanced Verbcoin Gui v1.0e *updated*
« Reply #21 on: 27 Apr 2007, 04:29 »
Im getting a problem. I am trying to make the cursor change to an arrow when the mouse moves over an exit and it turns back to the walking cursor if I stop moving the mouse while it's over the exit. also the verb coin still shows up when I hold down the mouse button over the hotspot.
here is my script:
Code: [Select]
function hotspot3_a() {
  // script for Hotspot 3 (Go Outside): Mouse moves over hotspot
mouse.DisableMode(eModeInteract);
mouse.SaveCursorUntilItLeaves();
mouse.Mode = eModeUpLeftArr;
if (gGui2.Visible==true) {
  gGui2.Visible = false;
  }
 
}
[edit] Well I finally got it to work. Never mind.
« Last Edit: 28 Apr 2007, 21:55 by joelphilippage »



Re: MODULE: Enhanced Verbcoin Gui v1.0e *updated*
« Reply #22 on: 12 May 2007, 13:49 »
[edit] Well I finally got it to work. Never mind.

Glad you managed to solve your problem.

In any case, I've decided to swipe off the dust of this module, get it to work better then before, create a new template to go with the module and complete user documentation.

I've let this slide for far too long.

With luck, I can release the whole package (module-template-documentation) sometime in the next couple of weeks.

Re: MODULE: SCUMM Verbgui 2.0beta1
« Reply #23 on: 09 Jun 2007, 12:58 »
A beta of the version is out. Use it as you see fit.

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on a game that won an AGS Award!
    •  
    • Dualnames worked on a game that was nominated for an AGS Award!
Re: MODULE: SCUMM Verbgui 2.0beta1
« Reply #24 on: 11 Sep 2007, 20:39 »
EDIT: Everything works quite perfect. I could fix the code if you like.
« Last Edit: 12 Sep 2007, 20:44 by Dualnames »
No more military army stuff. I'm alive and back.

Re: MODULE: SCUMM Verbgui 2.0beta1
« Reply #25 on: 13 Sep 2007, 14:04 »
EDIT: Everything works quite perfect. I could fix the code if you like.

Hey, knock yourself out. Haven't got the time myself, unfortunately.

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on a game that won an AGS Award!
    •  
    • Dualnames worked on a game that was nominated for an AGS Award!
Re: MODULE: SCUMM Verbgui 2.0beta1
« Reply #26 on: 14 Sep 2007, 23:02 »
Of course you don't have. But the cod isn't working. And I've made some arrangements. So if you want I could upload the whole deal. I know you've been working on the game already. And besides that you have a real life as well.
No more military army stuff. I'm alive and back.

Re: MODULE: SCUMM Verbgui 2.0beta1
« Reply #27 on: 16 Sep 2007, 17:08 »
have you a demo, where i can see your module in action?
cause its hard to say, if your module could be useful for my needs,
without the possibility to test it.

Dualnames

  • Local Moderator
  • Pretty Badass
    • Dualnames worked on a game that won an AGS Award!
    •  
    • Dualnames worked on a game that was nominated for an AGS Award!
Re: MODULE: SCUMM Verbgui 2.0beta1
« Reply #28 on: 21 Sep 2007, 16:16 »
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32398.0

Well I've remade the module whatevery for those about to bug free...
No more military army stuff. I'm alive and back.

Re: TEMPLATE: SCUMM VERBCOIN GUI v1.2 (for AGS 3.0 only)
« Reply #29 on: 01 Dec 2007, 09:20 »
See http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32745 for the latest template. (for AGS 3.0, though if you import the module code in AGS 2.72 it should work too)
« Last Edit: 01 Dec 2007, 10:18 by Electroshokker »