Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Topics - abstauber

Pages: [1] 2 3 ... 5
Advanced Technical Forum / Static extenders confusion
« on: 01 Aug 2018, 12:18 »
After learning about attributes, I am currently implementing them to my modules. Now I have also learned that static extenders are possible since 3.4.

I have a static struct like this, along with its extenders:
Code: Adventure Game Studio
  1. struct CustomDialogGui {
  2.   import static void init();
  3.   import static attribute int DialogGuiOptions[];
  4. };
  5. import void prepare(static CustomDialogGui, DialogOptionsRenderingInfo *info);
  6. import void addOption(static CustomDialogGui, int position, int optionNumber, String optionText);
  7. import void getOptionDetails(static CustomDialogGui, DialogOptionsRenderingInfo *info);
  8. import void getRowCount(static CustomDialogGui, int width);

An extender function head looks like this in the .asc file, as it was explained here
Code: Adventure Game Studio
  1. void prepare(static CustomDialogGui, DialogOptionsRenderingInfo *info)
Now here's the thing I don't understand.

The attribute extender has to be like declared like a non-static extender. And it even works (wtf)
Code: Adventure Game Studio
  1. bool seti_DialogGuiOptions(this CustomDialogGui*, eDialogGuiOptions index,  int value)

So yes, it all works but I don't get why attribute extenders have to be non-static on static structs.

Over at the Scumm help thread, Daniel discovered some rather odd limites regarding descriptions.

It seems like inventory item descriptions can be 24 characters long, even though the editor allows more.
Hotspot descriptions can be almost infinite (tested 35 chars).
Object descriptions can only be 29 chars long and the editor also blocks any longer attempts.

Is there a technical reason for this or could these limites be removed in a future engine release?

This is the long overdue overhaul of the classic 9 Verbs template:
Tumbleweed Verbs!

Here are a few highlights:

Thimbleweed(tm) mode

A new save&load system

...while offering the classic SCUMM experience

And it still speaks your local language... sort of ;)

A more complete feature list:
  • cancelable interactions, no need to wait until the character reaches the object/hotspot etc
  • doubleclick to exit locations
  • all new template graphics
  • contains a scrollable dialog gui
  • running with a double click
  • contains a nice door script in case you have lots of those
  • customizable: invent your own verbs, remove a few or add even more
  • helps with unhandled events
  • player follows the cursor while running (if the mouse button is pressed)
  • complete code cleanup: all functions are in structs
  • all settings can be reached and modified anytime
  • all settings are conveniently grouped in a separate script file
  • translations available for Spanish, German, French, Portuguese, Italian and Dutch
  • includes two demo rooms to get you started
  • it comes with a manual :)


(all files compiled with AGS 3.4.1 Patch3)

Here is the template:

The documentation is included with the template and also available as a .chm file here:

General Discussion / Embla, what's wrong?
« on: 19 Apr 2017, 07:14 »
Why on earth are you participating here with great help and encouragement while on the other hand you delete your posts/accounts on a weekly base. ???

I might have discussed this in private but since the account is gone for good (again): here it is.

I just stumbled upon this:
The basic MP3 decoding and encoding technology is patent-free in the European Union, all patents having expired there by 2012 at the latest. In the United States, the technology will be substantially patent-free on 31 December 2017 [....] If the longest-running patent mentioned in the aforementioned references is taken as a measure, then the MP3 technology will be patent-free in the United States on 30 December 2017 when U.S. Patent 5,703,999, held by the Fraunhofer-Gesellschaft[73] and administered by Technicolor,[74] expires.


So after this, I assume we can safely scrap the mp3 free branch.

Have you ever been tired of drawing all your GUI buttons in a paint program? Is it even more boring to create versions for highlighted and clicked buttons in all the different languages? If your answer is 'yes', continue reading :)

This module generates rectangular buttons, which you can assign to anything: GUI buttons, objects, inventory or dynamic sprites - you name it.

AGS 3.x
Alpha support in AGS has been fixed recently, so you might want to use AGS 3.3 if you need proper alpha channel support.



Now with rounded buttons

To turn this

into this:

