Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: abstauber on Sat 29/04/2017 15:41:50

Title: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Sat 29/04/2017 15:41:50
This is the long overdue overhaul of the classic 9 Verbs template:
Tumbleweed Verbs!

Here are a few highlights:

Thimbleweed(tm) mode
(https://dkrey.github.io/public_html/ags/tumbleweed1.png)

A new save&load system
(https://dkrey.github.io/public_html/ags/tumbleweed2.png)

...while offering the classic SCUMM experience
(https://dkrey.github.io/public_html/ags/tumbleweed3.png)

And it still speaks your local language... sort of ;)
(https://dkrey.github.io/public_html/ags/tumbleweed4.png)

A more complete feature list:


Code
https://github.com/dkrey/ags_tumbleweed

Download
https://github.com/dkrey/ags_tumbleweed/releases

Documentation
https://github.com/adventuregamestudio/ags-manual/wiki/Tumbleweed

For historic reasons, here's an outdated version of the manual ;)
http://shatten.sonores.de/wp-content/uploads/2017/05/tumbeweed_doc.zip
Title: Re: Tumbleweed Verbs (Beta!)
Post by: Mehrdad on Sat 29/04/2017 16:27:22
Great!!!. It's really useful . Nice job!!
Title: Re: Tumbleweed Verbs (Beta!)
Post by: selmiak on Sun 30/04/2017 11:51:14
nice! Can you integrate this into the normal LA template?
Title: Re: Tumbleweed Verbs (Beta!)
Post by: CaptainD on Sun 30/04/2017 12:40:31
This looks great!  Thanks for all the hard work that's going into it.
Title: Re: Tumbleweed Verbs (Beta!)
Post by: Calin Leafshade on Sun 30/04/2017 19:20:05
Forgive my ignorance but what is the "Thimbleweed mode"?

It looks the same to me.
Title: Re: Tumbleweed Verbs (Beta!)
Post by: Snarky on Sun 30/04/2017 19:39:23
It just means the verb and hotspot name follow the mouse cursor instead of showing up in a dedicated "action bar"
Title: Re: Tumbleweed Verbs (Beta!)
Post by: abstauber on Sun 30/04/2017 21:14:30
@Calin & Snarky:
It is a tad more than just a label following the mouse cursor, although it is true that it isn't actually visible on the screenshot.
The "action label" also show the default action for the location and switches to the chosen action upon mouse click.
It stays that way until:
- you cancel the action
- the action is executed and done
- you move the mouse away from the location

The SCUMM mode always displays the chosen action until you click something or the action is done. It is a bit hard to explain - just try it and you will see ;)

@Selmiak: Do you have a particular feature in mind?
As long as the "normal" template is being used, I will maintain it. But the purpose of this template is to replace the older one.
I might integrate the running stuff in the 9Verbs MI-Style template at some point. Done

@CaptainD & Mehrdad: Thanks :)
Title: Re: Tumbleweed Verbs (Beta!)
Post by: LostTrainDude on Sun 30/04/2017 22:00:21
Rounds of applause abstauber! This looks great!
Title: Re: Tumbleweed Verbs (Beta!)
Post by: Danvzare on Mon 01/05/2017 15:57:20
Awesome, who knew Thimbleweed Park would have spurred abstauber to update this old template so much. :-D
Title: Re: Tumbleweed Verbs (Beta!)
Post by: abstauber on Wed 03/05/2017 10:49:18
A question for you native speakers:

How should the label for the GUI style be called? (It is a slider where you switch between classic SCUMM mode and the 'modern' thimbleweed mode.

Currently it is slider called GUI style with the options classic and modern
In German I called the slider 'Bedienung' which can be translated to Mode of operation.

But how could it be called in English? 'GUI style' sounds a bit too technical.
Title: Re: Tumbleweed Verbs (Beta!)
Post by: CaptainD on Wed 03/05/2017 11:28:01
Hmm... I think "Layout" or possibly just "Style" would be reasonable words to use.  I'd probably favour "Layout" myself.
Title: Re: Tumbleweed Verbs (Beta!)
Post by: abstauber on Thu 04/05/2017 10:25:01
Alright, thanks! I'll stick with layout then.

Btw. I've uploaded a new beta. For better testing the second room is now scrolling.
Thanks to arj0n, we have a new translation: dutch.
Also thanks to Bicilotti, Monsieur Ouxx and Cireja for helping me with the existing translation.
Title: Re: Tumbleweed Verbs (Beta!) Last update: 4th May 2017
Post by: abstauber on Tue 09/05/2017 13:33:23
Here's a new beta and I finally managed to create a repository for this template.

Changes:
The "cog" button is now on the same GUI as the action label.
Slight changes to what happens if you "talk to" nothing.
Code cleanup and small bugfixes

Did actually anyone already give this a go?

Title: Re: Tumbleweed Verbs (Beta!) Last update: 10th May 2017
Post by: abstauber on Wed 10/05/2017 13:08:17
Lo and behold, I received a bug report :-D
Beta4 is up. The running mode now waits for certain distance between player character and cursor. Also the running isn't blocking anymore.

edit: We have reached Beta5. You can now "run" on hotspots with an exit extention to change rooms.
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Wed 17/05/2017 20:30:35
I finally managed to update the documentation and I also added a new chapter about the changes and differences to the 9verbs MI-style template.
I guess waiting for further bug reports at this point might be a bit useless, so I call this a release candidate :P
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: daniel on Fri 26/05/2017 10:18:48
this looks awesome abstauber!

noob question:
how do i go about updating my game from the 9-verb template? i can't seem to figure out how i can import this template into my existing game:D
i already have custom UI graphics, colors, fonts etc. in place. i suppose this is going to be a bit of a pain? :-\

p.s. i noticed in both your templates, when you look at something you can click the mouse to skip a line of text. however in lucasarts games when you look at stuff you can still move while the text keeps displaying. i feel this really helps the "flow" of the gameplay. would it be possible to achieve this in AGS as well?
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Mon 29/05/2017 09:21:43
Quotehow do i go about updating my game from the 9-verb template?
Currently both templates share the same features, except the save/load handling. You can export the save/load GUIs from the template and import them to your game. Also you need to export the optiongui module.
Actually migrating your game completely from one template to another might indeed be quite a pain ;) I'd rather say: create a new game from Tumbleweed template and import your rooms into it. Afterwards apply your other changes, fonts colors and graphics.

Quotehowever in lucasarts games when you look at stuff you can still move while the text keeps displaying
Unfortunately displaying speech is usually blocking in AGS. You could use BackgroundSpeech, but that way you would loose the talking animations with "lucas style speech".
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: daniel on Wed 31/05/2017 13:45:55
thanks abstauber,

i guess i'll just continue with the "old" template for now and maybe migrate at a later point...
actually the one thing that i like most from the new template is that the action/info is displayed over the cursor instead of an action bar.
is this possible in the 9-verb template somehow?
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Thu 01/06/2017 12:38:52
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


void AdjustActionBarPosition()
{
  int actionLabelWidth = GetTextWidth(ActionLine.Text, eFontTextOut) + 4;
  int actionLabelHalf = actionLabelWidth / 2;
  int xpos = mouse.x - actionLabelHalf ;
  int ypos = mouse.y - Game.SpriteHeight[mouse.GetModeGraphic(mouse.Mode)] - 4;
 
  if (xpos + actionLabelWidth >= System.ScreenWidth) xpos = System.ScreenWidth - actionLabelWidth;
  else if (xpos < 0) xpos = 0;
 
  if (ypos < 0 ) ypos = 0;
 
  ActionLine.X = xpos;
  ActionLine.Y = ypos;
  ActionLine.Width = actionLabelWidth;
}
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Jigen Daisuke on Fri 15/12/2017 11:56:19
Hi Abstauber!

Is it possible to use your save/load GUI (with screenshot/date/hour mode) on other templates?
I'd like to use it in a game I'm currently developing!
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Fri 15/12/2017 12:37:39
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.
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Jigen Daisuke on Fri 15/12/2017 13:56:53
Quote from: abstauber on Fri 15/12/2017 12:37:39
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)
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Jigen Daisuke on Fri 05/01/2018 16:16:34
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?
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: zurik on Thu 19/04/2018 07:09:37
Quote from: abstauber on Thu 01/06/2017 12:38:52
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


void AdjustActionBarPosition()
{
  int actionLabelWidth = GetTextWidth(ActionLine.Text, eFontTextOut) + 4;
  int actionLabelHalf = actionLabelWidth / 2;
  int xpos = mouse.x - actionLabelHalf ;
  int ypos = mouse.y - Game.SpriteHeight[mouse.GetModeGraphic(mouse.Mode)] - 4;
 
  if (xpos + actionLabelWidth >= System.ScreenWidth) xpos = System.ScreenWidth - actionLabelWidth;
  else if (xpos < 0) xpos = 0;
 
  if (ypos < 0 ) ypos = 0;
 
  ActionLine.X = xpos;
  ActionLine.Y = ypos;
  ActionLine.Width = actionLabelWidth;
}



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!
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Monsieur OUXX on Thu 19/04/2018 10:03:30
Quote from: abstauber on Thu 04/05/2017 10:25:01
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.
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Thu 19/04/2018 20:53:31
@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 ;)
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Fri 20/04/2018 12:41:38
@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.


function repeatedly_execute_always() {
 
 
  if (!IsGamePaused() && !Verbs.IsGuiDisabled()) {
 
    // Update Actionbar
    if (classicGui == false) {
      Verbs.CheckDefaultAction();

      // Update Actionbar after command is executed
      if (location_clicked != null && location_clicked.Length > 0) {
        if (location_clicked.IndexOf(">") > 0) temp_location = location_clicked.Truncate(location_clicked.IndexOf(">"));
        else temp_location = location_clicked;
      }
      else temp_location = "";

      if (IsInterfaceEnabled() || temp_location != location || location == "") {
        Verbs.UpdateActionBar();
        location_clicked = "";
      }
      Verbs.AdjustActionBarPosition();
    }
    // Doubleclick Timer
    if (dc_timer_run == true)
    {
      if (disableDoubleclick) {
        dc_timer_run = false;
      }
      else {
        dc_timer_click++;
        if (dc_timer_click >= dc_speed){
          dc_timer_click = 0;
          dc_timer_run = false;
        }
      }
    }
  }
}

Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Monsieur OUXX on Fri 20/04/2018 16:19:31
Quote from: abstauber on Thu 19/04/2018 20:53:31
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 ;)
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Loslem on Tue 24/04/2018 05:59:45
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 (ags) Select

Room_First_Load { 
//Set up a doors with ID 20 and set it to unlocked but closed

Doors.Initobject (20, oDoor.ID);
 Doors.Setdoorstate (20, 0);
}

Room_Load{
 //check if door is closed or open
Doors.Getdoorstate (20);
}


Code (ags) Select

Room_First_Load { 
//Set up a doors with ID 20 and set it to open

Doors.Initobject (20, oDoor.ID);
 Doors.Setdoorstate (20, 1);
}


Room_Load{
 //check if door is closed or open
Doors.Getdoorstate (20);
}
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Tue 24/04/2018 08:09:22
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.


Room_First_Load { 
//Set up a doors with ID 20 and set it to open
Doors.Setdoorstate (20, 1);
}


Room_Load{
//check if door is closed or open
Doors.InitObject (20, oDoor.ID);
}
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Loslem on Tue 24/04/2018 10:14:46
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 (ags) Select

if (save_scheduled) {
    SaveGameSlot(saveSlotId, saveSlotString);
    saveSlotId = 0;
    saveSlotString = "";       
    save_scheduled = false;
  }
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: abstauber on Tue 24/04/2018 18:07:03
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:

  if (keycode == eKeyF5) {
    //gOptions.Visible=true; // F5 - OPTIONS
    Verbs.UpdateActionBar();
    OptionGui.ShowOptions();
  }

That fixed the issue for me.
Title: Re: TEMPLATE: Tumbleweed Verbs (RC1) Last update: 17th May 2017
Post by: Loslem on Tue 12/06/2018 21:59:00
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!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: abstauber on Wed 13/06/2018 10:43:50
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
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: imsomnia212 on Sat 21/07/2018 21:33:05
First of all I really love the template.
Well, I have a question: Is possible to show the save screenshot with anti-alising when your game is nearest-neighbor? I wan't to show it like the way Thimbleweed do, but in the template with a nearest-neighbor game, it pixelate and lose information in the screenshot.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Crimson Wizard on Sat 21/07/2018 21:45:23
Quote from: imsomnia212 on Sat 21/07/2018 21:33:05
Well, I have a question: Is possible to show the save screenshot with anti-alising when your game is nearest-neighbor? I wan't to show it like the way Thimbleweed do, but in the template with a nearest-neighbor game, it pixelate and lose information in the screenshot.

This would require applying different graphic filter at runtime, which AGS currently cannot do, I am afraid. (Well, technically it could, but there is no script command or option to make it do so).
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Monsieur OUXX on Mon 23/07/2018 11:24:30
imsomnia212 : What you can do is apply the anti-aliasing AFTER taking the screenshot.
I'm not detailing, but :
1) locate the place in the module where the screenshot is taken
2) Open the file from disk or start fiddling with the dynamic sprite directly (I haven't checked which of those two scenarios applies here)
2) Resize the sprite using the DynamicSprite and DrawingSurface scaling abilities -- apply the antialiasing at that time.
3) Save the sprite as a file where it should normally have been saved in the first place
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Snarky on Mon 23/07/2018 11:55:26
Quote from: Monsieur OUXX on Mon 23/07/2018 11:24:30
2) Resize the sprite using the DynamicSprite and DrawingSurface scaling abilities -- apply the antialiasing at that time.

I don't understand how this step is supposed to work. Neither DrawingSurface.DrawImage()/DrawSurface() nor DynamicSprite.Resize() allow you to specify antialiasing â€" I'm not sure whether it's always off or whether it depends on the "Smooth scaled sprites" setting in winsetup, but it's not something you can control through AGS script (the best you can do is game.disable_antialiasing, but there's no game.force_antialiasing).

It might be possible to write a function to do bilinear sprite scaling by reading and drawing individual pixels, but that would be SLOOOW.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Crimson Wizard on Mon 23/07/2018 12:33:41
Quote from: Snarky on Mon 23/07/2018 11:55:26
Quote from: Monsieur OUXX on Mon 23/07/2018 11:24:30
2) Resize the sprite using the DynamicSprite and DrawingSurface scaling abilities -- apply the antialiasing at that time.

I don't understand how this step is supposed to work. Neither DrawingSurface.DrawImage()/DrawSurface() nor DynamicSprite.Resize() allow you to specify antialiasing â€" I'm not sure whether it's always off or whether it depends on the "Smooth scaled sprites" setting in winsetup, but it's not something you can control through AGS script (the best you can do is game.disable_antialiasing, but there's no game.force_antialiasing).

I was too confused by this advice. At first I thought there is a mode for SetGameOption I forgot about, but then I checked engine code, and this is not the case with anti-aliased sprites. But that option is not even applied to DrawingSurface operations, only when drawing characters and objects in the room.
(Which may be an oversight really. Also, that should be technically possible to add an option to switch sprite anti-aliasing at runtime, if really necessary)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Snarky on Mon 23/07/2018 13:14:41
Quote from: Crimson Wizard on Mon 23/07/2018 12:33:41But that option is not even applied to DrawingSurface operations, only when drawing characters and objects in the room.
(Which may be an oversight really. Also, that should be technically possible to add an option to switch sprite anti-aliasing at runtime, if really necessary)

It feels like a design decision made back in 2000 or thereabouts that doesn't make much sense any more.

How I would want it to work, ideally:

-Antialiasing (or more properly interpolation) for scaling characters is a game setting that can be controlled in script
-There's a game-wide default value, but it can also be overridden for individual characters
-Possible values for this setting would be Nearest Neighbor, Bilinear, Bicubic and User-Configured (which would then be controlled by winsetup; the default for backwards compatibility), with option to extend later
-For relevant DrawingSurface/DynamicSprite operation (scaling and rotation), there would be an optional interpolation argument with the same possible values, defaulting to Nearest Neighbor
-While we're at it, also add a subpixel Translate operation to shift a sprite by a fraction of a pixel (using any of the interpolation settings â€" though Nearest Neighbor wouldn't really do much).
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Ray on Mon 23/07/2018 23:39:01
Thank you very much for this template!
I'm just starting with AGS, so such a good example will definitely be a help :)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: imsomnia212 on Tue 24/07/2018 08:29:48
Quote from: Crimson Wizard on Sat 21/07/2018 21:45:23
This would require applying different graphic filter at runtime, which AGS currently cannot do, I am afraid. (Well, technically it could, but there is no script command or option to make it do so).

