Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: monkey0506 on Tue 05/07/2011 01:31:27

Title: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Tue 05/07/2011 01:31:27
You all demanded it (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=43846.msg583456#msg583456), and your wish is my command. So, I proudly present to you: THE EASYBAKE MODULE - IT MAKES TOAST!

Download (http://meleepta.x10host.mx/EasyBake.rar)

It's really easy to use:

Example:

Code (ags) Select
DynamicSprite *toast = player.Toast();
Overlay *overToast = Overlay.CreateGraphical(150, 200, toast.Graphic, true);
toast.Delete();


Spreads the player character on a delicious piece of toast, and then shows that delicious toast on an Overlay.

P.S. I know what you're thinking, and it doesn't require any additional setup. Just import the module and you're done! :)
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: NickyNyce on Tue 05/07/2011 04:39:55
This is the best invention since sliced bread  ;D  .... You never cease to amaze
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Tue 05/07/2011 05:46:14
;D I'm glad you like it. It was a fun little proof-of-concept about what can be done with modules. Of course..

Spoiler
There's a couple of drawbacks that I would liked to have addressed, but there are some limitations to DynamicSprite.CreateFromFile, which does not work with paths at all (specifically I was hoping to use $SAVEGAMEDIR$ or $APPDATADIR$ but it doesn't work) nor does it work with PNG images. The former limitation means that if you don't have write-access to the game directory then the toast creation will fail (in game_start). The latter means that I couldn't get awesomely smoothed anti-aliased toast. However, the toasting will work even with 8-bit sprites (which are renowned world-wide for not supporting transparency)..although I honestly have no idea if it will work in 8-bit games. Also, the module size is bloated to something like 20 times the image size (in addition to the rest of the module code). I tried to compress it but the bitwise operators seem to act strangely with negative values..I still could have just mashed 3 bytes into each value..but I gave up on using the bitwise operators.
[close]
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Peder 🚀 on Tue 05/07/2011 11:26:21
No youtube clip or live demo ???
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Tue 05/07/2011 19:39:24
It would seriously take you all of 30 seconds to download it and implement the example code yourself. Geeze. :P
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Khris on Tue 05/07/2011 19:41:36
I did that but didn't see anything and was too lazy to waste time trying to find the mistake.
Long story short, at least drop a screenshot or something.

This is essentially a joke, not a useful module, correct?
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Tue 05/07/2011 20:27:22
Depends on your definition of "useful". Some people might find it very useful to spread their characters, inventory items, objects, and various sprites onto delicious pieces of toast without having to do any real work themselves.

Seeing as you're all too lazy to download a 31 KB file, I'll upload the "demo" source which is 163 KB.

I refuse to post screenshots because then the awesomitity of my delicious module would be ruined.

So: http://meleepta.x10hosting.com/Toast.rar

It was last compiled with AGS 3.2.2 Beta from the SVN, so you might actually need that version for it to work. Who knows. (not a question!! I DEMAND IT IS NOT A QUESTION!!)

Once the thing is loaded up press A and B in rapid succession for full effect. That is all.

Edit: Also...

Spoiler
If serialization of images is something that piques your interest, then the source of this module could be a fun little glimpse into one way of doing it. Of course it's presently horribly inefficient, for some of the reasons mentioned above, but that's not the point. Recreating an image entirely in AGScript is quite simply a fun thin to do. Perhaps one day I will improve this to use the bitwise operators to store more than one byte in each value, or maybe I won't. Either way, IT MAKES TOAST!!
[close]
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Dualnames on Tue 05/07/2011 21:18:41
1) I find it utterly pointless.
2) You can indent.
3) The code has this AMAZING PART, where I need to salute you.
4) I find it hilarious.

^_________________^

Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Yeppoh on Tue 05/07/2011 21:35:50
Wait. A function can return a whole Dynamic Sprite?
Last time I tried that, the compiler said a big wet "NO" before spiting my game on the floor. Is that new?