all you need is this bit of code:
Code: Adventure Game Studio
  1.   import cBtns Btns[MAX_BTNS];
  2.   // Button1: normal. Define the basic values
  3.   int btn1 = BtnHelper.createFromGuiButton(ActionButton1, true);
  4.   Btns[btn1].setColors(2, 48599, 16937);
  5.   Btns[btn1].setBorder(3);
  6.   Btns[btn1].setBevel(3);
  7.   Btns[btn1].setBackgroundImg(3, 0, false);
  8.   Btns[btn1].setBackgroundGradient(28030, 19445, eBtnBlend_easeIn, 50, 70);  
  9.   Btns[btn1].setForegroundImg(1, 0, eBtnAlignVertical_center, eBtnAlignHorizontal_right);
  10.   Btns[btn1].setText("Ags",59228, eFontFont3);
  11.   Btns[btn1].setTextShadow(16937);
  12.   Btns[btn1].render();
  14.   // Button2: highlight. Set an outline and change font color
  15.   int btn2 = BtnHelper.createFromGuiButton(ActionButton2, true);
  16.   Btns[btn2].copyAttributes(btn1);
  17.   Btns[btn2].setOutline(59228);
  18.   Btns[btn2].setText("Ags",65490, eFontFont3);
  19.   Btns[btn2].render();
  21.   // Button3: clicked. Inverse bevel and adjust border
  22.   int btn3 = BtnHelper.createFromGuiButton(ActionButton2, true);
  23.   Btns[btn3].copyAttributes(btn2);
  24.   Btns[btn3].setBorder(4);
  25.   Btns[btn3].setColors(2,16937, 48599);
  26.   Btns[btn3].render();
  28.   // Assign the graphics to the GUI buttons
  29.   ActionButton1.NormalGraphic = Btns[btn1].getGraphic();
  30.   ActionButton2.NormalGraphic = Btns[btn2].getGraphic();  
  31.   ActionButton3.NormalGraphic = Btns[btn3].getGraphic();  

First you need to import the button struct called Btns in your script
Code: Adventure Game Studio
  1. import cBtns Btns[MAX_BTNS];

Now here's a simple rounded blue Button with white text.
Code: Adventure Game Studio
  1.   //The Gui Button we want to use is called Button1
  2.   int btn = BtnHelper.createFromGuiButton(ActionButton, true);
  3.   // Set some attributes
  4.   Btns[btn].setRoundness(10);
  5.   Btns[btn].setColors(1);
  6.   Btns[btn].setText("Hello",15, eFontFont3);
  7.   // Create the image
  8.   Btns[btn].render();
  10.   // After the image has been rendered, we need to assign the new graphic to the button.
  11.   Button1.NormalGraphic = Btns[btn].getGraphic();    

To create a button, you need to call BtnHelper struct - think of it as a factory which creates button dummies :) After that, you call the button struct directly with the generated id.
Code: Adventure Game Studio
  1. // First we call the helper
  2. int id = BtnHelper.create(30,20);
  3. // Now use the struct
  4. Btns[id].setColors(15);
  5. Btns[id].render();
This results in a white 30x20px rectangle. But you can't see it yet. First you need to assign it to some AGS element, e.g. a GUI button.
Code: Adventure Game Studio
  2. Button1.NormalGraphic = Btns[id].getGraphic();    
There you go. The button will now show as a white rectangle.

These are all public helper functions.
Code: Adventure Game Studio
  1.   // creates a button from scratch and returns the id to address it in the button struct
  2.   int id  = BtnHelper.create(int width,  int height,  bool preserveAlpha );
  3.   // same as above, but takes the sizes and (optional) image from the GUI Button.
  4.   int id2 = BtnHelper.createFromGuiButton(Button *guiButton, bool preserveAlpha );
  6.   // Deletes a button. Make sure it's image isn't in use anymore
  7.   BtnHelper.reset(id);  
  9.   // Deletes all buttons. Make sure the images aren't in use anymore
  10.   BtnHelper.resetAll();

These are the public functions to change the button's look.
Code: Adventure Game Studio
  1. copyAttributes(int src_btn_id);
  2. setColors(int baseCol,  int highCol,  int shadowCol);
  3. setBorder(int amount);
  4. setBevel(int amount);
  5. setBackgroundGradient(int startColor,  int endColor, eBtnBlend blendMode, int startTransparency, int endTransparency);
  6. setForegroundGradient(int startColor,  int endColor, eBtnBlend blendMode, int startTransparency, int endTransparency);
  7. setText(String text, int color, int font, eBtnAlignVertical vAlign, eBtnAlignHorizontal hAlign);
  8. setTextShadow(int color);
  9. setTextGradient(int startColor,  int endColor, eBtnBlend blendMode, int startTransparency, int endTransparency);
  10. setBackgroundImg(int spriteSlot, int transparency, bool scaling);
  11. setForegroundImg(int spriteSlot, int transparency, eBtnAlignVertical vAlign, eBtnAlignHorizontal hAlign );
  12. setRoundness(int amount);
  13. setOutline(int color);
  14. getGraphic();
  15. render();
The private functions start with an underscore, you shouldn't need to call them directly.

Revision History:
1.0   initial release
1.1   rounded button support
1.1.1 added the function "getGraphic()", minor touch ups

Christmas Game Arcade

Enjoy three nice laps of classic racing goodness. Or grab the sources and make a game yourself.

* 1 track, 3 laps, 24 presents
* 4 blazing colors
* Christmas spirit from 1981 8-)

Hopefully this evolves into a proper game next year, think of this more like a Christmas greeting card :)


You need to use AGS or higher to open and compile the sources (24 MB)

I'm currently working on a Christmas game (or Holiday Season game including snow, gifts and an altruistic old man... whatever you prefer ;) )
And since working on it in secrecy is boring, I've decided to start this thread.

