Jibble

Author Topic: TEMPLATE: 9-verb MI-style 1.6.4 - Last update: 4th April 2019  (Read 80686 times)

Wait, can you actually do this in AGS script, or is this just something that ought to be possible? I never knew about this, if it's possible! Way cool!

This is how several array-like attributes are done, like Game.AudioClips, System.AudioChannels etc, you've been using these all along.

The attributes are still not documented inside the manual itself, there is only this slightly outdated wiki article: http://www.adventuregamestudio.co.uk/wiki/Keyword:_attribute
« Last Edit: 31 Jul 2018, 11:10 by Crimson Wizard »

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Sorry if this seems patronizing, you probably knew most of it already, but I wasn't sure exactly what part of it had you confused.
Not at all, this was quite insightful. Although I have to admit that in the end the wiki article did the trick of me fully understanding what attributes do in AGS :)

But since the wiki article mentions it: will this scripting feature still be supported in the future? I sure hope so ;)

But since the wiki article mentions it: will this scripting feature still be supported in the future? I sure hope so ;)

Like I said, the article is bit outdated, and attributes are fully supported and should not be abandoned.

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Many thanks! I've refactored the Tumbleweed template to use attributes now. But I won't do it with this template as I'd really like users to switch to the newer template and this one has not been refactored at all.

Maybe it would have been smarter to call the Tumbleweed Template "9-verb MI-Style 2.0" :-\

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
@Monsieur OUXX
Have a look over here:
https://github.com/dkrey/ags_tumbleweed/blob/master/dialogscript.asc
https://github.com/dkrey/ags_tumbleweed/blob/master/dialogscript.ash

1) they make the things accessible from outside
check

2) they group the settings by category
I decided against individual arrays for each category of settings, as I find this a bit too confusing when setting up a new GUI. The options are still somehow categorized by the attribute name.

3) they make them reflexive (accessible by index or name in the array of settings, allowing to tie them to an in-game console system)
check

4) they clarify the initialization sequence and keep the object in a consistent state

err... 1/2 check? The initialization is done by the internal AGS functions. There is no needed sequence or order for the options to be set. Also the whole dialog GUI is now static.

And as said before: this won't make it into this template. But since the module doesn't have dependencies, you should have no problems importing the code from Tumbleweed Verbs.
« Last Edit: 01 Aug 2018, 15:33 by abstauber »

Hi!!! I was trying to change the GUI language by clicking on two buttons (one Spanish and one English flag).
Thanks to Khris, I did the following:
I added in guiscript.ash (header):

Code: Adventure Game Studio
  1. import int lang;
  2.  

Then I opened the main guiscript.asc and above of int lang = eLangES (my first language in the 16 line); I scripted in the 17 line this

Code: Adventure Game Studio
  1. export lang;
  2.  

After that I script in the English button event of Any_click this

Code: Adventure Game Studio
  1. function english_AnyClick()
  2. {
  3.  
  4.   lang = eLangEN;
  5.   AdjustLanguage();
  6.   AdjustGUIText();
  7.  
  8.   if (Game.ChangeTranslation("English") == true) {
  9.     Display("English loaded");
  10. }
  11. }
  12.  

And everything seemed to work, the 9 verbs changed and the action text as well. However, I've noticed that when I press F5 to load or save the game, pause, or exit, those options remain in Spanish and have not changed no way.
What happen? What I can be doing wrong?[/code]

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Instead of AdjustLanguage(), try
InitGuiLanguage();

If I find the time I'll dig into this a bit deeper tomorrow.

edit: removed bogus
« Last Edit: 02 Apr 2019, 21:13 by abstauber »

I've tried what you told me abstauber, but the exact same thing is still happening

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Haha, a bug after all those years  8-0  (laugh)

You are totally right, there is something wrong in the code. In order to fix it you have to either wait until I release a fixed version or do the following:

In guiscript.asc find the function AdjustGuiText() - it should start around line 784
Now replace the lines
Code: [Select]
    // english is the default language, nothing to adjust
return;

with this:
Code: [Select]
    // English
    OptionsTitle.Text   = "Options";
    OptionsMusic.Text   = "Music Volume";
    OptionsSound.Text   = "Sound Effects Volume";
    OptionsSpeed.Text   = "Game Speed";
    OptionsDefault.Text = "Default";
    OptionsSave.Text    = "Save";
    OptionsLoad.Text    = "Load";
    OptionsRestart.Text = "Restart";
    OptionsQuit.Text    = "Quit";
    OptionsPlay.Text    = "Resume";
    gPausedText.Text    = "Game paused. Press <Space> to continue";
    RestoreTitle.Text   = "Please choose a game to load";
    RestoreCancel.Text  = "Cancel";
    SaveTitle.Text      = "Please enter a name";
    SaveOK.Text         = "Save";
    SaveCancel.Text     = "Cancel";
    gConfirmexitText.Text = "Are you sure, you want to quit? (Y/N)";
    gRestartText.Text   = "Are you sure, you want to restart? (Y/N)";

(the curly braces need to stay of course, so just replace the comment and the return command - nothing else ;) )
after that, it should work just fine.

Now it works perfect! Oh, you can not imagine the headache this brought me. I thank you very much for your help and I owe you at least 4 or 5 blue glasses full of beer, or with what you prefer to fill them! ;)  (roll) (roll) (roll)

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
Great that you got it working and thanks for reporting the bug. I'll be updating the template soon.

The template has been updated.
« Last Edit: 04 Apr 2019, 09:24 by abstauber »

I'm doing my graphic adventure with score. So far I have no problem to increase the score as you go. However, I would like the score to be shown in the GUI gOptions, under the RESUME button.
How could I do this?

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on a game that won an AGS Award!
    •  
    • abstauber worked on a game that was nominated for an AGS Award!
You just add a label and as text you define:
Code: [Select]
@SCORE@
AGS handles the rest for you.