MODULE: EasyBake - IT MAKES TOAST!

Started by monkey0506, Tue 05/07/2011 01:31:27

Previous topic - Next topic

monkey0506

You all demanded it, and your wish is my command. So, I proudly present to you: THE EASYBAKE MODULE - IT MAKES TOAST!

Download

It's really easy to use:

Example:

Code: ags
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! :)

NickyNyce

This is the best invention since sliced bread  ;D  .... You never cease to amaze

monkey0506

;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]

Peder 🚀


monkey0506

It would seriously take you all of 30 seconds to download it and implement the example code yourself. Geeze. :P

Khris

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?

monkey0506

#6
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]

Dualnames

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.

^_________________^

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Yeppoh

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!

Peder 🚀

#9
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!!

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

monkey0506

@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.

Code: ags
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.

Peder 🚀

I did try, but did not succeed.... >:(

Gilbert

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.

monkey0506

#14
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]

Wonkyth

Totally using this!

Babar, Draw me a magical loaf!
"But with a ninja on your face, you live longer!"

Knox

QuoteIt even makes toast and improves your sex life.

Awesome module Monkey...When is the ImproveSexLife Module coming out?
--All that is necessary for evil to triumph is for good men to do nothing.

Khris

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.

monkey0506

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)

R4L

I love this module. Never again will I have to worry about not having toast.

SMF spam blocked by CleanTalk