Author Topic: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018  (Read 3865 times)

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Hi,
as long as you know your ways around AGS, it should not be too hard. The whole GUI stuff is already pretty much modulized.
You need to export the optiongui module from the template, as well as the GUIs: gSave, gSaveConfirm, gLoad (and optionally gOptions).

In gOptions you might want to remove the Layout slider and the code behind it, since this is the only(?) template specific thing in this module.

Hi,
as long as you know your ways around AGS, it should not be too hard. The whole GUI stuff is already pretty much modulized.
You need to export the optiongui module from the template, as well as the GUIs: gSave, gSaveConfirm, gLoad (and optionally gOptions).

In gOptions you might want to remove the Layout slider and the code behind it, since this is the only(?) template specific thing in this module.

Thank you very much!:-D
I'm at my first game and I'm currently Learning Scripting but I'm confident to be able to do it (nod)

Hi Abstauber!

I tried to import the module but my AGS version is slightly older than the one you used for the module... so the importing failed
do you know if is it possible to use it in another way?

Sure, that is actually not a big deal. First you need to resize the gAction GUI to your game's screen resolution (eg 320x200)
Now you need to copy over this adjusted  AdjustActionBarPosition function to your template and make sure it is called in repeatedly_execute_always

Code: Adventure Game Studio
  1. void AdjustActionBarPosition()
  2. {
  3.   int actionLabelWidth = GetTextWidth(ActionLine.Text, eFontTextOut) + 4;
  4.   int actionLabelHalf = actionLabelWidth / 2;
  5.   int xpos = mouse.x - actionLabelHalf ;
  6.   int ypos = mouse.y - Game.SpriteHeight[mouse.GetModeGraphic(mouse.Mode)] - 4;
  7.  
  8.   if (xpos + actionLabelWidth >= System.ScreenWidth) xpos = System.ScreenWidth - actionLabelWidth;
  9.   else if (xpos < 0) xpos = 0;
  10.  
  11.   if (ypos < 0 ) ypos = 0;
  12.  
  13.   ActionLine.X = xpos;
  14.   ActionLine.Y = ypos;
  15.   ActionLine.Width = actionLabelWidth;
  16. }
  17.  


This is perfect! Thank you. But is it possible to hide the actionline when starting an action, in an easy way?
"Talk to character" for example is still on the screen (highlighted) when the dialog goes on. And sometimes those texts even overlap each other.

Thank you!

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
helping me with the existing translation.

Watch out you made a copy&paste mistake in the French screenshot : It's not "ourvrir", it's supposed to be "ouvrir".

Question : apart from the new copy&save, are there any other improvements? We've just finished integrating the 9verb into the "custom save with screenshots" and bam, just at the same time you release it packaged. So I'm thinking if it's worth integrating again.
« Last Edit: 19 Apr 2018, 10:05 by Monsieur OUXX »
 

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
@zurik I'll have a look tomorrow

@Monsieur Ouxx
Hehe, thanks for the hint. I'll update the graphics in the future. How comes that you stumble upon this template almost exactly a year after it's release? (laugh)
Quote
We've just finished integrating the 9verb into the "custom save with screenshots" and bam, just at the same time you release it packaged.
Did I release something recently?

The main additions are double click running and the new save gui. And of course the whole code reorganizing and refactoring stuff, but technically these aren't features ;)
« Last Edit: 19 Apr 2018, 20:58 by abstauber »

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
@zurik
I think the trick was to set the action label to an empty string after an action was executed or the GUI gets disabled. The GUI gets disabled once a dialog starts, so we use this effect.

This is from the tumbleweed script, so there's a bit work left to adapt it to the 9verb GUI variable and function names.

Code: Adventure Game Studio
  1. function repeatedly_execute_always() {
  2.  
  3.  
  4.   if (!IsGamePaused() && !Verbs.IsGuiDisabled()) {
  5.  
  6.     // Update Actionbar
  7.     if (classicGui == false) {
  8.       Verbs.CheckDefaultAction();
  9.  
  10.       // Update Actionbar after command is executed
  11.       if (location_clicked != null && location_clicked.Length > 0) {
  12.         if (location_clicked.IndexOf(">") > 0) temp_location = location_clicked.Truncate(location_clicked.IndexOf(">"));
  13.         else temp_location = location_clicked;
  14.       }
  15.       else temp_location = "";
  16.  
  17.       if (IsInterfaceEnabled() || temp_location != location || location == "") {
  18.         Verbs.UpdateActionBar();
  19.         location_clicked = "";
  20.       }
  21.       Verbs.AdjustActionBarPosition();
  22.     }
  23.     // Doubleclick Timer
  24.     if (dc_timer_run == true)
  25.     {
  26.       if (disableDoubleclick) {
  27.         dc_timer_run = false;
  28.       }
  29.       else {
  30.         dc_timer_click++;
  31.         if (dc_timer_click >= dc_speed){
  32.           dc_timer_click = 0;
  33.           dc_timer_run = false;
  34.         }
  35.       }
  36.     }
  37.   }
  38. }
  39.  
  40.  

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
The main additions are double click running and the new save gui. And of course the whole code reorganizing and refactoring stuff, but technically these aren't features ;)