Aside this. Funny module!
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Peder 🚀 on Tue 05/07/2011 21:38:45
Your demo source is no better than your module alone  >:(.
I haven't got AGS 3.2.2 Beta and you haven't built the game so I can't even run it to see its beauty!!
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Dualnames on Tue 05/07/2011 21:50:06
Quote from: PE3dE3r JohnsE3n on Tue 05/07/2011 21:38:45
Your demo source is no better than your module alone  >:(.
I haven't got AGS 3.2.2 Beta and you haven't built the game so I can't even run it to see its beauty!!

I don't have that beta either and i could compile and run.
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Tue 05/07/2011 22:11:41
@Nefasto:

Are you sure you were returning a pointer and not trying to return the instance itself? You've always been able to return pointers since AGS 2.7.

DynamicSprite* CreateDynamicSpriteUselessWrapper(int slot)
{
  return DynamicSprite.CreateFromExistingSprite(slot);
}


Take note that the return type is "DynamicSprite*" not just "DynamicSprite".

@Peder:

Holy frick man! As Dual said you don't even need 3.2.2. You could have tried it. And since you're really that lazy I'll consider uploading the compiled thing..but later.
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Peder 🚀 on Tue 05/07/2011 22:44:29
I did try, but did not succeed.... >:(
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Gilbert on Wed 06/07/2011 02:06:34
Can anyone tell me what this really is? I demand clear explanation and no, I wouldn't care about downloading it and trying it out.

Otherwise I won't move this to the module section.
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Wed 06/07/2011 02:42:01
Quote from: monkE3y_05_06 on Tue 05/07/2011 20:27:22Some people might find it very useful to spread their characters, inventory items, objects, and various sprites onto delicious pieces of toast without having to do any real work themselves.

Don't see how it gets any clearer than that. This module creates delicious pieces of toast and spreads characters, inventory items, objects, and sprites onto it. The toast is very delicious. Clear enough?

As for the rest of you...

Seeing as you're all too lazy to download a 31 KB file, and seeing as you're all too lazy to download the 163 KB "demo" source, I'll upload the "demo" EXE which is 756 KB.

So: http://meleepta.x10hosting.com/ToastedToast.rar

This compilation uses a newer version of the module which cuts down on the module size quite drastically, but also exploits a bug in the way AGS allocates dynamic arrays.

I don't care if you're too cool to consider this awesomitity a real module Gilbot, do as you see fit. As for myself, I will always know the truth! 8)

Spoiler
This module "makes" "toast" by recreating an image that I've serialized into AGScript. It will semitransparently draw other sprites onto a resized copy of that toast to give the delicious effect of some, say, EGO-flavoured jelly. Regardless of what anybody says, it was a fun little experiment.
[close]
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Wonkyth on Wed 06/07/2011 03:04:57
Totally using this!

Babar, Draw me a magical loaf!
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Knox on Wed 06/07/2011 03:46:18
QuoteIt even makes toast and improves your sex life.

Awesome module Monkey...When is the ImproveSexLife Module coming out?
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Khris on Wed 06/07/2011 03:47:57
While this is no doubt a fun little experiment, that fact doesn't make the module itself not useless.
If this were only about downloading something (even just 31kb), people wouldn't complain, but seeing the result takes (took) more work than that.
So while I understand why you don't put up a screenshot, please stop complaining about people unwilling to download something great when what actually happens is (was) people being unwilling to download and implement something useless.
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Wed 06/07/2011 04:04:00
You're right. It's absurd of me to expect people to open AGS, import the module, and add 6 lines of code (including the three lines from the above example, a line for a condition inside of on_key_press, and a line for each of the braces for the conditional statement), and then after all of that hard work, have to actually press F5, and then press the assigned key!! That is far too far too far too much to expect people to do.

And whether or not something is useful is completely a matter of opinion. You're entitled to yours, but that doesn't make it fact.

So please stop complaining about me jokingly commentating on how difficult this entire process has been on all of you, and just get on with your life. If you didn't enjoy the module, again, that's your opinion. Sorry I so unwittingly brushed against your embittered, toast-hating, satire-loating side. I assure you it wasn't my intention. 8)
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: R4L on Wed 06/07/2011 04:29:09
I love this module. Never again will I have to worry about not having toast.
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Peder 🚀 on Wed 06/07/2011 08:41:35
Quote from: monkE3y_05_06 on Wed 06/07/2011 02:42:01
Seeing as you're all too lazy to download a 31 KB file, and seeing as you're all too lazy to download the 163 KB "demo" source, I'll upload the "demo" EXE which is 756 KB.

So: http://meleepta.x10hosting.com/ToastedToast.rar

Thank you! ;D
Though I thought there would be some awesome animation involved like a knife picking the character up then to spread him/her/it all over the toast >:(
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Atelier on Wed 06/07/2011 10:29:39
Who bakes bread to get toast. You bake bread to get bread and toast toast to get toast. I mean you toast bread to get toast. And cows drink milk. I mean cows drink water. The bottom line is the toastologists will go to town when they see this and celebrate with toast and maybe, just maybe, celebrate with toasted seed bread.

http://www.youtube.com/watch?v=CSIm_BNsN5I
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Yeppoh on Wed 06/07/2011 11:36:31
Quote from: monkE3y_05_06 on Tue 05/07/2011 22:11:41
@Nefasto:

Are you sure you were returning a pointer and not trying to return the instance itself? You've always been able to return pointers since AGS 2.7.

DynamicSprite* CreateDynamicSpriteUselessWrapper(int slot)
{
  return DynamicSprite.CreateFromExistingSprite(slot);
}


Take note that the return type is "DynamicSprite*" not just "DynamicSprite".

I don't remember if I returned it as a pointer, but that might be the reason it didn't work. Thanks.
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Knox on Wed 06/07/2011 18:22:19
Can you make a poptart module?  :D
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Dualnames on Wed 06/07/2011 18:42:01
Quote from: General_Knox on Wed 06/07/2011 18:22:19
Can you make a poptart module?  :D

And add a cat. And a rainbow.
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: monkey0506 on Wed 06/07/2011 19:20:08
Okay, I can't be expected to write all of these modules, but stay tuned..seriously, what I'm planning now will......

BLOW YOUR MINDS!!1

8)
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Knox on Wed 06/07/2011 23:22:01
I always love the good old two exclamation points and a one at the end of a post ("!!1")...almost as awesome as a triple question mark ???

Looking forward to my mind being blown!!1
Title: Re: MODULE: EasyBake - IT MAKES TOAST!
Post by: Ryan Timothy B on Thu 14/07/2011 17:34:37
I've now added this into Journey of Iesir so everyone can smack Mikael onto a piece of toast whenever they want!! The game used to be absolutely amazing before this feature, but now it's even better! It's probably now the best game ever made.

I'm joking