So what is this about, you might ask?
Remember Red Hot Overdrive, Outrun, Super Hang-On or even TechnoCop? That is pseudo-3D racing. Ever dreamed of Roger driving to his next adventure? Maybe soon he might be able to do that. There's an excellent site on the net explaining how everything works:

My personal goal is to create a small Christmas themed racing game in CGA, but let's face it... time is short and I have no idea if I can make it. So in the meantime I just post my progress here and maybe some of you might  look at the code and find it useful (or even improve it and post it back.. *cough* that would be wonderful to be honest)

So here's the first preview - made with AGS (hooray for managed structs!)
Current features are:
* curves
* hills

Download the source here:
Get the game/sources here:

Many thanks to Khris and AprilSkies for all their advice and input so far! You guys rock.

Recruitment / [AGS HELP WANTED] Christmas Midi Remix needed
« on: 27 Nov 2015, 10:44 »
For a silly (and free) Christmas kart racer, I'm in the need of a certain music track.
The game is going to be a pseudo 3d Racer in the vain of Outrun, just with a Sleigh and CGA graphics.
Therefore it would be awesome, if the game could have a Christmas remix of the famous "Magical Sound Shower"
Adlib /OPL2 sound is highly appreciated.

Is anyone willing to do this?

Hey everyone,
Dualnames made me make this hourgame :) And since nobody except Cuiki every played it, I thought I'd share it with all of you!
You have 30 seconds to fetch as many presents as you can get.
* Move in 4 - yes, F_O_U_R breathtaking directions
* be greedy
* train your reflexes
* no DLC, no ingame purchases

You need the Stella Emulator (or a real VCS 2600) to run it:

Oh - and this is my first Atari game ever, it's a bit .. err. rough around the edges :P
Merry XMAS from GMT+1 :D

Sorry, I still don't have the rights to access the Suggestion Tracker, so I post it here:

How about adding native joystick support to AGS?
Currently we only have Wyz' closed source windows-only plugin. I googled a bit and found out that Allegro4 has at least joystick support for Linux and Windows. So that would be an improvement :)

I'm thinking about to translate the 9-Verb GUI to russian cyrillics. Unfortunately I don't have any experience with non-latin-char based translations - is there anyone who already did it?
Any fonts to suggest? Or if you do speak russian, do you mind translating the 9verbs + a few strings?

I think this has already been discussed, but the search function doesn't reveal it to me. So I'm sorry in advance in case I waste your time ;)

In the mid of development I converted my project from 16bit to 32bit, so there are quite a few 16bit sprites left and the editor identifies them as 16bit sprites. Now unfortunately these sprites aren't rendered on 32bit/alpha GUI surfaces (they simply don't show up), only after I re-import them.
But since I have hundreds of 16bit sprites in my project I would prefer to convert them inside the editor instead of reimporting them.

Something like: "right click -> convert to 32bit" would be really helpful.

I just found out that Aseprite has finally reached 1.0!
It's still free if you decide to compile it yourself.

Working with it is pretty fun so far - especially the pixel-perfect drawing is neat. It also features RGB-color modes and a pretty advanced rotation feature (Rotsprite).

The Rumpus Room / cardboard robots + chiptunes
« on: 25 May 2014, 00:04 »
in case you have a party going on and are all out of chiptunes:

I've worked a bit on custom dialogs again. The dialogs work fine and are rendered correctly, but unfortunately the warnings.log is full of these:
Code: Adventure Game Studio
  1. (in room 10): RawDrawImage: Sprite 387 colour depth 15-bit not same as background depth 16-bit
  2. (in room 10): RawDrawImage: Sprite 393 colour depth 15-bit not same as background depth 16-bit
  3. ....

I've just imported a 8-bit gif and the game is in 16 bit mode. Also in the editor, the file looks perfectly normal.

Does anyone have a clue what this means?

Is there a way to determine, whether dialogs options are currently displayed?
I have a custom dialog GUI and few function in rep_exec_always which I only want to check while the GUI is shown.

Thanks for any help :)

Editor Development / Funky Drawing on roomsurfaces
« on: 24 Mar 2014, 07:45 »
If you try to draw on roomsurfaces without having a background pic, you get this nice CGA effect 8-)
Spoiler: ShowHide

Unfortunately it also drops the framerate to 2-3 fps.
This also happens when you update the game to 32-bit and don't reload a dummy pic as room background.

It's not a major issue, but worth mentioning.

Beginners' Technical Questions / Tint a sprite to white?
« on: 21 Mar 2014, 07:52 »
is it possible to tint a character to solid white? Whenever I try it, the character just turns out kind of desaturated. Tinting to solid black on the other hand is no problem.

source sprite

Beginners' Technical Questions / Check if sprite exists?
« on: 12 Mar 2014, 21:51 »
is it possible to check via script, if the given sprite slot even exists?
I'd like to create dynamic sprites from a textbox, but of course the game crashes when I enter an invalid number.

Is there a way to prevent this?


Pages: [1] 2 3 ... 5