So basically it does exactly what our template does. Even the running. I'm gutted. Proof I should visit the forums more often ;)
 

Hi Abstauber!

First of all, love the new Verbs, great design.

I'm having some trouble with the doors. I set up the doors as I learned and the Anyclick works. Problem is this: in my new game I will have more than one playable characters, the user can switch anytime he wants. So, what I want to get working is this: If a Character on one side of a door opens the doors(but steps not trough it), then it should also be open in the next room, even if an other characzer approaches it from the other side, right?
I put the Getdoorstate in room_load on both sides, trying to always update the door state. Ot works for going trough the door, but it doesn't change the corrsponding object. Hence:
You will step trough an open bit displayed closed, door.
Well this is how I set doors up:

Code: Adventure Game Studio
  1. Room_First_Load {  
  2. //Set up a doors with ID 20 and set it to unlocked but closed
  3.  
  4. Doors.Initobject (20, oDoor.ID);
  5.  Doors.Setdoorstate (20, 0);
  6. }
  7.  
  8. Room_Load{
  9.  //check if door is closed or open
  10. Doors.Getdoorstate (20);
  11. }
  12.  
  13.  
Code: Adventure Game Studio
  1. Room_First_Load {  
  2. //Set up a doors with ID 20 and set it to open
  3.  
  4. Doors.Initobject (20, oDoor.ID);
  5.  Doors.Setdoorstate (20, 1);
  6. }
  7.  
  8.  
  9. Room_Load{
  10.  //check if door is closed or open
  11. Doors.Getdoorstate (20);
  12. }
  13.  

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Hi and thanks for the kind words.

Without testing it I'd say you need to init the door object every time the room loads.
GetDoorState just return the state of the door, but doesn't apply it. InitObject does both: it get the state and modifies the object if needed.

Code: Adventure Game Studio
  1. Room_First_Load {  
  2. //Set up a doors with ID 20 and set it to open
  3.  Doors.Setdoorstate (20, 1);
  4. }
  5.  
  6.  
  7. Room_Load{
  8.  //check if door is closed or open
  9. Doors.InitObject (20, oDoor.ID);
  10. }
  11.  

EDIT: Doors work now! I'am so happy!

Thanks! I'll try this evening and let you know :)
Oh, I also had another bug regarding the safe-system. I have to recreate it in the evening because I'm at work now, but I would describe it like this:
If I open the Menu via the GUI Button I can safe and load without problem. But If I open the Menu via F5 and safe I get an error. As I said I have to recreate it, but I recall it pointed to the part of the script where you added a comment saying "workaround for taking a screenshot without the menu-gui".

I tried with both compiled game and the testeun with AGS open.


EDIT: The Error Reads "Error running function 'repeatedly_excecute'": Error: Null String referenced

and it refers to the line 402 of the optiongui.asc

Code: Adventure Game Studio
  1. if (save_scheduled) {
  2.     SaveGameSlot(saveSlotId, saveSlotString);
  3.     saveSlotId = 0;
  4.     saveSlotString = "";      
  5.     save_scheduled = false;
  6.   }
  7.  
« Last Edit: 24 Apr 2018, 15:04 by Loslem »

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
A good thing, that I called this a release candidate ;)

Here's your bugfix.

In globalscript.asc at line 25 edit your code like this:
Code: Adventure Game Studio
  1.   if (keycode == eKeyF5) {
  2.     //gOptions.Visible=true; // F5 - OPTIONS
  3.     Verbs.UpdateActionBar();
  4.     OptionGui.ShowOptions();
  5.   }
  6.  
That fixed the issue for me.

Hi it's me again, back to bother you! :D

Say: It's super convienient to set Door Hotspots with the extension >o, so that right click right opens them. Problem: if you click right again you always get the door string for the open door.
Is there a way to implement that the door is closed again with a right click?

EDIT: Sorry I found it on site 14 of your Verbs Manual. Good write!
« Last Edit: 12 Jun 2018, 22:16 by Loslem »

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Great that you've sorted it out.

And since we're at it, I've added the fixes to Github and updated the template.
So after over a year in RC state, I now proudly call it 1.0 :-D