That's sad but maybe in a near future that's Will be possible.
I have another problem, when I set up a bg for the dialog gui (is a image with alpha channel) it show a pink bg and not the transparent img like do when use the ags gui system, see:

Using the ags gui system for the main gui (verbs, inventory items, etc):
(http://i.imgur.com/dTaqQFH.jpg)

Using the dialog script provide by Tumbleweed module:

(http://i.imgur.com/9XHp7OL.jpg)

I set up the script like the note said:

Code (ags) Select

// Background
// set bg img_transparency to -1 if you're using 32-bit graphics and
// want to preserve the alpha channel
this.bg_img                = 276;
this.bg_img_scaling        = 0;
this.bg_img_transparency   = -1;
this.bg_color              = 0;
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Monsieur OUXX on Wed 25/07/2018 08:29:25
I'm so confused right now. Wasn't there a new parameter added recently to DynamicSprite.Draw or .Resize or whatever where you could choose the scaling algorithm? Or am I mixing it up with the new parameter for transparency copy (legacy, additive...)? My bad then.

But anyways, even if imsomnia212 has to write the antialised method himself (which shouldn't be too hard because it doesn't have to be real-time, it can be super slow, just copy some bilinear code from wikipedia), it's only an extra step to the method I described to achieve his goal of antialised saved games screenshots.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Snarky on Wed 25/07/2018 08:57:20
Scripting a bilinear interpolation filter is complicated by AGS's crappy color handling (not allowing you to get or set the full 32-bit color value). To get the correct result without degrading the screenshot to 16-bit, you would have to grab the individual pixels as sprites and draw them on top of each other at various transparencies.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: abstauber on Fri 27/07/2018 11:36:47
@imsomnia212 I can replicate this, but I'm clueless why it isn't working anymore. Drawing images with an alpha channel used to work on dialog GUIs - at least in 2017. I'm trying to find out in which version of AGS, this feature broke again. It never broke, see below ;)

Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Crimson Wizard on Fri 27/07/2018 11:44:30
Quote from: abstauber on Fri 27/07/2018 11:36:47
@imsomnia212 I can replicate this, but I'm clueless why it isn't working anymore. Drawing images with an alpha channel used to work on dialog GUIs - at least in 2017. I'm trying to find out in which version of AGS, this feature broke again.

What version of AGS are you using? Does it replicate in this template right away, or you need to do something extra to see it?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: abstauber on Fri 27/07/2018 11:49:37
Sorry for accusing AGS: I messed up :X.
I forgot to set info.HasAlphaChannel = true;

@imsomnia212
In line 382 (function dialog_options_get_dimensions) add this


  if ((CDG.bg_img_transparency > 0 || CDG.bg_img_transparency == -1) && CDG.bg_img!=0 ) {
    info.HasAlphaChannel = true;
  }
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: Monsieur OUXX on Mon 30/07/2018 19:00:43
When you double-click on the hologram character, the player does not "fast walk". Is that intended? I haven't tested but I guess the same thing would happen when you double-click on objects or hotspots?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.0 Last update: 13th June 2018
Post by: abstauber on Tue 31/07/2018 08:06:51
For some reason I thought that this would be the way to do it. But apparently you can doubleclick-walk to everything in Thimbleweed Park.
So yeah, it seems to be an intentional bug which I'll fix right away :)

In the meantime you can comment out the 'if condition' in line 2075 and it's bracket in 2085. In line 2095 remove this piece from the if condition: 
"&& location_type == eLocationNothing"

I'll test it some more and see if this fix breaks anything.
--edit: of course it broke something :P Gotta fix the door handling now.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Fri 03/08/2018 15:11:00
Here's the new version - sorry for refactoring so much code after the 1.0 release.
All template settings are now grouped in a separate module and you can change them from anywhere in your code. I've also removed the old doubleclick code and integrated CW's module instead.

Btw. thanks to CW and Snarky for telling me about attributs and how they work :D Also thanks to Monsieur Ouxx who brought the issue up.

This version also contains two bugfixes:
1) Alpha transparency for the dialog GUI is now a thing
2) Running works on everything, not just plain areas.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Fri 03/08/2018 17:05:57
hurray!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: imsomnia212 on Sun 05/08/2018 04:40:45
Hey thanks for the fix!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Sun 05/08/2018 18:18:30
Tiny issue : the "tiny" font points to the same file as other fonts : xpaider2.ttf. And that file does not seem to be the right one. I tried importing it at small sizes (5 or 6pt) but it's not right. Can you help me?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Sun 05/08/2018 20:12:18
Oh, that's easy to explain: the "tiny" font is a .wfn font. But if I recall correctly, you have to start with a ttf font first and then replace it with the wfn font in the file system.
You can find the wfn font in the assets folder in Github, or here on the forums: it is Tom Thumb.
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48798

@Imsomnia212: Cheers! I'm looking forward to see some of your games in the future. Your abandoned mags game already looked very promising.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Mon 06/08/2018 11:38:12
Quote from: abstauber on Sun 05/08/2018 20:12:18
You can find the wfn font in the assets folder in Github, or here on the forums: it is Tom Thumb.
http://www.adventuregamestudio.co.uk/forums/index.php?topic=48798

Cool. That's also the one I've been using in other places.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Wed 08/08/2018 13:46:17
fyi : I've done a pull request.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: imsomnia212 on Thu 09/08/2018 01:34:43
Quote from: abstauber on Sun 05/08/2018 20:12:18
@Imsomnia212: Cheers! I'm looking forward to see some of your games in the future. Your abandoned mags game already looked very promising.

Soon I will show in the forum something that I'm working on too hard
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Babar on Sun 02/09/2018 15:16:23
I get a "Not Found" page when I try to download the template.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Crimson Wizard on Sun 02/09/2018 15:34:27
Quote from: Babar on Sun 02/09/2018 15:16:23
I get a "Not Found" page when I try to download the template.

I think you may still download the source project from github:
https://github.com/dkrey/ags_tumbleweed
if you click on green "Clone or download" button and choose Download ZIP.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Babar on Sun 02/09/2018 17:51:07
Quote from: Crimson Wizard on Sun 02/09/2018 15:34:27
I think you may still download the source project from github:
https://github.com/dkrey/ags_tumbleweed
if you click on green "Clone or download" button and choose Download ZIP.
Yes, that is what I did, I just figured I'd try to get the template as an agt file.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Wed 05/09/2018 11:00:36
@Babar: Sorry about the broken link, I've just fixed it.

@Monsieur OUXX: Your changes seem to make a lot of sense, but unfortunately your pull request does not compile (yet)
QuoteGlobalScript.asc(54): Error (line 54): '.AdjustLanguage' is not a public member of 'Verbs'. Are you sure you spelt it correctly (remember, capital letters are important)?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Tue 11/09/2018 14:25:47
Quote from: abstauber on Wed 05/09/2018 11:00:36
your pull request does not compile (yet)

Weird. I made sure I never committed without compiling and testing first.
How do pull requests work? Do you see the state of the code at the time I did the pull request, or do you see the current state of the cloned respository and the branch it contains?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Wed 10/10/2018 09:32:06
I downloaded your last commit from Aug 18th (dedfd488392cf46dad0af3dbe2ddde97eb44c1df) and tried it to compile it with AGS. Since then I still didn't find the time review all the changes and probably find a fix for the remaining bugs.

That also raises the question: do I need merge this borked pull request and fix the bugs in the master branch or do I have to work in your repo to make it happen?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Crimson Wizard on Wed 10/10/2018 11:08:03
Quote from: abstauber on Wed 10/10/2018 09:32:06
That also raises the question: do I need merge this borked pull request and fix the bugs in the master branch or do I have to work in your repo to make it happen?

Sorry for barging in the discussion; technically both ways are viable, usually this is rather an organizational question.
Also, a while ago Github has allowed such feature as letting the owner of target repository to add commits directly to pull request branch, if the PR creator has ticked this option. Personally I cannot tell if it's the case not having necessary permissions there.

BTW this reminds me, Monsieur OUXX, have you noticed my comment to your pull request?
https://github.com/dkrey/ags_tumbleweed/pull/1#issuecomment-411395083
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Wed 10/10/2018 14:07:50
QuoteSorry for barging in the discussion
I was actually hoping you would do that :D
Thanks for the clarification, I guess I just need to wait until Mathieu replies. Maybe in the meantime I find time to do a full code review, since this pull request is quite a biggie.
In any case the #error command will find its way into the template (nod)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Fri 12/10/2018 17:32:29
Sorry guys I had a crazy month (I think the other people in my game project have probably hired bounty hunters to get me by now). I'll check out my code and the state of the pull, as well as CW's comment asap.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Tue 06/11/2018 16:06:58
QuoteI'll check out my code and the state of the pull, as well as CW's comment asap.
(wtf)

Hehe, no worries. I was able to find some time fixing your bugs and to merge your changes. Thanks for the tedious work of refactoring all this stuff (nod)

Anyone dares to test this right from the repo as well?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Wed 07/11/2018 20:48:33
Here's the new beta, compiled as a template for your convenience :)
I've been testing it for a bit now, but I couldn't find anything odd yet. But since so much has changed code wise, it would be great if anyone else could have a look.

Changes (mostly by Monsieur Ouxx)
- cleaned up the global script (moved the remaining GUI actions to the options menu module)
- Localisation of the GUI elements is handled a bit different internally
- It's possible to change the GUIs being used by the template
- Some more refactoring, the template throws errors if a module is missing.

Here it is:
http://shatten.sonores.de/wp-content/uploads/2018/11/tumbleweed_12_beta.zip (http://shatten.sonores.de/wp-content/uploads/2018/11/tumbleweed_12_beta.zip)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Thu 03/01/2019 00:02:16
So I'm not forgetting that I need to review the pull request, but in the meantime I'm having a weird issue. thanks to Khris it's been narrowed down to AGS apparently not being very good at having a sprite with alpha AND a transparency > 0 used as a GUI background.

I'm trying to set the custom dialogs GUI background to a black background with a slight transparency. Everything below failed :

- I tried with a fully black image (no alpha) and eDialogGui_bg_img_transparency set to 20, the background does not appear at all.
- I tried with a sprite imported from a PNG containing an all-black image with alpha (the black is 20% transparent) and  and eDialogGui_bg_img_transparency set to 0, now it's the font outline that goes cuckoo.
- I tried with the same semi-transparent PNG sprite and eDialogGui_bg_img_transparency set to -1. Now it's the transparency rendering that's all over the place (some pixels become fully transparent while some others are fully opaque).

What is the proper way?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Snarky on Thu 03/01/2019 08:57:23
There is no proper way. There's a bug in AGS: rendering is broken for GUIs with alpha-transparent backgrounds and content (including text) with alpha-transparency.

The workaround is to use two GUIs; one for the background and one on top (with the background set to COLOR_TRANSPARENT) for the content.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Thu 03/01/2019 09:38:28
Maybe I don't get it, but if it's about a GUI background with different alpha levels... that works and it's already implemented in the template.
Code (ags) Select
  // Background
  // set bg_img_transparency to -1 if you're using 32-bit graphics and
  // want to preserve the alpha channel 
  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img]                = 122;
  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_scaling]        = 0;
  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_transparency]   = -1;
  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_color]              = 0;


When you work with an alpha transparent PNG, you actually don't want AGS to interfere with it, you do it all in the image file.

Quote- I tried with a sprite imported from a PNG containing an all-black image with alpha (the black is 20% transparent) and  and eDialogGui_bg_img_transparency set to 0, now it's the font outline that goes cuckoo
Just set eDialogGui_bg_img_transparency to -1 and you should be fine.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Crimson Wizard on Thu 03/01/2019 10:01:37
Quote from: Snarky on Thu 03/01/2019 08:57:23
There is no proper way. There's a bug in AGS: rendering is broken for GUIs with alpha-transparent backgrounds and content (including text) with alpha-transparency.

This was supposed to be fixed long ago! If it's still not working please do bug report, otherwise I won't know about it.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Thu 03/01/2019 10:24:25
Quote from: Crimson Wizard on Thu 03/01/2019 10:01:37
Quote from: Snarky on Thu 03/01/2019 08:57:23
There is no proper way. There's a bug in AGS: rendering is broken for GUIs with alpha-transparent backgrounds and content (including text) with alpha-transparency.

This was supposed to be fixed long ago! If it's still not working please do bug report, otherwise I won't know about it.

Here's proof that it works  8-) The frame is 100% opaque, the background is semi transparent, the scroll arrows render correctly as does the font outline.
[imgzoom]http://shatten.sonores.de/wp-content/uploads/2019/01/cdg_alpha_proof.png[/imgzoom]
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Thu 03/01/2019 12:07:21
Quote from: abstauber on Thu 03/01/2019 10:24:25

  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_transparency]   = -1;

OK. I don't know what I'm doing wrong. When importing the PNG, should I say "yes" to "use alpha?" and should I select "leave transparency as-is"?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Thu 03/01/2019 12:13:13
Quote from: Monsieur OUXX on Thu 03/01/2019 12:07:21
Quote from: abstauber on Thu 03/01/2019 10:24:25

  CustomDialogGui.DialogGuiOptions[eDialogGui_bg_img_transparency]   = -1;

OK. I don't know what I'm doing wrong. When importing the PNG, should I say "yes" to "use alpha?" and should I select "leave transparency as-is"?

Yep.
Also make sure to check the option "GUI alpha rendering style" in the general settings. It has to be set to Proper Alpha Blending".

Here's the source image from the template, if you import this one, you can be sure that it works.

[imgzoom]https://raw.githubusercontent.com/dkrey/ags_tumbleweed/master/assets/gui/dialog_background.png[/imgzoom]
https://raw.githubusercontent.com/dkrey/ags_tumbleweed/master/assets/gui/dialog_background.png (https://raw.githubusercontent.com/dkrey/ags_tumbleweed/master/assets/gui/dialog_background.png)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: tzachs on Fri 04/01/2019 13:54:47
Maybe you're using an older version of AGS (from before the fix)?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Fri 04/01/2019 14:23:16
PROBLEM SOLVED.

From the start I was focusing on "GUI alpha rendering style", but it was actually "Sprite alpha rendering style" that caused the issue.
I'm not sure if it was because of the background sprite I was using OR if it was because of the font I'm using, that contains semi-transparent pixels, causing the outline to go crazy when the blending failed (unfortunately it went so crazy that I failed to visually identify it as only the outline)

Anyways now that everything is set to "proper alpha blending", everything seems to work as expected.

Thanks!!!
This is the thing that took me the most time on the short game I'm making :D *sigh of relief*
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Wed 30/01/2019 13:26:41
I have a new problem, which is the font issue that I've mentionned previously. It's not caused by the module itself however I don't understand what differs between my own game files and the demo game.

Abstauber, unfortunately the best way to show you my issue is to share the game files but I don't want to do it publicly, so I'm sending them to you in a Private Message.

For everyone, here is my issue's description:

CONTEXT
- I have a game based on the Tumbleweed module.
- It contains the "gAction" GUI, which itself contains "lblAction" -- same as Tumbleweed demo game
- lblAction uses the "eFontTumbleTextOut" font.  -- same as Tumbleweed demo game
- "TumbleTextOut" was imported from assets/xpaider2.ttf  -- same as Tumbleweed demo game
- TumbleTextOut was imported as 9pts and has outline "automatic" -- same as Tumbleweed demo game
- the game is set to "proper alpha blending" for both GUI and fonts -- same as Tumbleweed demo game

ISSUE
- In the demo game, when i open gAction, the label appears with the font without its outline (the outline is rendered only in-game)
- In my own game, when I open gAction, the label appears with a crappy 1-pixel outline the same color as the font. It's like the font is white with a white outline.

Screenshot:
(https://www.dropbox.com/s/z30m617kea93b1q/issue.png?raw=1)

I've tried tried overwriting xpaider2.ttf over itself, by re-importing it into the Tumbleweed demo game (without changing anything else), to see if it would do the same as in my game. That is, to see if the import action was broken in my current AGS version (3.4.1.13) but the label is still rendered properly in the Editor in the demo game.
I've tried re-importing /xpaider2.ttf over itself into my own game, but the issue is still there : it has this unwanted white outline.

Note that the font appears as expected in the Editor's "font" panel. It's only messed up in the label in gAction.

I'm 100% sure it's caused by transparency and some font pixels not being 100% transparent, hence being rendered as 100% opaque. But I just can't understand why it doesn't do the same in my game and in the demo game.

==========

unrelated : how do you manage to have all the GUIs appear with the proper Z order in your demo game, without defining any custom z-order? I had to do it in my own game.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Wed 30/01/2019 14:47:54
Hmm... it seems like you somehow triggered an editor bug. The font is rendered correctly in the game itself and it is also rendered correctly if you chose a button instead of a label.

It is just the label, that doesn't like the Xpaider font. Changing other labels to the mentioned font (your debug GUI for example) worked perfectly fine. But creating a new GUI with a new label resulted in a messy font again.

Like you described, I wasn't able to replicate this outside of your game project.

I'd say you also show your sources to Tzachs and Crimson Wizard, maybe they have a clue about what going on.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Monsieur OUXX on Wed 30/01/2019 16:35:30
Quote from: abstauber on Wed 30/01/2019 14:47:54
I wasn't able to replicate this outside of your game project.

Thanks a lot for such a quick answer. I'll send the link to CW and Tzachs.

============

EDIT: so the issue was that "Anti-alias TTF fonts" was set to "true" in the general settings. Now everything works perfectly.

============

EDIT 2 :

Here is a module that generates all the action buttons automatically, with an outline, shadow, inner gradient, and is meant to fit nicely with Tumbleweed. It also manages the horizontal stretching of some buttons in the languages that allow it (mostly, English)
It's meant to save the hassle of having to redraw and reimport a billion action buttons in every language. In our case we didn't like the blue theme but it would have taken an eternity to change it to red.

It's called "AutoButtons" (CODE BELOW)

Spoiler



Module header :
Code (ags) Select

/*

//All values below defined in Tumbleweed module
enum Action {
  eGA_LookAt = 0, //Starting at zero helps avoiding human mistakes when iterating on the enum
  eGA_TalkTo,
  eGA_GiveTo,
  eGA_PickUp,
  eGA_Use,
  eGA_Open,
  eGA_Close,
  eGA_Push,
  eGA_Pull,
  eGA_UseInv,
  eGA_Default,
  eGA_WalkTo
};

enum eLanguage {
  eLangEN = 0, //Starting at zero helps avoiding human mistakes when iterating on the enum
  eLangDE,
  eLangES,
  eLangIT,
  eLangFR,
  eLangPT,
  eLangNL
};

*/

enum AutoButtonStates {
    eAutoButton_off = 0,
    eAutoButton_on = 1,
    eAutoButton_hover = 2
};


#define THEMESIZE 20 //this must be bigger than the number of values in AutoButtonsThemeSettings

enum AutoButtonsThemeSettings {
  eAutoBSetting_color_off,   
  eAutoBSetting_color_off_gradienttop,   
  eAutoBSetting_color_off_gradientbottom,   
  eAutoBSetting_color_on,   
  eAutoBSetting_color_on_gradienttop,   
  eAutoBSetting_color_on_gradientbottom,   
  eAutoBSetting_color_hover,   
  eAutoBSetting_color_hover_gradienttop,   
  eAutoBSetting_color_hover_gradientbottom,   
  eAutoBSetting_color_outline,   
  eAutoBSetting_color_shadow
};

enum AutoButtonThemes {
    eAutoButtonTheme_Red = 0,
    eAutoButtonTheme_Blue = 1
   
};

struct AutoButtons
{
    import static int[] GetTheme(AutoButtonThemes theme); //Get the settings values from any of the built-in themes
    import static void SetTheme(AutoButtonThemes theme,  int themeSettings[]); //Overwrite an existing theme from your game, without requiring to temper with the module's script (if needed)
    import static int GenerateAll(int themeSettings[]);
    import static DynamicSprite* GetSprite(eLanguage lan,  Action action,  AutoButtonStates state);
    import static int GetSpriteID(eLanguage lan,  Action action,  AutoButtonStates state);
   
   
};





Module body :
Code (ags) Select

#define NBACTIONS 12
#define NBLANGUAGES 7
#define MAXAUTOBUTTONS 84 //12*7

#define BUTT_WIDTH 56
#define BUTT_HEIGHT 12

#define MAXTEXTWIDTH 200 //Some bullshit width to be passed to GetTextHeight. Should be bigger than the biggest possible width

int defaultTheme;
GUI* guiMain; //The gui that has the action buttons

struct AutoButtonData {
    DynamicSprite* s[3]; //one for each state
    eLanguage lan;
    Action action;
    String text;
    int widenFactor; //how much the text should be stretched horizontally (not all the same depending on the language and the action)
    int width; //what should be the width of the buttons (they don't have the same width depending on the language and the action)
};
AutoButtonData buttons[MAXAUTOBUTTONS];

#define MAXTHEMES 3

struct Constants {
    int width;
    int height;   
};
Constants constants;

struct Theme {
    //all values below initialized in game_start or if you call SetTheme
    int settings[THEMESIZE];
   
    //You can add any field you want. For example String themeName;
   
};
Theme themes[MAXTHEMES];
//int nbThemes;


//Unfortunately the Verbs module does not provide the bare actions, only with their prepositions and complement, like "Look at %s"
String TranslateAction(Action a, eLanguage lan) {
    switch(lan) {
        case eLangEN:
            switch(a) {
                case eGA_WalkTo: return "Go to";
                case eGA_LookAt: return "Look At";
                case eGA_TalkTo: return "Talk To";
                case eGA_GiveTo: return "Give";
                case eGA_PickUp: return "Pick Up";
                case eGA_Use: return "Use";
                case eGA_Open: return "Open";
                case eGA_Close: return "Close";
                case eGA_Push: return "Push";
                case eGA_Pull: return "Pull";
                default :
                    return "ERROR";
                    break;
            }
            break;
        case eLangDE :
            switch(a) {
                case eGA_WalkTo: return "Gehe zu";
                case eGA_LookAt: return "Schau";
                case eGA_TalkTo: return "Rede";
                case eGA_GiveTo: return "Gebe";
                case eGA_PickUp: return "Nehme";
                case eGA_Use: return "Nutze";
                case eGA_Open: return "Öffne";
                case eGA_Close: return "SchlieàŸe";
                case eGA_Push: return "Drücke";
                case eGA_Pull: return "Ziehe";
                default :
                    return "ERROR";
                    break;
            }
            break;
        case eLangES :
            switch(a) {
                case eGA_WalkTo: return "Ir a";
                case eGA_LookAt: return "Mirar";
                case eGA_TalkTo: return "Hablar";
                case eGA_GiveTo: return "Dar";
                case eGA_PickUp: return "Coger";
                case eGA_Use: return "Usar";
                case eGA_Open: return "Abrir";
                case eGA_Close: return "Cerrar";
                case eGA_Push: return "Empujar";
                case eGA_Pull: return "Tirar";
                default :
                    return "ERROR";
                    break;
            }
            break;
        case eLangFR :
            switch(a) {
                case eGA_WalkTo: return "Aller";
                case eGA_LookAt: return "Regarder";
                case eGA_TalkTo: return "Parler";
                case eGA_GiveTo: return "Donner";
                case eGA_PickUp: return "Prendre";
                case eGA_Use: return "Utiliser";
                case eGA_Open: return "Ouvrir";
                case eGA_Close: return "Fermer";
                case eGA_Push: return "Pousser";
                case eGA_Pull: return "Tirer";
                default :
                    return "ERROR";
                    break;
            }
            break;
        case eLangIT :
            switch(a) {
               
                case eGA_WalkTo: return "Vai a";
                case eGA_LookAt: return "Esamina";
                case eGA_TalkTo: return "Parla";
                case eGA_GiveTo: return "Dai";
                case eGA_PickUp: return "Raccogli";
                case eGA_Use: return "Usa";
                case eGA_Open: return "Apri";
                case eGA_Close: return "Ferma";
                case eGA_Push: return "Premi";
                case eGA_Pull: return "Tira";
                default :
                    return "ERROR";
                    break;
            }
            break;
        case eLangPT :
            switch(a) {   
               
                case eGA_WalkTo: return "Ir para";
                case eGA_LookAt: return "Olhar";
                case eGA_TalkTo: return "Falar";
                case eGA_GiveTo: return "Dar";
                case eGA_PickUp: return "Apanhar";
                case eGA_Use: return "Usar";
                case eGA_Open: return "Abrir";
                case eGA_Close: return "Fechar";
                case eGA_Push: return "Empurrar";
                case eGA_Pull: return "Puxar";
                default :
                    return "ERROR";
                    break;
            }
            break;
        case eLangNL :
            switch(a) {
   
                case eGA_WalkTo: return "Ga naar";
                case eGA_LookAt: return "Bekijk";
                case eGA_TalkTo: return "Praat";
                case eGA_GiveTo: return "Geef";
                case eGA_PickUp: return "Pak";
                case eGA_Use: return "Gebruik";
                case eGA_Open: return "Open";
                case eGA_Close: return "Sluit";
                case eGA_Push: return "Duw";
                case eGA_Pull: return "Trek";
                default :
                    return "ERROR";
                    break;
            }
            break;   
        default :
                return "ERROR2";
                break;
    }
}

DynamicSprite* DrawString_Widened(int font, String text, int color,  int widenFactor )
{
    int kerning = 0;
    int wordSpacing = 2; //arbitrary number of pixels for the 'space' character, to make the text more compact
    int maxWidth = GetTextWidth(text, font)*3;
    int height = GetTextHeight(text,  font,  MAXTEXTWIDTH);
   
    //The width is a bit hard to calculate so we'll start by drawing onto a temporary surface
    DynamicSprite* temp_s = DynamicSprite.Create(maxWidth,  height, true);
    DrawingSurface* temp_ds = temp_s.GetDrawingSurface();
    temp_ds.Clear();
    int offset = 0;
    temp_ds.DrawingColor = color;
    //we draw each letter one by one
    for (int i=0; i<text.Length; i++) {
        if (text.Chars[i] == ' ') {
            offset+=wordSpacing;
           
        } else {
            String c = String.Format("%c", text.Chars[i]);
            int letterWidth = GetTextWidth(c, font);
            //the easiest way to widen a letter is to draw it several times
            for (int j=0; j < widenFactor; j++) {
                temp_ds.DrawString(offset+j, 0, font, c);
            }
            offset+=(letterWidth+widenFactor);
           
            //if it's not the last letter we add a white space after the letter
            if (i<text.Length-1)
                offset+=kerning;
        }
    }
   
    //now that we know the width we copy the temp sprite to a final sprite   
    DynamicSprite* s = DynamicSprite.Create(offset,  height, true);
    DrawingSurface* ds = s.GetDrawingSurface();
    ds.DrawSurface(temp_ds);
   
    temp_ds.Release();
   
    return s;
   
}

//Draws 'graphic' 9 times onto ds, in an "outlined" manner (i.e. with offsets of -1 to +1)
void DrawOutline(DrawingSurface*ds,  int x,  int y,  int graphic)
{
   ds.DrawImage(x-1, y-1, graphic);
   ds.DrawImage(x-0, y-1, graphic);
   ds.DrawImage(x+1, y-1, graphic);
   ds.DrawImage(x-1, y-0, graphic);
   ds.DrawImage(x-0, y-0, graphic);
   ds.DrawImage(x+1, y-0, graphic);
   ds.DrawImage(x-1, y+1, graphic);
   ds.DrawImage(x-0, y+1, graphic);
   ds.DrawImage(x+1, y+1, graphic);
}

//See more at https://www.adventuregamestudio.co.uk/forums/index.php?topic=42449.0
int[] GetRGBFromColor(int color)
{
    int rgb[] = new int[3];
    bool highBit = true; //or false, you decide

    if (color > 65535) color -= 65536;
    rgb[0] = ((color >> 11) & 31) << 3;
    rgb[1] = ((color >> 6) & 31) << 3;
    rgb[2] = (color & 31) << 3;
    if (highBit)
    {
        rgb[0] = rgb[0] | 7;
        rgb[1] = rgb[1] | 3;
        rgb[2] = rgb[2] | 7;
    }
 
    return rgb;
}

//from top to bottom, every color of 'ds' that has color 'color' will be replaced by a gradient
void noloopcheck ApplyGradient(DrawingSurface* ds, int color, int color_gradient_top, int color_gradient_bottom)
{
    int rgb_top[] = GetRGBFromColor(color_gradient_top);
    int rgb_bottom[] = GetRGBFromColor(color_gradient_bottom);
    float height_f = IntToFloat(ds.Height);
   
    float r_top = IntToFloat(rgb_top[0]); float r_bottom = IntToFloat(rgb_bottom[0]); float step_r = (r_bottom-r_top)/height_f;
    float g_top = IntToFloat(rgb_top[1]); float g_bottom = IntToFloat(rgb_bottom[1]); float step_g = (g_bottom-g_top)/height_f;
    float b_top = IntToFloat(rgb_top[2]); float b_bottom = IntToFloat(rgb_bottom[2]); float step_b = (b_bottom-b_top)/height_f;
   
    float r = r_top; float g = g_top; float b = b_top; //start values
    for (int j=0; j< ds.Height; j++) {
        ds.DrawingColor = Game.GetColorFromRGB(FloatToInt(r), FloatToInt(g),  FloatToInt(b));
       
        for (int i=0; i<ds.Width; i++) {
            if (ds.GetPixel(i, j)==color)
                ds.DrawPixel(i, j);
        }
       
        r+=step_r; g+=step_g; b+=step_b;
    }
}

DynamicSprite* GenerateButton(String text,  int width,  AutoButtonStates state,  int widenFactor,  int themeSettings[])
{
   
   int font = eFontTumbleText;
   
   //int COLOR_BLACK = Game.GetColorFromRGB(5, 5, 5);
   int COLOR_RED = Game.GetColorFromRGB(255, 0, 0);
   int color = COLOR_RED; //we give it a default value for satefy
   int color_gradient_top = COLOR_RED; //we give it a default value for satefy
   int color_gradient_bottom = COLOR_RED; //we give it a default value for satefy
   switch(state) {
       case eAutoButton_off :
        color = themeSettings[eAutoBSetting_color_off];
        color_gradient_top = themeSettings[eAutoBSetting_color_off_gradienttop];
        color_gradient_bottom = themeSettings[eAutoBSetting_color_off_gradientbottom];
        break;
       case eAutoButton_on :
        color = themeSettings[eAutoBSetting_color_on];
        color_gradient_top = themeSettings[eAutoBSetting_color_on_gradienttop];
        color_gradient_bottom = themeSettings[eAutoBSetting_color_on_gradientbottom];
        break;
       case eAutoButton_hover :
        color = themeSettings[eAutoBSetting_color_hover];
        color_gradient_top = themeSettings[eAutoBSetting_color_hover_gradienttop];
        color_gradient_bottom = themeSettings[eAutoBSetting_color_hover_gradientbottom];
        break;
       
       default:
        AbortGame("Unknown state");
   }
   //int width = constants.width;
   int height = constants.height;
   DynamicSprite* text_s = null;
   
   DynamicSprite* s = DynamicSprite.Create(width, height, true); 
   DrawingSurface* ds = s.GetDrawingSurface();
   //ds.DrawingColor = COLOR_TRANSPARENT;
   ds.Clear();
   
   //int textWidth = GetTextWidth(text, font); //we actually need the widened width
   int textHeight = GetTextHeight(text, font, MAXTEXTWIDTH);
   
   //(optional) colored rectangular background
   //ds.DrawingColor = Game.GetColorFromRGB(100, 100, 100);
   //ds.DrawRectangle(0, 0, width, height);
   
   //shadow
   text_s = DrawString_Widened(font, text, themeSettings[eAutoBSetting_color_shadow], widenFactor );
   int textWidth = text_s.Width;
   int offset_x = (width - textWidth)/2; if (offset_x < 0) offset_x = 0;
   int offset_y = (height - textHeight)/2;  if (offset_y < 0) offset_y = 0;
   DrawOutline(ds, offset_x+widenFactor, offset_y, text_s.Graphic);
   
   //outline (the cheapest way to do an outline is to draw the text 9 times with and offset of -1 or +1 all around
   text_s = DrawString_Widened(font, text, themeSettings[eAutoBSetting_color_outline], widenFactor );
    DrawOutline(ds, offset_x, offset_y, text_s.Graphic);
   //widened text. It returns a temporary sprite that we immediately copy onto our drawing surface
   text_s = DrawString_Widened(font, text, color, widenFactor );
   ds.DrawImage(offset_x,  offset_y, text_s.Graphic);
   
   //gradient
   ApplyGradient(ds, color,  color_gradient_top,  color_gradient_bottom);
   
   //finish up
   text_s.Delete();
   ds.Release();
   
   return s;
}

//this is purely built-in
//how much the text should be stretched horizontally (not all the same depending on the language and the action)
int GetWidenFactor(eLanguage lan,  Action a)
{
    switch(lan) {
        case eLangDE :
                    if (a==eGA_Close) //In German, "SchlieBe"'s font is narrower then the other buttons fonts
                        return 1;
                    else
                        return 2;
                    break;
        case eLangEN : return 2; break;
        case eLangES : return 1; break;
        case eLangFR : return 1; break;
        case eLangIT : return 1; break;
        case eLangNL : return 1; break;
        case eLangPT : return 1; break;

        default : AbortGame("Unknown language");
    }
}


//Utility : Returns the button bound to a given action. Unfortunately this function is not provided by Verbs
Button*  GetActionButton(Action a)
{
    //we scan every control
    for (int i=0; i<guiMain.ControlCount; i++) {
      GUIControl* c = guiMain.Controls[i];
      Button* b = c.AsButton;
      if (b!=null) {
          if (Verbs.GetButtonAction(b) == a)
            return b;
      }
    }
   
    //AbortGame("Couldn't find the button bound to action '%d'", a);
    return null; //Not all actions have a button. E.g. "walk to"
   
    //If it was implemented in Verbs we would just use this :
    //return Verbs.GetActionButton(a);
}


int GetButtonWidth(Action a) {
    /*
    //Somehow the automated code below doesn't work. buttons return goofy values, like b.Width == 200. I have no idea why.
    Button* b = GetActionButton(a);
    if (b!= null) {
        //Display("Action %d return button.ID=%d, which has width %d x height %d. It belongs to GUI %d. Name is '%s'", a,  b.ID,  b.Width, b.Height,  b.OwningGUI.ID,  b.Text);
        return b.Width;
    } else {
        return constants.width; //this action doesn't seem to have a button. We roll back to the default buttons width
    }
    */
   
    //Manual version. TODO : find why code above does not work.
    switch(a) {
        case eGA_LookAt :  return 56; //larger buttons in the central column
        case eGA_TalkTo :  return 56; //larger buttons in the central column
        case eGA_PickUp :  return 56;  //larger buttons in the central column
        default: return 50; //narrower buttons in th eleft and right column
    }
}

static int AutoButtons::GenerateAll(int themeSettings[])
{
    int NBSPRITES = NBACTIONS*NBLANGUAGES;
   
    //safety
    if (NBSPRITES > MAXAUTOBUTTONS)
        AbortGame("Did something change?");
   
    //Some languages have shorter words so we can make the text wider up to a factor of 3
    int widenFactor = 1;
   
    for (int i=0; i < NBLANGUAGES; i++) {
       
       
        for (int a = 0; a<NBACTIONS; a++) {
             widenFactor = GetWidenFactor(i,  a);
            int width = GetButtonWidth(a);
           
            buttons[i*NBACTIONS+a].widenFactor = widenFactor;
            buttons[i*NBACTIONS+a].width = width;
           
            String text = TranslateAction(a, i);
           
            buttons[i*NBACTIONS+a].lan = i;
            buttons[i*NBACTIONS+a].action = a;
            buttons[i*NBACTIONS+a].s[eAutoButton_off] = GenerateButton(text, width, eAutoButton_off, widenFactor, themeSettings);
            buttons[i*NBACTIONS+a].s[eAutoButton_on] = GenerateButton(text, width,  eAutoButton_on, widenFactor, themeSettings);
            buttons[i*NBACTIONS+a].s[eAutoButton_hover] = GenerateButton(text, width, eAutoButton_hover, widenFactor, themeSettings);
            buttons[i*NBACTIONS+a].text = text;
           
        }
    }
   
}


static DynamicSprite* AutoButtons::GetSprite(eLanguage lan,  Action action,  AutoButtonStates state)
{
    return buttons[lan*NBACTIONS+action].s[state];
}

static int AutoButtons::GetSpriteID(eLanguage lan,  Action action,  AutoButtonStates state)
{
    return buttons[lan*NBACTIONS+action].s[state].Graphic;
}

float min(float a,  float b) { if (a < b) return a; return b; }
float max(float a,  float b) { if (a > b) return a; return b; }
float bound(float a,  float roof,  float floor) { return min(roof, max(a, floor)); }

//this function returns a darker or brighter version of color 'color'.
// 'factor' between 0.0 and 2.0.
// - If factor is 0.0, the function returns black (because the color has been darkened to the max).
// - If it's 1.0, the color doesn't change
// - If factor is 2.0, the function probably returns white, or at least 'color" is now twice brighter
int ChangeBrightness(int color,  float factor)
{
    int rgb[] = GetRGBFromColor(color);
    float r = IntToFloat(rgb[0]); float g = IntToFloat(rgb[1]); float b = IntToFloat(rgb[2]);
    rgb = null;
    r = bound(r*factor, 255.0,  0.0); g = bound(g*factor, 255.0,  0.0); b = bound(b*factor, 255.0,  0.0);
    return Game.GetColorFromRGB(FloatToInt(r), FloatToInt(g),FloatToInt(b));
}

int[] GetTheme_BuiltIn(AutoButtonThemes theme)
{

    //useful values
    int COLOR_RED = Game.GetColorFromRGB(255, 99, 99);
    int COLOR_BROWN = Game.GetColorFromRGB(50, 0, 0);
    int COLOR_YELLOW = Game.GetColorFromRGB(255, 249, 72);
    int COLOR_GRAYISHRED = Game.GetColorFromRGB(116, 63, 63);
    int COLOR_DARKGRAYISHRED = Game.GetColorFromRGB(52, 32, 32);
    int COLOR_BLACK = Game.GetColorFromRGB(5, 5, 5);
   
    int themeSettings[] = new int[THEMESIZE];
   
    switch (theme) {
        case eAutoButtonTheme_Red :

   
            themeSettings[eAutoBSetting_color_off] = COLOR_RED;
            themeSettings[eAutoBSetting_color_on] = COLOR_YELLOW;
            themeSettings[eAutoBSetting_color_hover] = COLOR_BROWN;
            themeSettings[eAutoBSetting_color_outline] = COLOR_GRAYISHRED;
            themeSettings[eAutoBSetting_color_shadow] = COLOR_BLACK;
           
            /*
            //MANUAL
            themeSettings[eAutoBSetting_color_off_gradienttop] =            Game.GetColorFromRGB(255, 175, 175);
            themeSettings[eAutoBSetting_color_off_gradientbottom] =         Game.GetColorFromRGB(200, 0, 0);
            themeSettings[eAutoBSetting_color_on_gradienttop] =             Game.GetColorFromRGB(255, 249, 125);
            themeSettings[eAutoBSetting_color_on_gradientbottom] =          Game.GetColorFromRGB(200, 200, 25);
            themeSettings[eAutoBSetting_color_hover_gradienttop] =          Game.GetColorFromRGB(100, 50, 50);
            themeSettings[eAutoBSetting_color_hover_gradientbottom] =       Game.GetColorFromRGB(25, 0, 0);
            */
            //AUTOMATED
            themeSettings[eAutoBSetting_color_off_gradienttop] =            ChangeBrightness(themeSettings[eAutoBSetting_color_off],  1.5);
            themeSettings[eAutoBSetting_color_off_gradientbottom] =         ChangeBrightness(themeSettings[eAutoBSetting_color_off],  0.5);
            themeSettings[eAutoBSetting_color_on_gradienttop] =             ChangeBrightness(themeSettings[eAutoBSetting_color_on],  1.5);
            themeSettings[eAutoBSetting_color_on_gradientbottom] =          ChangeBrightness(themeSettings[eAutoBSetting_color_on],  0.5);
            themeSettings[eAutoBSetting_color_hover_gradienttop] =          ChangeBrightness(themeSettings[eAutoBSetting_color_hover],  1.5);
            themeSettings[eAutoBSetting_color_hover_gradientbottom] =       ChangeBrightness(themeSettings[eAutoBSetting_color_hover],  0.5);
           

            break;
           
        case eAutoButtonTheme_Blue :
            AbortGame("NOT IMPLEMENTED (suit yourself)");
           
            break;
    }
   
    return themeSettings;
}

static int[] AutoButtons::GetTheme(AutoButtonThemes theme)
{
    int themeSettings[] = new int[THEMESIZE];
   
    if (theme < 0 || theme >= MAXTHEMES)
        AbortGame("Not a valid theme number : %d", theme);
   
    for (int i=0; i< THEMESIZE; i++) {
        themeSettings[i] = themes[theme].settings[i];
    }
   
    return themeSettings;
}

//Overwrite an existing theme from your game, without requiring to temper with the module's script (if needed)
static void AutoButtons::SetTheme(AutoButtonThemes theme,  int themeSettings[])
{
    if (theme < 0 || theme >= MAXTHEMES)
        AbortGame("Not a valid theme number : %d", theme);
   
    for (int i=0; i< THEMESIZE; i++) {
        themes[theme].settings[i] = themeSettings[i];
    }
}



void game_start()
{
    //depends on your game
    guiMain = gMain; //this is a dirty hack. we should rely only on "Verbs" methods but it doesn't offer GetActionButton.
   
    //nbThemes = 0;
    defaultTheme = eAutoButtonTheme_Red;
   
    //Init buttons constant width. This is normally ignored and replaced with buttons[].width because not all buttons have the same width
    constants.height = BUTT_HEIGHT;
    constants.width = BUTT_WIDTH;

    //Init built-in themes
    int themeSettings[] = GetTheme_BuiltIn(eAutoButtonTheme_Red);
    AutoButtons.SetTheme(eAutoButtonTheme_Red,  themeSettings);
    //themeSettings[] = GetTheme_BuiltIn(eAutoButtonTheme_Blue);
    //AutoButtons.SetTheme(eAutoButtonTheme_Blue,  themeSettings);
   
    //final init
    themeSettings = AutoButtons.GetTheme(defaultTheme);
    AutoButtons.GenerateAll(themeSettings);
}




Here is how to make it work with Tumbleweed :
(locate the code below in your Tumbleweed initialization code)
Code (ags) Select

      // English - eLangEN 
      /*
        //WITHOUT AUTOBUTTONS : Set button graphics manually
        odd_id=1407; even_id = odd_id+1;
        Verbs.LocalizeActionButton(eLangEN,eGA_Open,    GetOddId(), GetEvenId(), 'q');
        Verbs.LocalizeActionButton(eLangEN,eGA_Close,   GetOddId(), GetEvenId(), 'a');
        Verbs.LocalizeActionButton(eLangEN,eGA_GiveTo,  GetOddId(), GetEvenId(), 'z');
        Verbs.LocalizeActionButton(eLangEN,eGA_Push,    GetOddId(), GetEvenId(), 'e');
        Verbs.LocalizeActionButton(eLangEN,eGA_Pull,    GetOddId(), GetEvenId(), 'd');
        Verbs.LocalizeActionButton(eLangEN,eGA_Use,     GetOddId(), GetEvenId(), 'c');
        Verbs.LocalizeActionButton(eLangEN,eGA_PickUp,  GetOddId(), GetEvenId(), 'w');
        Verbs.LocalizeActionButton(eLangEN,eGA_LookAt,  GetOddId(), GetEvenId(), 's');
        Verbs.LocalizeActionButton(eLangEN,eGA_TalkTo,  GetOddId(), GetEvenId(), 'x');
      */
        //WITH AUTOBUTTONS : Get the sprites IDs from the module; it generated thems for you.
        eLanguage lan = eLangEN; int graphic_off; int graphic_on; Action a;
        a = eGA_Open;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'q');
       
        a = eGA_Close;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'a');
       
        a = eGA_GiveTo;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'z');
       
        a = eGA_Push;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'e');
       
        a = eGA_Pull;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'd');
       
        a = eGA_Use;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'c');
       
        a = eGA_PickUp;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'w');
       
        a = eGA_LookAt;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 's');
       
        a = eGA_TalkTo;
        graphic_off = AutoButtons.GetSpriteID(lan, a, eAutoButton_off);
        graphic_on = AutoButtons.GetSpriteID(lan, a, eAutoButton_on);
        Verbs.LocalizeActionButton(lan, a,    graphic_off, graphic_on, 'x');
       

[close]
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Flugeldufel on Wed 06/02/2019 14:28:17
First of all: Thank you, abstauber for this nice template! Gefällt mir! ;)

I'm currently working on my first game and I changed some GUIs and sprites to match my taste. Among others I replaced the verbs with the ones shown in the screenshot.
Now I'm not sure, if (when I release this game sometime) I might get problems because it looks too similar to the original Thimbleweed-verbs. (although I drew them totally new for that low resolution, 320x180)

Should I change it? What do you all think?  ???

(https://imgur.com/7f8UljA.jpg)

Here's a comparison of both:

mine:

(https://imgur.com/me9izXm.jpg)


Thimbleweed Park:

(https://imgur.com/jyRKumW.jpg)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Mon 11/02/2019 08:33:19
Wow, those graphics look really nice!

Well the button font is quite close to the one of Thimbleweed Park - I'd say if you go commercial, you might want to go for a more independet route.

But if it's freeware I don't see any issues at all - the font (also the color) fits your game perfectly (as far as I can tell from your background)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: Flugeldufel on Mon 11/02/2019 10:00:32
Thank you very much for your feedback! And you confirmed what I already thought.
I don't know, if it's going to be freeware or commercial - it will depend on how complex the game will finally be, full length or not... We'll see. It's still at an early stage.
So I think I'll keep the sprites for now and maybe make some new ones later.

By the way, I would give the actual sprites to anyone who's interested in using them. Just let me know...
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: croquetasesina on Thu 28/03/2019 12:29:57
Is it possible to save more than nine games?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.1 Last update: 3rd August 2018
Post by: abstauber on Thu 04/04/2019 09:10:41
Yes, out of the box, you are stuck with nine games. But you can of course extend the save/load gui to your liking: you just need to add more save/load buttons and tell the optiongui script about it.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: abstauber on Thu 04/04/2019 09:31:57
Maybe it's time to finally declare 1.2 to be stable.  (nod)

This is mainly a refactoring release, no new functions have been added so far. But internally the template has changed a lot.

- cleaned up the global script (moved the remaining GUI actions to the options menu module)
- Localisation of the GUI elements is handled a bit different internally
- It's possible to change the GUIs being used by the template
- Some more refactoring, the template throws errors if a module is missing.
- Bugfix: Option GUI wasn't translated if English is not set as default language

Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: Crimson Wizard on Tue 30/04/2019 09:57:11
Hello, I'd like to report a bug.

Preferably performed in larger rooms for convenience:
* Have room 1 and room2;
* In room 2 script cutscene where player's character is walking non-blocking in After Fade-in event
Code (ags) Select

player.Walk(x,y,eNoBlock);
while (player.Moving) Wait(1);

* Run the game, and when in room 1 start running with double-click;
* Immediately press Ctrl+X and change to room 2.

The player character will continue running during cutscene in another room.

Thinking about it, maybe it's enough to just run a cutscene in the same room. Guess the mistake is that character keeps running even when another Walk is called by a script command, even though it may not be required.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: abstauber on Tue 30/04/2019 11:01:37
Hi and thanks for the bugreport.

I think, that this is because I check the running in repexec and not repexec always. An easy thing to mitigate this for room changes would be to stop running, everytime you change a room. Also by using CTRL-X you're cheating a bit, as I'm checking for 'regular' room changes at line VerbGui.asc:2519 ;)

Running is also cancelled by every new mouseclick, so for this to happen you need to trigger a cutscene while the player is running without any other interaction or event. And the game designer would not stop the player from moving. The question is: how to detect such a cutscene.
I could use Game.InSkippableCutscene, but this would leave out unskipable cutscenes. Maybe a solution would be simply to add a StopRunning command which you would call in a cutscene

I'd love to get some more input on this.

Anyway to stop running also via CTRL-X room changes, this should do the trick
VerbGui.asc:2181

function on_event(EventType event, int data)
{
  if (event == eEventEnterRoomBeforeFadein) {
    Verbs.CheckDefaultAction();
    Verbs.UpdateActionBar();
   
    verbsData.player_is_running = false;
    player.StopMoving();
    player.SetWalkSpeed(verbsData.player_walk_x_speed,  verbsData.player_walk_y_speed);
    player.AnimationSpeed = verbsData.player_ani_speed;
  }
 
  else if (event==eEventRestoreGame) {
    //Verbs.AdjustLanguage();
    Verbs.InitGuiLanguage();
  }
}
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: StickGrinder on Tue 13/08/2019 23:07:39
Hello abstauber.

After lurking here for some time now I discovered this new template and decided to register to the forum just to say THANK YOU!.
I was trying to deconstruct the included 9-Verb MI interface this afternoon, not realizing it was maintained out of AGS itself and here we are with this successor that at a first glance is a big leap forward.
Can't wait to deep dive into it tomorrow.

EDIT: I read through the documentation and tested the template and I have two questions:

1. Is there any documentation about the inner working of the translations (i.e. contributors guidelines or such) that explains how and why they are addressed in that way?

2. Given TWP and pretty all modern game are built for widescreens, isn't it better to provide a 356x200 resolution out of the box instead of sticking with good old 320x200?

Thanks for your effort (all the contributors) and I hope I'll have something to show based on your work soon!
Cheers
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: abstauber on Wed 14/08/2019 09:28:21
Thanks a lot, I hope you'll have fun with AGS and the template.
I'm afraid I'm still a sucker for the old resolutions, besides there are a lot of devices out there with a non 16:9 aspect ratio out there (Macbooks, Surface devices, Phones etc). So I'd like to keep the retro standard for now :)

As for the translations:
(bottom of the page)
https://github.com/dkrey/ags_tumbleweed/blob/master/doc/9verb_intro.rst

https://github.com/dkrey/ags_tumbleweed/blob/master/doc/9verb_translation.rst
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: StickGrinder on Wed 14/08/2019 14:03:57
I see your point about resolution.

What's your position about derivative works? I mean, what if I commit to maintain a forked version of your Tumbleweed which defaults to widescreen devices?
Or possibly a sort of "add-on" package with pre-made WS assets?

I understand it's FOSS but I don't want to offend any unwritten rule of AGS community, nor you personally in any way.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: abstauber on Wed 14/08/2019 15:03:33
I think nobody has a problem with keeping or maintaining forks of the template.
Yet I can't imagine that 320x200 puts anybody off because of it's aspect ratio. Changing the resolution of a gameproject should be matter of minutes and art assets have to be created anyway.

Do you intend to maintain templates for 200p, 720p and 1080p? I could image that all this work wouldn't be worth it..
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: StickGrinder on Wed 14/08/2019 18:23:42
First of all, my apologies for the confusion: I was actually thinking about aspect ratio, not resolution, as you correctly pointed out.

That said, my opinion is that starting widescreen right out should add to the perception of something that can fit a modern production, not just emulating the golden era. Going 16:9 was also a choice that Terrible Toybox did for the referenced game, so that it kinda feels (https://youtu.be/KgzWorfLjeE?t=1236) like a game from the 90s but it leverages what devices can do now.

The very good example by Fluegeldufel some post above shows that there should be interest in widescreen games after all :)
But of course I don't think anybody will put off by this template to be 4:3! It was just to help newcomers like me hit the ground running.

But most of all: I'm totally aware that those are my speculations and perceptions, probably not even worth the proverbial 2 cents.
If you or someone else in the community see any value in contributing this, I'm happy to help. If not, I'm happy to help anyway (stopping bothering you with my blurb)!  :grin:

Thanks again for your work and kind help, this template is so much cleaner and easy to grasp than the former one to someone like me!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: Crimson Wizard on Wed 14/08/2019 18:55:31
Quote from: StickGrinder on Wed 14/08/2019 18:23:42
But of course I don't think anybody will put off by this template to be 4:3! It was just to help newcomers like me hit the ground running.

To be fair, this template is not 4:3, 320x200 is actually 16:10.

Of course it may be worth to stress out (in the manual or template's documentation) that user does not have to stick to template's resolution or aspect ratio; a well made template is resolution independent (and I believe this one is).

PS. With the upcoming AGS 3.5.0 release it's even possible to change game resolution while keeping all original demo assets, because it now allows to have rooms smaller than game res and, for example, center them on wider game screen.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.2 Last update: 4th April 2019
Post by: StickGrinder on Wed 14/08/2019 18:59:45
Quote from: Crimson Wizard on Wed 14/08/2019 18:55:31
To be fair, this template is not 4:3, 320x200 is actually 16:10.

One more reason to stop jabbering and leave things as they are :)
Thanks
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: abstauber on Fri 27/12/2019 19:43:15
*bump*
Just released a new version with added compatibility for AGS 3.5

Oh, and I just noticed that I am maintaining these templates for over 10 years  :shocked:
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Monsieur OUXX on Mon 27/01/2020 15:00:28
Quote from: abstauber on Fri 27/12/2019 19:43:15
I just noticed that I am maintaining these templates for over 10 years  :shocked:

And you're doing a great job. You've saved me tens of hours of coding, for a sexy result.

I want to report that in font "tumbletext" (and TumbleTextOutline I imagine), special character "ç" is misaligned vertically. The "c" should be aligned like a normal c, and the thingie should dangle underneath it, lower than the line. A bit like a "j".
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Khris on Fri 17/04/2020 14:09:33
Small bug report:

import InventoryItem*ItemGiven; (https://github.com/dkrey/ags_tumbleweed/blob/master/GlobalScript.asc#L2) in GlobalScript.asc should probably be removed, and the documentation PDF about using the Give verb should use  Verbs.GetItemGiven()  instead of  ItemGiven.

Details in this thread: https://www.adventuregamestudio.co.uk/forums/index.php?topic=57962.0
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Monsieur OUXX on Thu 30/04/2020 22:32:25
A minor bug in the custom dialogs : There's no "scroll to top" after selecting a dialog option. Which means that if you click on, let's say, option 5, then the next time some options are displayed they will still be scrolled down. It's a bit awkward.

I fixed it like this (by the way, somehow the RunActiveOption was filtered out for the mouse wheel scrolling but not the plain old mouse click scrolling. I changed that too)

Code (ags) Select

function dialog_options_mouse_click(DialogOptionsRenderingInfo *info, MouseButton button)
{

  CDG_Arrow uparrow;
  CDG_Arrow downarrow;
  int i;

  // Up-Arrow coordinates
  uparrow.x1 = info.X + CDG_options.uparrow_xpos;
  uparrow.y1 = info.Y + CDG_options.uparrow_ypos ;
  uparrow.x2 = uparrow.x1 + Game.SpriteWidth[CDG_options.uparrow_img];
  uparrow.y2 = uparrow.y1 + Game.SpriteHeight[CDG_options.uparrow_img];

  // Down-Arrow coordinates
  downarrow.x1 = info.X + CDG_options.downarrow_xpos;
  downarrow.y1 = info.Y + CDG_options.downarrow_ypos ;
  downarrow.x2 = downarrow.x1 + Game.SpriteWidth[CDG_options.downarrow_img];
  downarrow.y2 = downarrow.y1 + Game.SpriteHeight[CDG_options.downarrow_img];
 
//MODIFIED BY SEVEN CITIES - START
  bool isClickScrollUp = ((mouse.x >= uparrow.x1 && mouse.y >= uparrow.y1) &&
                         (mouse.x <= uparrow.x2 && mouse.y <= uparrow.y2))||
                         (button == eMouseWheelNorth && CDG_options.mousewheel);
       
  bool isClickScrollDown = ((mouse.x >= downarrow.x1 && mouse.y >= downarrow.y1) &&
                          (mouse.x <= downarrow.x2 && mouse.y <= downarrow.y2)) ||
                          (button == eMouseWheelSouth && CDG_options.mousewheel);
//MODIFIED BY SEVEN CITIES - END

  // scroll up
  if (isClickScrollUp) {
        i=0;
       
        while (i<CDG_options.scroll_rows)
        {
          if (CDG_options.scroll_from >1) CDG_options.scroll_from --;
          dialog_options_render(info);         
          i++;
        }
  }
  // scroll down
  else if (isClickScrollDown) {
     
      i=0;
      while (i<CDG_options.scroll_rows)
      {     
        if (CDG_options.scroll_to != CDG_options.active_options_count-1) {
          dialog_options_render(info);
          CDG_options.scroll_from ++;
        }
        i++;
      }
  }

  info.Update();
 
 
//MODIFIED BY SEVEN CITIES - START
  //if (button != eMouseWheelSouth && button != eMouseWheelNorth) info.RunActiveOption();
 
  if (!isClickScrollDown && !isClickScrollUp){
    CDG_options.scroll_from = 0; // Scroll to top
    info.Update();
    info.RunActiveOption();
  }
 
//MODIFIED BY SEVEN CITIES - END
}

Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Monsieur OUXX on Thu 07/05/2020 12:41:19
A small improvement but very convenient :

VerbsGui.ash

Code (ags) Select

enum eObjectType {
  eGizmo, //use this type for regular-sized objects. Usually, objects that the player could physically pick up but doesn't need.
  eHeavy,  //use this type for objects that are too heavy to pickup/push/pull
  eCharacter, //appropriate responses to silly attempts like "opening" a human being.
  eDoor //similar to eHeavy but slightly more specific in regards to open/close/use
};

  // START MODIFICATION
  //import static void Unhandled(int door_script=0);
  import static void Unhandled(eObjectType objType = eGizmo,  int door_script=0); //I've put the new parameter first because you use it much more often
  // END



VerbsGui.asc
Code (ags) Select

// START MODIFICATION
//static void Verbs::Unhandled(int door_script)
static void Verbs::Unhandled(eObjectType objType, int door_script)
// END
{


Then of course don't forget to update any call to Verbs.Unhandled in the template. When in doubt use eGizmo.
And of course don't forget to add all the new strings to verbsData.unhandled_strings. To sort them easily, you may get inspiration from these values :

Your own module
Code (ags) Select

bool moduleInitialized = false;


String defaultSentence_Pull     ;
String defaultSentence_Push     ;
String defaultSentence_Give     ;
String defaultSentence_Interact ;
String defaultSentence_Look     ;
String defaultSentence_PickUp   ;
String defaultSentence_Talk     ;
String defaultSentence_UseInv   ;
String defaultSentence_Open     ;
String defaultSentence_Close    ;


function InitializeModule() {

  //unfortunately AGS script does not allow to initialize a default
  //String's value at declaration. We are forced to do it here
 
  //universal sentences for any object in the entire game
  defaultSentence_Pull     = "I can't pull that.";
  defaultSentence_Push     = "I can't push that.";
  defaultSentence_Give     = "That just won't work.";
  defaultSentence_Interact = "I don't know what to do.";
  defaultSentence_Look     = "I see nothing special about it.";
  defaultSentence_PickUp   = "Why would I want to pick that up?";
  defaultSentence_Talk     = "I shouldn't start talking to things.";
  defaultSentence_UseInv   = "That won't work.";
  defaultSentence_Open     = "I can't open that.";
  defaultSentence_Close    = "I can't close that.";
   
  moduleInitialized = true; //make sure we don't call it again
}


//makes sure that all the relevant module stuff is initialized
function checkInitialized() {
   //at first call
  if (!moduleInitialized)
    InitializeModule();
 
}

String FindWontWorkSentence() {
  String wontWork[10];
  wontWork[0] = "That won't work.";
  wontWork[1] = "I don't think that will work.";
  wontWork[2] = "Nu-uh.";
  wontWork[3] = "No.";
  wontWork[4] = "Nope.";
  wontWork[5] = "That's silly.";
  wontWork[6] = "Why would I try that?";
  wontWork[7] = "I'll have to think of something more useful.";
  wontWork[8] = "No way.";
  wontWork[9] = "I can't figure it out."; 
 
  return wontWork[Random(9)];
}


String FindWontGiveSentence() {
  String wontGive[4];
  wontGive[0] = "I'd rather keep that to myself.";
  wontGive[1] = "I won't give that away.";
  wontGive[2] = "Bad idea.";
  wontGive[3] = "Let's keep that to myself.";
 
  return wontGive[Random(3)];
}

String Sentence(Action_7CoG mode, eObjectType objectType) {
  checkInitialized();
 
  String sentence = "ERROR : no sentence returned.";
 
  if (objectType == eGizmo) { //See the definition of "eGizmo" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = defaultSentence_Pull;               //Pull
    else if (mode == eGA_7CoG_Push) sentence = defaultSentence_Push;          //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();          // Give
    else if (mode == eGA_7CoG_Use) sentence = FindWontWorkSentence();  // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;        // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "I don't need that.";        // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;        // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = FindWontWorkSentence();      // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;          // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;        // Useinv 
    else sentence = String.Format("Unknown mode : %d",mode);
  } else if   (objectType == eHeavy) { //See the definition of "eHeavy" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = "It's too heavy to pull it";                  //Pull
    else if (mode == eGA_7CoG_Push) sentence = "It's too heavy to push it";             //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();                    // Give
    else if (mode == eGA_7CoG_Use) sentence = "Let it be.";                        // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;                  // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "I can't pick up something that big!"; // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;                  // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = defaultSentence_UseInv;                // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;                    // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;                  // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode);
  } else if   (objectType == eCharacter) { //See the definition of "eHeavy" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = "Violence is not a solution here.";               //Pull
    else if (mode == eGA_7CoG_Push) sentence = "I don't just push people around.";          //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();                      // Give
    else if (mode == eGA_7CoG_Use) sentence = "I don't randomly touch people.";        // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;                      // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "Yes, why don't I just carry everybody around on my back?";      // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;                      // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = defaultSentence_UseInv;                    // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = "You mean, open that person with a knife or something?";      // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = "That doesn't make sense.";                 // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode);
  } else if   (objectType == eDoor) { //See the definition of "eDoor" in the Enum declaration
    if (mode == eGA_7CoG_Pull) sentence = "It's too heavy to pull it";                  //Pull
    else if (mode == eGA_7CoG_Push) sentence = "It's too heavy to push it";             //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();                    // Give
    else if (mode == eGA_7CoG_Use) sentence = "Let it be.";                        // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;                  // Look
    else if (mode == eGA_7CoG_PickUp) sentence = "I can't pick up something that big!"; // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;                  // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = defaultSentence_UseInv;                // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;                    // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;                  // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode);
  } else { //the most possible generic sentences
    if (mode == eGA_7CoG_Pull) sentence = defaultSentence_Pull;               //Pull
    else if (mode == eGA_7CoG_Push) sentence = defaultSentence_Push;          //Push
    else if (mode == eGA_7CoG_GiveTo) sentence = FindWontGiveSentence();          // Give
    else if (mode == eGA_7CoG_Use) sentence = defaultSentence_Interact;  // Interact
    else if (mode == eGA_7CoG_LookAt) sentence = defaultSentence_Look;        // Look
    else if (mode == eGA_7CoG_PickUp) sentence = FindWontWorkSentence();      // Pickup
    else if (mode == eGA_7CoG_TalkTo) sentence = defaultSentence_Talk;        // Talk
    else if (mode == eGA_7CoG_UseInv) sentence = FindWontWorkSentence();      // Useinv   
    else if (mode == eGA_7CoG_Open) sentence = defaultSentence_Open;          // Useinv   
    else if (mode == eGA_7CoG_Close) sentence = defaultSentence_Close;        // Useinv   
    else sentence = String.Format("Unknown mode : %d",mode);
  }
 
  return sentence;
}




Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Elvis Tanner on Tue 01/09/2020 17:56:36
Is it possible to set the default gui style to "classic"?
In the manual I read about using ToogleGuiStyle to switch between classic and new mode but frankly, I have no idea how to do it... :confused:
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Khris on Tue 01/09/2020 18:36:02
Check this thread for a possible solution: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58324.0
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Elvis Tanner on Wed 02/09/2020 06:27:59
Setting the default gui layout to "classic" worked like this:


Verbs.ToogleGuiStyle(0); //sets gui style to classic
sldOptionsStyle.Value = 0 //sets slider for layout in options menu to classic


Many thanks to Khris for pointing me in the right direction.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Monsieur OUXX on Tue 13/10/2020 19:15:56
A German speaker told me that this was not correct :
Quote
Musik Lautstärke
Sound Effekte

...but this was correct :
Quote
Musiklautstärke
Soundeffekte

I cannot assert the truth of his sayings but I'm reporting it.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Olleh19 on Tue 20/10/2020 22:40:04
If anybody knows how to get abstauber on the forum again, please tell him to come online. I've fixed the Swedish Verbs and they are just waiting to be added to the template.
It's very selfish ofc since i wanna use them, but it's good for other Swede's too if there are any on here. (laugh)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Cassiebsg on Tue 20/10/2020 22:43:11
There are at least 3 others, that I know, that post regularly... and some others that post occasionally. And probably a few bunch lurkers as well.  ;)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Olleh19 on Tue 20/10/2020 22:46:42
Quote from: Cassiebsg on Tue 20/10/2020 22:43:11
There are at least 3 others, that I know, that post regularly... and some others that post occasionally. And probably a few bunch lurkers as well.  ;)

Good to know, here's a personal greeting to them.  :)

Va i helvete grabbar, hjälp mig fÃ¥ fart pÃ¥ joysticken och verbsen. Verbsen sitter inte fast i config  varje gÃ¥ng man resetar spelet, sÃ¥ därför vore det ju bra om abstauber kunde dyka upp och fixa det. Verkar vara nÃ¥got lurt.  8-0
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: morganw on Wed 21/10/2020 18:08:56
Quote from: Olleh19 on Tue 20/10/2020 22:40:04
I've fixed the Swedish Verbs and they are just waiting to be added to the template.
Which files need to be modified to fix it?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Olleh19 on Wed 21/10/2020 18:44:31
Quote from: morganw on Wed 21/10/2020 18:08:56
Quote from: Olleh19 on Tue 20/10/2020 22:40:04
I've fixed the Swedish Verbs and they are just waiting to be added to the template.
Which files need to be modified to fix it?

I wished i knew the answer. I believe it's something with the language needs to be written to a config file while it has been choosen, so the game "remembers" it. It does not remember my custom language Verbs, but all the other languages graphic Verbs are remembered. I have tried to explain this in beginners forum, but it's hard. I hope you get the "issue".
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: morganw on Fri 23/10/2020 00:09:44
I've never made translation, so I found it a little difficult to follow. Are you adding Swedish to the template or fixing Swedish that was already there?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Olleh19 on Fri 23/10/2020 00:31:55
Quote from: morganw on Fri 23/10/2020 00:09:44
I've never made translation, so I found it a little difficult to follow. Are you adding Swedish to the template or fixing Swedish that was already there?


Here is what i have done. Open a Thumbleed new project, and replace the Verbs gui scripts with this, that's all i've done. The Quit game = Avsluta spel (Swedish), all such things is in the Verbs.Gui, done by me. All Swedish = Done by me.
I think you get the issue, once you see the scripts (hopefully).
See if you can discover why the Swedish Verb Sprites do not stay on screen, while the others do, cause i dont know why.
Everytime i have to call this in either a Gui, or Globalscripts start:

Code (ags) Select

Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangSE;
Verbs.LocalizeActionButton(eLangSE, eGA_Open, 485, 486, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_Close, 487, 488, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_GiveTo, 489, 490, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_Push, 491, 492, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_Pull, 493, 494, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_Use, 495, 496, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_PickUp, 497, 498, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_LookAt, 499, 500, 's');
Verbs.LocalizeActionButton(eLangSE, eGA_TalkTo, 501, 502, 's');

I'm "missing something", it could ofc be other scripts, i've only added Swedish code, where i saw there were other languages code, "basic logic" there. Or if the code should go elsewhere to "get it to stay inside the template". However big warning now ofc.
The sprites need to be added again into "your" basic template, so the numbers of the sprites that i have written needs to be replaced with new valid sprite numbers.

http://www.mediafire.com/file/9z433isgz3cchvk/Swedish.zip/file
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: morganw on Fri 23/10/2020 17:25:06
I have some time off work next week, so perhaps I can take a look then and try to work out what is going on.
Thanks for uploading the scripts and images.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Olleh19 on Fri 30/10/2020 00:41:12
Quote from: morganw on Fri 23/10/2020 17:25:06
I have some time off work next week, so perhaps I can take a look then and try to work out what is going on.
Thanks for uploading the scripts and images.

I am the one who should say thanks! This forum has been incredible so far. All the help one gets.
Almost feel bad, i can't give anything back, as of yet! (laugh)
I wish you the best of luck with it. It would be really nice to be able to set it to my native language, but it's not a must ofc.

If you do manage to fix it, you will get free hintline call 24h if you get stuck (in the future game that is).
8-)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: viktor on Tue 10/11/2020 09:18:43
Hy guys,

I was just wondering if there is any way of repositioning the verb that shows up in classic mode. I need to position it 2 or 3 pixels higher because it's in the way of my verb GUI design.

(https://i.ibb.co/HFN8YvY/Screenshot-1.png)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: Monsieur OUXX on Tue 10/11/2020 12:33:27
Quote from: viktor on Tue 10/11/2020 09:18:43
Is there a way of repositioning the verb that shows up in classic mode.

Let's avoid cluttering this thread. I suggest you ask the question in the Beginners Questions thread : "how to move a GUI?". Hint : Try to locate the exact GUI (and label inside the GUI) that displays that text on the screen. You'll find it in the "GUI" folder of your AGS Editor. It probably contains the word "action" or the word "status" (just a guess)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: croquetasesina on Wed 10/03/2021 20:31:32
Could you give me a hand? I would like to load the default GUI into the classic style, but I can’t find a way. I would appreciate your help!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: selmiak on Sat 30/10/2021 19:30:04
is this plugin still maintained?
The save system it uses has an error, look at this, found by horusr in the Lucas Mendoza Demo
(https://cdn.discordapp.com/attachments/221048119637311489/903625424897208380/unknown.png)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: abstauber on Sun 15/05/2022 21:24:00
Quote from: selmiak on Sat 30/10/2021 19:30:04
is this plugin still maintained?

Sorry for letting you down. At least for the moment it seems that I can actually push a few hours into AGS related stuff.

There has been some activity lately:

In the github repo, you'll find a release-3.5.1 branch and a master branch, which is 3.6 only - the changes are present in both branches.

I think I'll upload a proper release for 3.5.1 in the next couple of days. For now you can of course checkout the files in the repo.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: AndreasBlack on Tue 17/05/2022 09:25:58
Looking in the manual, i can't see the solution, at least not an example of it, not in the demo template either.  8-0 It's very basic usually, but this time it's different, cause i don't know where to put the function!
I'm unlocking a door with a key using your Doors syntax, setting up the doors room firstload, etc. Works just like in your demo. But the demo missed the losing the key after it's been used in the door.
Now i want to drop the key forever from the inventory. How do i do this? player.Loseinventory(iKey); doesn't cut it, or maybe it does but question is where it should be put

I've tried various solutions, timers, etc. Either it drops the key before opening the door, or it drops the key afterwards but the key magically appears in the item box again for a millisecond and then goes away when re-entering the room, really odd! Almost as if the Sheriff a-reno has got something to do with it.  ;)

Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: abstauber on Tue 17/05/2022 12:03:40
I haven't tried it, but this should work. In the door script itself you can always check, if an item should be removed or not.

Around line 2265 in verbs.asc:
https://github.com/dkrey/ags_tumbleweed/blob/772b28ef9ac3b7eb7e3b081c3510f4a47404c414/verbgui.asc#L2265

Code (ags) Select
         
        else if (Doors.GetDoorState(door_id) == 2 ) {
          if (verbsData.unlockDoorSound != null) chan = verbsData.unlockDoorSound.Play();
          if (!String.IsNullOrEmpty(verbsData.door_strings[eDoorStringUnlock])) player.Say(verbsData.door_strings[eDoorStringUnlock]);
         
          if (player.ActiveInventory == iFragileKey) player.Loseinventory(iFragileKey);
         
          Doors.SetDoorState(door_id, closevalue);
        }


But I must admit, from a designers point of view, this solution is subpar. It way cleaner and easier to maintain your code if you leave the template code unchanged und put your game logic in rooms scripts or separate modules.
That way you can safely update the template without loosing all your hacks and customisation.

Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: AndreasBlack on Tue 17/05/2022 14:30:19
I'm probably messing something up with having multiply keys in the same room that goes to different doors. One door works, the other semi works. It opens the door, the inventory goes away, but then it comes back when re-entering. Looks like a bugg to the untrained eye, but it's probably not. I've set up the roomload_first wrong possibly. Not a coder, so i'm not sure. In the beginners thread btw

Anyway enough about that. I had a suggestion before. That if a player has choosen an dialog option before, that it is greyed out the next time it shows up! Would you be able to add that feature as a bool thing? Would be awesome!
Also when running when using the uniformmovementspeed false/movementlinkedtoanimat/false the doubleclick does not seem to reset sometimes, so i did a little amateur fix for it in a rep execute code i run, no big deal ofc. Just wanted to let you know, perhaps it's been fixed, i think i'm using a older version of the template. To scared to update  (laugh)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: abstauber on Tue 17/05/2022 14:55:06
Well, the last bugfix regarding running via doubleclick is from 2018. So I'm sure, if you started using the template afterwards you should be fine.
Nonetheless I see if I can replicate this issue.

Regarding the dialog options, that's actually a cool idea and it seems to be feasible.
https://adventuregamestudio.github.io/ags-manual/Dialog.html#dialoghasoptionbeenchosen

I see if I can find the time to implement this feature.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: abstauber on Wed 18/05/2022 21:07:43
Adding a different color for chosen topics was in fact pretty easy. Resetting the state on the other hand is not - at least not from the module's perspective.
There is no function which would be called after a dialog finishes, so there's no straight forward way to reset everything.
I suggest you reset the state in the stop section of the dialog scripts (or call your own reset function)

Also I wasn't able to get stuck on running with the mentioned options disabled. The movement speed is set back to normal after the sprite reaches the cursor - at least while I was testing it. But hey, since you already found a fix, I wouldn't dig too much further into this issue.

Title: Re: TEMPLATE: Tumbleweed Verbs 1.3 Last update: 24th December 2019
Post by: AndreasBlack on Thu 19/05/2022 00:25:32
True! An obvious idea would be to add the parameter since u already have aclosesound & aopensound, so ta-da, unlocksound. I think i've ran into a potential mini problem, also easy fixed by the user i guess, but still.

Maybe there needs to be a timer of some sort before changing rooms, cause the character flips to the room pose's intended direction just before the screen fades out. it's supposed to have that pose when entering the new room not before the screen fades out from the previous room! When using the doorstate function that you've helped out with in the beginners section. But again, i'm probably using a older module so,. maybe this is a none problem.

Can't wait to try the latest version of the template with my "future game"  (nod)

An example GIF from in game, maybe easier to understand the small issue, again it's easily fixed but still! https://drive.google.com/file/d/14YGpHGUWG2s-jAWRVXoXgMKlgsBJQeig/view?usp=sharing
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Thu 19/05/2022 19:27:47
Well, I can see it but at least in the demo game it works as expected.

edit: I think I know what's going on: Have a look at the manual
https://adventuregamestudio.github.io/ags-manual/Tumbleweed.html#exit-extensions

Have a look at your hotspot description and change it to >e if needed.


Btw. I've just published the new release.

Maybe you could try the new template and see if your issues are still present in the latest version:
https://github.com/dkrey/ags_tumbleweed/releases/download/1.4/Tumbleweed_demo.1.4.zip

Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Thu 19/05/2022 23:15:01
Just downloaded it!  :) Nice, will give it a go! As for the E extension advice. If i'm not mistakening i lose the rightclick open/close feature then won't i? Which feels like "luxury" to me, that i want in the game! (laugh)
But yeah again, i just did a "if (player.previousroom==)" and add in the player.FaceDirection in the entering room load, that fixed it anyhow so, no big deal. (nod)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Fri 20/05/2022 10:03:24
Quote from: AndreasBlack on Thu 19/05/2022 23:15:01
If i'm not mistakening i lose the rightclick open/close feature then won't i?
If you use >e you don't loose the exit extension. But this one e.g. means >ed exit and face downwards. As said, have a look at the manual and see how the extensions work.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crescendo64 on Thu 29/09/2022 21:21:32
Hi there, I had a question. Is there any way to make the cursor change into the inventory item when clicked? I tried turning on the built in setting and tried some codes, but wasn't able to override the original script.

Also, whenever you're running and you click the screen, whether you're done moving or not, it will revert back to walking. Is there any way to make it so you keep running?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Sun 02/10/2022 18:52:25
Quote from: Crescendo64 on Thu 29/09/2022 21:21:32Hi there, I had a question. Is there any way to make the cursor change into the inventory item when clicked? I tried turning on the built in setting and tried some codes, but wasn't able to override the original script.

Also, whenever you're running and you click the screen, whether you're done moving or not, it will revert back to walking. Is there any way to make it so you keep running?

You can do what you ask with the touch of a button (inventory item question) in the game setup settings if you use AGS 3.5 and upwards. As for the running. Yes, it's possible, but if that's what you want. Then why not just set the speed manually so it's always "that fast"? character.SetWalkSpeed(9, 9); very easy to do.

Abstauber, you really should add the module InvItemAnimation by strazer into the template. It's very present in Thimbleweed Park as we know, from phones blinking to skulls turning  :-D .
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crescendo64 on Wed 05/10/2022 01:27:19
Hi!

Thanks for your reply. If you mean the option "Use selected inventory graphic for cursor," then I have tried that already and it did not work. Though I am not using the beta program. Would that make the difference?

As for the running, the reason is if I have a long screen and want to keep running across it, I would have to stop and slow down every time I want to run to a newly revealed part of the screen. It's more a quality of life improvement, not a necessity for anything  :-D
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Wed 05/10/2022 15:41:31
Inv Item as Cursor:
I've activated this setting and it seems to work just fine:
General Settings -> Inventory -> "Use selected inventory graphic for cursor" => True

Infinite Running:
You might need to find an exit condition to end running. Currently it's handled in VerbGui.asc:2426
https://github.com/dkrey/ags_tumbleweed/blob/27a7745813c7869dc94aa2413b731489807e0eaf/verbgui.asc#L2426

So you could comment this out and define another condition to end running.

@AndreasBlack I like to keep things modular :P  I already hesitated to include custom dialog rendering and only added it because the built in solution is very very basic.
Also Strazers code is ancient and unmaintained so I'd like to keep it up to the users wether to include such code or not.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crescendo64 on Thu 06/10/2022 03:20:22
QuoteInv Item as Cursor:
I've activated this setting and it seems to work just fine:
General Settings -> Inventory -> "Use selected inventory graphic for cursor" => True

Hmmm... This is interesting. I've turned this setting on, and now the cursor jumps up and to the left, as though showing the item, but it is invisible... I can't seem to find out why that is.

QuoteInfinite Running:
You might need to find an exit condition to end running. Currently it's handled in VerbGui.asc:2426
https://github.com/dkrey/ags_tumbleweed/blob/27a7745813c7869dc94aa2413b731489807e0eaf/verbgui.asc#L2426

So you could comment this out and define another condition to end running.

Ah! This worked perfectly! Thanks for your help!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Thu 06/10/2022 09:08:51
Quote from: Crescendo64 on Wed 05/10/2022 01:27:19Hi!

Thanks for your reply. If you mean the option "Use selected inventory graphic for cursor," then I have tried that already and it did not work. Though I am not using the beta program. Would that make the difference?

I've edited my original post i was wrong, it's possible in AGS 3.5, as for your issue, i'm no AGS expert. Ask in beginners forum, i spam that section a lot  (laugh)

@abstauber That's ok. It seems to work fine for me, but i haven't really die hard tested it yet so who knows! A turning headskull or such advanced stuff! I've just done a paper blowing in the wind when new notes have been added too it.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Thu 06/10/2022 10:04:16
Quote from: Crescendo64 on Thu 06/10/2022 03:20:22Hmmm... This is interesting. I've turned this setting on, and now the cursor jumps up and to the left, as though showing the item, but it is invisible... I can't seem to find out why that is.
Did you set up the "mouse cursor image" for the inv item itself?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crescendo64 on Fri 07/10/2022 05:23:59
Yes, I did. In fact, I'm trying it with one of the template items (keycard), but it's not working. I have tried with a fresh game in the template and it DID work, so I must just have accidentally altered some code somewhere. I'll have to fish around to try and figure out what that would be.

EDIT: I figured it out! I wanted an animated cursor, but I foolishly but the view onto the ItemInv cursor, so the image was showing up, but then immediately changing back to the animation. It's fixed now.

On another note, is there any simple way to add a confirmation button for the Load gui, like there is for the save?

Thanks again for this awesome template!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Mon 10/10/2022 08:59:33
Well, there's no real shortcut, but's pretty straight forward.

You need to override the instant loading here:
https://github.com/dkrey/ags_tumbleweed/blob/27a7745813c7869dc94aa2413b731489807e0eaf/optiongui.asc#L583

Instead open a yes/no gui, just like the Save-GUI does and load only after confirmation.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crescendo64 on Sun 16/10/2022 21:40:41
Hi!

I've fiddled around a little bit, and have come up with this:

This is under the LOAD DIALOGUE heading in 'Options' script.

else if (IsRestoreSlot(control))    {
        gLoadConfirm.Visible = true;
        CustomLoad.InitLoadDialog();
    }
      //OK
    else if (control==btnLoadConfirmYes)    {
        CustomLoad.SelectLoadSlot(control.ID);
        gLoadConfirm.Visible = false;
    }
    //No
    else if (control==btnLoadConfirmNo)    {
        gLoadConfirm.Visible = false;
        }

But when I run it, the game only loads the last slot saved in, not the slot I've selected. What can I do?

Thanks!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Mon 17/10/2022 15:21:57
That's because the ID of the savegame is gone once you open the load confirmation gui.

In Line 465 (function SelectLoadSlot ) you'll find the function call "RestoreGameSlot(slot)". Just like the Save function you need to store away the ID of the slot and after that show the confirmation gui.
customLoadData.loadSlotId = slot;
gLoadConfirm.Visible = true;

I hope it helps to get you on the right track.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Thu 20/10/2022 10:31:53
So i've hardcoded some give away items as @Khris suggested for none moving NPC's. Since there's a bug where the player just won't give the item away, until you click a second time and the cordinates are correct for the script, i suppose. It happens very often. For future release of the template i have a suggestion.

You could add a x/y parameters for the distance of giving an item between characters. Since it would be a neat thing to be able to line up the figures hands or such like i did when hardcoding it.

Edit: Gave up my code attemps, haha!! My last attempt was trying to turn of the  Verbs.SetApproachingChar=false, but still no
Title: Switch language in-game (button/slider)
Post by: CCrane on Mon 31/10/2022 08:17:40
Hi there,

I'd like to add an option to change language in-game. I would've prefered to re-purpose the (for me) obsolete two-position GUI style slider but I didn't manage to do that so I opted to use a button.

Here's what little I was able to do (in GlobalScript.asc)  ??? :
function btnOptionsLanguage_OnClick(GUIControl *control, MouseButton button)
{
 //switch GUI to German
Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangDE;
 
  if (Game.ChangeTranslation("German") == true) {
    Display("Deutsch aktiviert");
}
}

This worked ... but just temporarily and probably more by accident. While the game used the translation file (german.trs) I had created earlier it seemed to do so rather because it was the only translation file present. In any event I wasn't able to revert back to English after that, and after some minor changes (which I'm unable to replicate) it didn't work anymore at all.
Alas I know next to nothing about scripting so I'd appreciate any help I can get. If someone could tell me how to achieve switching language in-game with said slider, even better.

Thanks a bunch!

-------
unrelated to the former ... but I found replacing sprite numbers (in my case the verbs in gMain) in the editors' property pane had no effect because the settings there are "over-ruled" by commands in the verbGui.asc

for example (line 1178):
    Verbs.LocalizeActionButton(eLangEN,eGA_Open,    59, 60, 'q');
Is that how it's supposed to work? Maybe there's some line of code where this can be over-ruled?


also there's a possible bug here. The offset position of the sliders' handles in the editor is not the same as displayed during the game. I had to double the offset value to have the handle in the correct position in-game (see image below).

(https://iili.io/ba6gyJ.md.png) (https://freeimage.host/i/ba6gyJ)
P.S. in case it matters, I'm using AGS 3.5.22 with Playonlinux

Thanks again,
Chris
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Wed 02/11/2022 13:28:51
Hi,
putting the sprite numbers in this function is actually on purpose, so you have the chance to change the verbs graphics to their localised counterparts.

Verbs.LocalizeActionButton(eLangEN,eGA_Open,    59, 60, 'q');
eLangEN is the language token
eGA_Open (enum Global Action Open) is the verb action
59 is the sprite slot for the normal verb
60 is the sprite slot for the highlighted verb
q is the keyboard shortcut.


Regarding the slider, have a look at the manual here:
https://adventuregamestudio.github.io/ags-manual/Slider.html?highlight=slider&case_sensitive=0#slidervalue
Once the slide is being changed, you need to check if the slider is of certain value (such as 0 or 1).

Unfortunately I don't have a windows machine handy, so I can only provide untested pseudo code.

//switch GUI language
if (sldrLanguageSwitch.value == 0) {
  Game.ChangeTranslation("German");
  Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangDE;
}
else {
  Game.ChangeTranslation("");
  Verbs.VerbGuiOptions[eVerbGuiTemplateLanguage] = eLangEN;
}

Verbs.InitGuiLanguage();
Verbs.AdjustGUIText();
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: CCrane on Wed 02/11/2022 17:46:16
Quote from: abstauber on Wed 02/11/2022 13:28:51putting the sprite numbers in this function is actually on purpose, so you have the chance to change the verbs graphics to their localised counterparts.
Oh, of course. I actually realized it (but only later after I had already posted  :-D ) while I was assigning sprites to PushedImages and had them appear irrespective of language setting. Sorry to bother you with that.

Quote from: abstauber on Wed 02/11/2022 13:28:51Unfortunately I don't have a windows machine handy, so I can only provide untested pseudo code.
A big thanks for that. The slider didn't work but the code helped me to set up the language buttons, and that's just as good!
One strange thing happened, though. After I renamed the buttons (e.g. Button1 to btn2ger) they stopped functioning altogether. But when I added another button with the exact same function (and left the default name) it worked as intended and the other still renamed buttons worked all of a sudden again. :confused:
Maybe its AGS editor acting up in Linux ... anyways, I leave the default names now in place and everthing works.

best regards

Correction: This was due to the proper function name not having been updated in the events section of the properties pane.
Title: Room Transitions / Walking off Screen I (feature request?)
Post by: CCrane on Tue 15/11/2022 11:00:16
Hi abstauber,

I'm using the Doors.AnyClickSpecial function and it works as intended. Now I want my character to walk some further steps (and disappear behind a walk-behind) before transitioning to the next room. It would just look nicer and smoother this way instead of the character merely "freezing".

So I'm wondering if there's a way to maybe combine aforementioned function with the hHotspot>e extension function but so far I was only partly lucky. The character just wanders off anytime the door hotspot is clicked, obviously, whether the door's open, closed or locked. Is there a way to execute the extension function only when the door is open?
I guess it could be changed in the function's module. Consequently I think an added walk off-set parameter would be a great addition to the function.

Any workaround is appreciated, though.

Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Tue 15/11/2022 21:57:46
You're right, it would make a lot of sense for the door script to respect exit extensions. I'll see what I can do - although it might take a while
Title: AnyClickWalkLookPick / change player.Say(lookat)
Post by: CCrane on Thu 17/11/2022 09:31:45
Hi,
thanks so much for looking into the matter but at the danger of becoming a pest I have another thing you might be able to help me with.

The AnyClickWalkLookPick function contains a string named lookat which is then used by a player.Say command.

    // PICKUP and make object invisible
    else if(Verbs.UsedAction(eGA_PickUp)) {
      Verbs.AnyClickWalkLookPick(160, 285, eDirectionLeft, "Damn, it's broken. ... Anyway", oHandgun.ID, iHandgun);
      GiveScore(5);

Since I use Snarky's bubbleSpeech module I'd like to change say to sayBubble. I found only two instances of player.Say(lookat) in VerbGui but changing them gave me this error:

SayBubble is not a public member of character

Is it just me being stupid or is that impossible to alter?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Thu 17/11/2022 15:49:21
Test 123, Cleantalk is awful!

Could you please test this portion of Doors::AnyClickSpecial ? I've marked the part I've changed.

else if (Verbs.UsedAction(eGA_WalkTo)) {
    if (Doors.GetDoorState(door_id) == 1) {
      if ( verbsData.exitDoorDoubleclick && DoubleClick.Event[eMouseLeft] )
      {
        if (Verbs.MovePlayerEx(player.x, player.y, eWalkableAreas) > 0 ) player.EnterRoom(nr_room, nr_x, nr_y, nr_dir);
        result = 2;
      }
      else
      {
        if (Verbs.GoTo(2)) {
          // Start Test
          if (Verbs.ExtensionEx(1, verbsData.location_clicked)=='e') {
            int player_x = player.x,
                player_y = player.y;
               
            int offset = verbsData.walkOffScreenOffset;
            int exit_dir = Verbs.ExtensionEx(2,verbsData.location_clicked);
           
            if      (exit_dir=='u') player_y -= offset;
            else if (exit_dir=='d') player_y += offset;
            else if (exit_dir=='l') player_x -= offset;
            else if (exit_dir=='r') player_x += offset;
         
           
            if (Verbs.MovePlayerEx(player_x, player_y, eAnywhere) >0) {
              player.EnterRoom(nr_room, nr_x, nr_y, nr_dir);
              result = 2;   
            }
          }
          // End Test
          player.EnterRoom(nr_room, nr_x, nr_y, nr_dir);
          result = 2;         
        }
       
      }
    }
    else Verbs.AnyClickMove(x, y, dir);

  }
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: CCrane on Thu 17/11/2022 17:50:41
I tested it on my own demo game, and the character seemed again to walk past hHotspot>er irrespective of door state. My game seems to be corrupted however right now so I checked also with the Tumbleweed demo game.

I renamed Holodoor>v in room 2 to Holodoor>er and here I couldn't even interact with the door at first, i.e. I couldn't use the keycard on the door to unlock it. Next I set door state to closed but again I couldn't open the door so I set doorstate to open. This worked and character made some steps.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Thu 17/11/2022 22:55:35
So since there is some action in this thread.. :-D

Abstauber, do you have any idea how to create the double click/run function on a gamepad with the latest AGS Controller plugin? I've tried to use simulatemouse click syntax. I've also tried to just call verbs.startrunning(); on a button, but didn't work!


Thanks!
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Sat 16/09/2023 10:00:47
@abstauber There's a bug in the template. Funny thing tho A-boo i thought i tagged you a-who before, but maybe i didn't 8-0 If you try to GIVE TO it won't give the NPC character the item, until the second time you push the verb! It seems to be related to the distance of the characters, but i'm no coder so i could be wrong (wrong) 
Here's a Ambulance i've done for the game, so you'll get all a-reno and fix it!

(https://pbs.twimg.com/media/F5wYWphWwAAhiGi?format=png&name=large)



Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Fri 22/09/2023 07:44:41
Hey, as always sorry for the late reply. I could have sworn, that this did work at a time. This option in the TemplateSettings controls this behavior
  Verbs.VerbGuiOptions[eVerbGuiApproachCharInteract] = true;

Found it
In VerbGui.asc at around 2488 (depends on your version of the template)
instead of
(IsInteractionAvailable (x, y, eModeUseinv) == 1)use
character[verbsData.location_id].IsInteractionAvailable (eModeUseinv) == 1
Here's the complete block.
      // Giveto
      else if (( verbsData.AGSCursorMode == eModeUseinv) && verbsData.location_type==eLocationCharacter && Verbs.IsAction(eGA_GiveTo)) {
        lblAction.TextColor = verbsData.actionLabelColorHighlighted;
        verbsData.ItemGiven=player.ActiveInventory;
        Verbs.SetAction (eGA_Default);
        if (verbsData.approachCharInteract == false) {
          if (character[verbsData.location_id].IsInteractionAvailable (eModeUseinv) == 1) {
            character[verbsData.location_id].RunInteraction(eModeUseinv);
          }
        }
        else {
          if (Verbs.GoToCharacter(character[verbsData.location_id], 0, verbsData.NPCfacingPlayer, 2)) {
           
            if (character[verbsData.location_id].IsInteractionAvailable (eModeUseinv) == 1) {
              character[verbsData.location_id].RunInteraction(eModeUseinv);       
            }
          }
        }
       
      }

This might also affect other bits of the template, so I won't push the update just yet.
And I still wonder if IsInteractionAvailable used to return any interaction, not just for rooms.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Sat 23/09/2023 00:59:49
Thanks! I'll try it tommorrow! I have to erase my own code attempts i realised they were still left in there!  (laugh) I still wanted to have parts of my code in there somewhat, if it's possible. That is to have a character throwing out his hand and meeting the others hand and exchanging items. I did that with a-reno NPC that is standing still, i mean it looks nicer!

Apart from that a-who, i've had no issues with the template, i finally got your DM code to work yesterday on objects in the room since i have a huge gate that is two objects and not a normal "door" so i had to setup the custom properties finally got that working, so that's nice! I'm all set for a future more serious game demo, expect a demo soon in the future!  (nod)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Fri 29/09/2023 10:51:16
I'd just like to add that the fix is safe to use and I've already updated the Github Project.

Is there anything else that needs fixing while I'm around? Not that you have to wait another year or so   ;)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Fri 29/09/2023 12:33:42
Quote from: abstauber on Fri 29/09/2023 10:51:16I'd just like to add that the fix is safe to use and I've already updated the Github Project.

Is there anything else that needs fixing while I'm around? Not that you have to wait another year or so   ;)

Haha, yes there is! Ability to make the save files screenshot highres. When loading and saving it should look "good". I wrote about it in the beginners forum, but didn't get help (laugh). Since you can change the resolution now in AGS i do it quite a lot in my game so far actually, and yeah it would be nice to be able to have higher resolution on the screenshots of the save files!  (nod)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: eri0o on Fri 29/09/2023 13:35:11
@abstauber , hey the new update in the GitHub project then, can I push it to ags? Just to clear this for new games!

Spoiler
The git diff is like ten thousand lines so this is why I am anxious to push it because I can't tell what's different in there exactly.
[close]
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Mon 02/10/2023 07:43:17
@AndreasBlack I'm afraid the template uses the built-in function "DynamicSprite.CreateFromSaveGame". So whatever resolution is set in the savegame screenshot, will be used to draw the button image.

@eri0o
I really just changed a single line, but on a Mac using Crossover. So maybe the fileencoding changed too and therefore git wasn't able to detect the changes anymore.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crimson Wizard on Mon 02/10/2023 08:14:59
Quote from: AndreasBlack on Fri 29/09/2023 12:33:42Since you can change the resolution now in AGS i do it quite a lot in my game so far actually

What do you mean, how do you "change the resolution in AGS"?

Like i mentioned in another thread, the screenshot is always in the game's resolution, the question is how this screenshot is resized when drawn on gui.

Looking in the template, it resizes the screenshots to the size of the buttons on the Load/Save menu. So the only existing solution is to:
a) resize the buttons, make them larger;
b) adjust script or gui sprites if necessary
I did not find out how it decides which size to use, so I hoped that somebody more familiar with the template could help with this.

Above is the only thing that you may achieve with the template's script. Anything else would require changes in the engine.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Mon 02/10/2023 09:21:12
Thanks as always for your input @Crimson Wizard ! I'm never expecting you to look into code you haven't written! And when i wrote "i didn't get any help" i meant from a perspective of actual code since it's mission impossible for a none-coder like me to do some of this stuff, even tho you seem to have some faith in me! I'm still using the manual cause i can't remember how to do a "do while" syntax, that speaks volumes!  (laugh)
 
I meant "momentarily". I tried to do exactly that. Inside of the codeblocks of the "Thumble Save function" i put in "Game.Camera.SetSize(1080x1200) as an attempt. I guess changing the resolution perhaps is the wrong expression. Changing the bakground to whatever resolution you want. Probably like always i confuse things so let's set the record straight.

If you can type "Game.Camera.SetSize(640x480)" obviously the bakground and everything in the room is now a different resolution from the original Game Setttings (320x200). The Gui's as i understood it is still 320x200, but the screenshot doesn't take those into account equals the ending resolution in the screenshot would appear to be 640x480 even tho the game "isn't really" in 640x480 overall??? Am i right or wrong here? 

Or am i confusing the bakgrounds resolution for the entire games assets apart from the GUI. Perhaps i am! The painful potential solution ofc upscaling all gui's, UI, BG's, characters, etc and set the game to a higher resolution is a valid option. I'm still kinda early in the development so i can still do it.

However i'm afraid code in the script needs to be changed then since a lot of the custom dialogs seems to be basing it's stuff on various widths and heights that would probably only work in a 320x200 setting right @abstauber ? And then i'm beeped since i'm no coder! So i don't think it's as simple as just "upscaling" everything and changing the game setting to 1920 x 1200 or could i just go multiplication x6 on your various heights/width settings in the Thumbleweed template to get it "right" looking, @abstauber?


Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crimson Wizard on Mon 02/10/2023 09:32:17
Quote from: AndreasBlack on Mon 02/10/2023 09:21:12If you can type "Game.Camera.SetAt(640x480)" obviously the bakground and everything in the room is now a different resolution from the original Game Setttings (320x200).

No, this is all wrong...
Firstly it's SetSize, not SetAt, but that's a typo. More importantly, this command does not change background's resolution, it scales the room's image, but resolution stays always the same. Resolution means "how many pixels you may have on screen at the same time".

Scaling camera means that room's pixels are duplicated or cut down. For instance, scaling x2 would mean that instead of 1 room pixel there will be 4 (2x2). But the total amount of pixels on the game screen will be the same (320x200)!

The screenshot uses game's resolution. It does not matter how much room is scaled, the game's resolution will be same, and therefore the screenshot will have always same resolution.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Mon 02/10/2023 09:45:29
Quote from: Crimson Wizard on Mon 02/10/2023 09:32:17
Quote from: AndreasBlack on Mon 02/10/2023 09:21:12If you can type "Game.Camera.SetAt(640x480)" obviously the bakground and everything in the room is now a different resolution from the original Game Setttings (320x200).

No, this is all wrong...
Firstly it's SetSize, not SetAt, but that's a typo. More importantly, this command does not change background's resolution, it scales the room's image, but resolution stays always the same. Resolution means "how many pixels you may have on screen at the same time".

Scaling camera means that room's pixels are duplicated or cut down. For instance, scaling x2 would mean that instead of 1 room pixel there will be 4 (2x2). But the total amount of pixels on the game screen will be the same!

What about this. Having the GUI's code go out to something else in the room instead (Think Room equals the main screen "New Game, Load, Quit, etc". Forexample as a clickable object and have the object act as a "psuedo gui". I'm trying to think of ways to make the same effect as a 1920 x 1200 resolution game setting momentarely. Clearly i could make such a start screen, so wouldn't that be an alternative instead of upscaling everything in the actual game?

It's still probably to advanced for my coding skills..However if that's possible i have to use some form of code for the game to remember which room the player was in before, but that should be quite easy i think with something like player.previousroom? = go there after you've clicked in the main menu's if you push the "resume" object or "go back to game". And yeah, it was a typo ofc, i'm editing it! Is it an alternative that's more doable?






Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crimson Wizard on Mon 02/10/2023 09:54:57
Quote from: AndreasBlack on Mon 02/10/2023 09:45:29What about this. Having the GUI's code go out to something else in the room instead (Think Room equals the main screen "New Game, Load, Quit, etc". Forexample as a clickable object and have the object act as a "psuedo gui". I'm trying to think of ways to make the same effect as a 1920 x 1200 resolution game setting momentarely. Clearly i could make such a start screen, so wouldn't that be an alternative instead of upscaling everything in the actual game?

I'm sorry, but I cannot understand what do you mean by that, and how this will make the screenshots have better resolution.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Mon 02/10/2023 09:55:56
(https://i.imgur.com/8GnvvDf.png)

Since you've said you need to resize the button on the save function, then i figured maybe it's possible by doing it that way?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crimson Wizard on Mon 02/10/2023 10:01:09
There's currently only one way existing when the object may display in a higher resolution: that is when the "Render sprites in screen resolution" is set in the game setup. This will make scaled object appear to have more resolution, that is - less pixelated.

I don't really know if you were referring to this or not. But this trick is theoretically doable. The problem with this is that the result will depend on the size of the game window that player chooses. Also this currently won't work with "Software" renderer, only "Direct3D" and "OpenGL".
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Mon 02/10/2023 10:05:44
Quote from: Crimson Wizard on Mon 02/10/2023 10:01:09There's currently only one way existing when the object may display in a higher resolution: that is when the "Render sprites in screen resolution" is set in the game setup. This will make scaled object appear to have more resolution, that is - less pixelated.

I don't really know if you were referring to this or not. But this trick is theoretically doable. The problem with this is that the result will depend on the size of the game window that player chooses.

Exactly! I use that setting when scaling the characters, i don't want them looking like the true "Lucasarts" scaling back in the day did. So what you mean is if the player plays in say a windowed mode if they'll save the game it might end up looking...Strange? Or what's the caveat here? Hmm..Well at least i'm trying. :-D
Edit: Ahh, but couldn't i turn off software rendering option or ship the game without the setup file in the future? I mean let's be honest. Who uses that software rendering mode. Maybe i'm missing the point. When i've used software rendering mode my game looks aweful anyways!

Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crimson Wizard on Mon 02/10/2023 11:59:17
Quote from: AndreasBlack on Mon 02/10/2023 10:05:44So what you mean is if the player plays in say a windowed mode if they'll save the game it might end up looking...Strange?

No, screenshots in savegame will always will be same. It's the objects that will look different depending on the display mode.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: eri0o on Mon 02/10/2023 13:36:49
Quote from: abstauber on Mon 02/10/2023 07:43:17@eri0o
I really just changed a single line, but on a Mac using Crossover. So maybe the fileencoding changed too and therefore git wasn't able to detect the changes anymore.

Uhm, I don't think the issue is crossover, but I will check if it's the line endings - I think AGS uses Windows Line Endings but I don't remember what git on macOS does with that by default - on Windows git default is to commit with Unix line endings and checkout with Windows line endings.

I had a few issues using git on macOS - not with AGS Editor, but with Xcode. I noticed that if the hard drive is using a case insensitive partition and I rename only the case of a file, Xcode may instead duplicate the file and then once you do git commit the entire branch can be completely insane, giving wrong deltas. I had to delete the git dir when that happened and start from a new branch. This can happen if you delete and create a file with the same name but with different case and squash the history, and doing so with Xcode opened too. I looked into it online and apparently what people do when they hit my case is to create a dev partition that is case sensitive and work with that.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Wed 04/10/2023 11:11:11
hmm... I wasn't able to keep the history intact no matter what - I might try a newer partition soon.
But for now I did a soft reset and applied the change with a windows machine.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: eri0o on Thu 05/10/2023 01:33:48
I think you can try comparing the results on each PC of running

Code (bash) Select
git ls-files --eol *.as*
I hid the output of mine in the spoiler.
Spoiler
i/lf    w/crlf  attr/                  CustomDialogGui.asc
i/lf    w/crlf  attr/                  CustomDialogGui.ash
i/lf    w/crlf  attr/                  DoubleClick.asc
i/lf    w/crlf  attr/                  DoubleClick.ash
i/lf    w/crlf  attr/                  GlobalScript.asc
i/lf    w/crlf  attr/                  GlobalScript.ash
i/lf    w/crlf  attr/                  TemplateSettings.asc
i/lf    w/crlf  attr/                  TemplateSettings.ash
i/lf    w/crlf  attr/                  optiongui.asc
i/lf    w/crlf  attr/                  optiongui.ash
i/lf    w/crlf  attr/                  room1.asc
i/lf    w/crlf  attr/                  room2.asc
i/lf    w/crlf  attr/                  verbgui.asc
i/lf    w/crlf  attr/                  verbgui.ash
[close]

When I did it in your change it was instead as below (look in the verbgui.asc line)
Spoiler
i/lf    w/crlf  attr/                  CustomDialogGui.asc
i/lf    w/crlf  attr/                  CustomDialogGui.ash
i/lf    w/crlf  attr/                  DoubleClick.asc
i/lf    w/crlf  attr/                  DoubleClick.ash
i/lf    w/crlf  attr/                  GlobalScript.asc
i/lf    w/crlf  attr/                  GlobalScript.ash
i/lf    w/crlf  attr/                  TemplateSettings.asc
i/lf    w/crlf  attr/                  TemplateSettings.ash
i/lf    w/crlf  attr/                  optiongui.asc
i/lf    w/crlf  attr/                  optiongui.ash
i/lf    w/crlf  attr/                  room1.asc
i/lf    w/crlf  attr/                  room2.asc
i/crlf  w/crlf  attr/                  verbgui.asc
i/lf    w/crlf  attr/                  verbgui.ash
[close]

The i at the start is what is in the index (and in the remote), and the w means what is in the working tree. So your change was really a change of line ending in the repository.

You can try setting git config core.autocrlf true only in the specific directory of ags_tumbleweed to configure that project on macOS - I haven't tried that yet. I use GitHub Desktop on macOS, I don't remember if it magically does this when it thinks it's necessary, I need to check later. I think I can try hacking a simple .gitattributes file (https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#example), just so this doesn't change.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Thu 05/10/2023 07:38:19
Many thanks for the investigation and the solution of this silly cross platform issue.
Being lazy I added autolf to my global config, so I don't run into this issue again with other projects:
git config --global core.autocrlf inputThanks again  :)
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: AndreasBlack on Wed 11/10/2023 20:25:39
It's me again  (nod)

How do you setup so the various characters can use Snarky's lipsync tool on the basic lines? "I can't open that" "I can't use that" etc. Atm i'm just saying them in the rooms cAbstauber.SaySync ("I can't open that!"); but it would be nice i suppose a-reno to be able to use the template as it's intended a-who.

But with the lipsync working along with the characters aswell! I've added &10 etc in the template to get the voices for the various characters to say their speeches, but since the lipsync tool has a different syntax then the standard AGS &10 so i can't simply just add SaySync&10. I tried "player.saySync" inside of the template, but it's not setup that way it seems.

I hope your AGS forum vacation isn't going on for too long this crisis needs to be solved fast abo  :P
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Khris on Wed 11/10/2023 21:00:26
The messages are set up in TemplateSettings.asc, starting at line 102. Did you change these, too?
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: abstauber on Fri 13/10/2023 10:49:48
If I understand you correctly, you want to change player.Say to player.SaySync.

This happens in VerbGui.asc::Unhandled

In the latest revision it starts in line 1985 and in detail in 2014
   
// unhandled USE
    if (Verbs.UsedAction(eGA_Use)) {
      // use inv on inv
      if (type >= 5) player.Say(verbsData.unhandled_strings[eVerbGuiUnhandledUseInv]);
      // use
      else player.Say(verbsData.unhandled_strings[eVerbGuiUnhandledUse]);

Here you can change .Say to .SaySync. And remember to have lipsync module above VerbGui.asc.

Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: oluisheavy on Tue 02/01/2024 04:13:49
Hello guys!!

Im newbie gamedev and making my first steps into this, so glad i found this model <3

Im trying to do a Uninvited(NES) type of game, o verb guided but no playable character on screen, I doing my best to learn everything but i'm getting a problem with the "text" in the game. Since theres no player on screen im having this error on descriptions. How can i fix it? Ive already done the actions descriptions, but this crash still happening.

Thanks in advance for the help <3
(https://i.imgur.com/e4tt7n1.png)

Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Crimson Wizard on Tue 02/01/2024 06:24:28
@oluisheavy, Hello. If I remember correctly, this kind of error happens when you have function name inserted into "events" table, but not present in script.

Where did you insert this text "E um poster de um jogo classico"? Probably you put it into "events" by mistake.
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: oluisheavy on Tue 02/01/2024 20:08:59
Quote from: Crimson Wizard on Tue 02/01/2024 06:24:28@oluisheavy, Hello. If I remember correctly, this kind of error happens when you have function name inserted into "events" table, but not present in script.

Where did you insert this text "E um poster de um jogo classico"? Probably you put it into "events" by mistake.

On code looks like this
(https://i.imgur.com/TBy6xJV.png)

Idk if im doing this correctly but im trying this, im reading the manuals and trying to understand but im still on learning process. Srry for the noob question  :grin:
Title: Re: TEMPLATE: Tumbleweed Verbs 1.4
Post by: Gilbert on Wed 03/01/2024 03:55:55
Haven't  looked in detail, but one obvious mistake is, string texts should be enclosed in double quotes ("blah blah blah"), not single quotes ('blah blah blah').