Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - klazen108

Pages: [1] 2
1
Tools & Software / Fangame OBS Reader
« on: August 26, 2016, 01:35:12 AM »
Stinky was doing roulette today, and mentioned it would be nice if there was a program that could detect when a fangame was open and write the name to a text file for display in OBS. So I made one! This should hopefully be helpful if you're doing roulette streaks and don't feel like copying the name to a text field in OBS.

It operates in a very basic way, by checking all the process open on your computer, sorting them by date, and then going through the list and grabbing the name of the latest-opened process that has "i wanna" in its name. The name is displayed in the console window, and written to a file in the same directory named game.txt. It updates every 15 seconds. Just leave it on in the background, add the txt file to OBS, and you're done!

Because of the "i wanna" requirement, it won't work for fangames that don't have that. Not sure if there's a better way. It was also triggering when he opened a delfruit page, so I told it to ignore chrome's processes. If an error occurs, it will show you in the console, but not on stream (in case there's anything personal in the message). To quit the program, just press enter on the window, or use the red X.

It was written in C#, so you'll need the .NET framework for it to run. Just google ".NET framework download" and get it from Microsoft if you don't have it.

If you have any bug reports or feature requests, let me know and I'll see what I can do!

Download version 1 here

2
Unfinished / Incomplete / Shadesbot Plays Guy Games (Fangame AI)
« on: June 07, 2015, 03:48:42 PM »
Hey Guys!

If you were around in the Fangame Marathon on Saturday morning EDT, then you probably saw the project Zebbe and I developed which is dubbed Shadesbot Plays Guy Games (a playful poke at Twitch Plays Guy Games). If you missed it, the project is an artifical intelligence based on a neural network, which is iteratively improved via a genetic algorithm. If none of that makes sense, all you need to know is that the kids will try to learn how to do platforming automatically, while you sit back and watch their futile efforts :Kappa:

We had the idea for this project after watching SethBling develop an AI with similar goals for Super Mario World, which he dubbed MarI/O (best name ever) - you can watch an except of that here.

Zebbe and I have decided to release the source code for what we've made here on the forums, in case you want to poke around and see how it was done. The project was developed in Game Maker Studio using an old GMS engine off the wiki; I wouldn't recommend starting a serious fangame in the project, but it was good enough for our purposes :P Game Maker Studio has a free version, so you can install that to load the project - no need to go hunting for a R) version of GM8.1!

If you'd like to ask questions, or discuss anything about the project, post here! We would love to talk about the project, and collaborate with anyone who is interested. I'd love to see this running even better, and maybe tackling a real fangame some day!

Download the GMX project file for Shadesbot Plays Guy Games

Watch Shadesbot's run from Fangame Marathon here

3
Engines / I Wanna Be the Engine KS Edition (For GMStudio)
« on: May 18, 2015, 10:23:47 PM »
Hey Guys!

You may have heard that GM8.1 is rip... I think I speak for everyone when I say: :BibleThump: However, this marks the beginning of a new era in fangame development... Sephalos and I have joined forces to bring you a new Fangame Engine, this time for Game Maker Studio!

Game Maker Studio is completely free and quite stable (no more asking around for downloads, or having glitchy GM8 crashes). I took the existing GMS engine on the wiki, and gave it some tender lovin' care. Then, Seph joined forces with me to do some work of his own! Here's a selection of things you'll find:
  • Physics fixes - the infamous Zurai Strats still work, and you can't get stuck in blocks, nor can spikes in blocks kill you.
  • Added an extension to save your save files to the same directory as the game
  • Included a little overlay that displays your deathtime in the game - useful if you have the free edition of GMS and can't update the window caption, and completely optional!
  • If you're used to the Seph engine, you'll be used to this one - We tried to structure it the same way!
  • It comes with a nice main menu, complete with control bindings and other neat features, ready for you to customize!
All of this on top of the new GMS platform, which gives you better performance and neat new features!

However, we'd like to ask you for your help now. We're pretty much ready to release, but we want to get some feedback from developers in the community on the physics and features we've developed for you. If any of you would like to help us make the best engine we can, please try it out and let us know what you think!

Note that we don't recommend you start any big projects with this engine just yet... while everything seems like it works, it could use a bit of testing to confirm that it's 100% stable and correct. Develop at your own risk!

Download the v0.961 Beta version of the KS Engine here!

NOTE: Make sure to use the "zip export" mode when compiling your final game! You need this in order for save files to appear in the same folder as your game. I don't think that's an option with standalone executable mode. If you still want to use a standalone executable, you'll have to standby until I can test and verify a method to put save files back into the AppData folder, right now they're being put in the temp folder where your game is being extracted to!

NOTE 2: This engine was developed and tested in GM Studio version 1.4.1567. I have received confirmation from yoyogames that collision detection behavior is changing for version 1.4.1598. if you use KSv0.9 or earlier in GMSv1.4.1598, no walkoff aligns will work, and spikes in blocks will kill you. Therefore, if you're using version 0.9 or earlier of the KS engine, you must use GM Studio version 1.4.1567. I am working on a fix for 1.4.1598, and I'll maintain both versions until 1.4.1598 is officially released.

Changelog:
Code: [Select]
v0.96:
-New physics engine to better match the standard Yuuutu-type physics without bugs (thanks to YoYoYoDude1!)
-Inability to bunnyhop / getting stuck in screen transitions should be fixed thanks to above
-Fixed misplaced GUI in fullscreen mode and at top of screen in general
-Cleaned up many unnecessary objects/sprites/sounds
-Added more comments in code
-Added vines

v0.9:
-Fixed roomChanger crash when walking between rooms
-Fixed player getting sucked into blocks if a platform is placed next to it

v0.8:
-Fixed walkoff aligns for all spikes
-Fixed deathtime GUI being out of place if the room scrolls
-Fixed bug with platforms that caused the player to get stuck if next to a block

v0.7:
-Added minispikes, miniblocks (note: walk-off align seems bugged for leftward-facing minispikes)
-Menu now reflects the correct keybinds for accept/back
-Added editor-only icons
-Added saveblocker object
-Fixed blood sticking to corners in midair
-Moved blood in front of spikes
-Added ability to enable/disable difficulty select

v0.6:
-Fixed music restart on F2
-Fixed sndCherry, sndBlockChange, sndBossHit missing from engine
-Added savefile indicator in main menu
-Corrected views (should be all 800x600 now)
-Added 'readme's to many objects
-Other minor fixes/alterations

v0.5:
-Intial beta release

                           please helperoni
                                                             we do this shit for you guys
                                             we fixeroni

4
Tools & Software / Crystalline - a Particle System Tool!
« on: January 19, 2015, 03:33:08 PM »
HeyGuys

I developed a tool for Game Maker Particle Systems, because I got tired of having to recompile the GMK every time I made one tiny change. This tool lets you edit particles in real time, so you can instantly see your code in action!

I've tried to simplify everything, and even included a randomizer function in case you have no idea and just want to roll the dice and see what happens. You can also save/load particles, and export the scripts needed to import them into Game Maker! Now there's no reason for people not to use particles :Kappa:

You can see a screenshot of the program in action here:
(click to show/hide)

I hope you find it useful! Please let me know if I can improve it, or if you have any problems with it.

--Latest Version--
Download Crystalline V1.2 Here!

--Old Versions--
Download Crystalline V1.1 Here!
Download Crystalline V1.0 Here!

Code: [Select]
Changelog
==V1.2
-Fixed issue with third color not being saved to the export script
-Added new example effects (rain & America)

==V1.1 (thanks to kady for making me not be lazy)
-Added ability to move the emitter region with the mouse
-Included burst code in exported scripts

==V1.0
-Released

5
Off Topic / Stonky Kong Racing
« on: July 15, 2014, 03:44:33 PM »
After watching Stinky's Deca-Boshy marathon, I started seeing his face in everything...


6
The Lounge / Public Teamspeak Server
« on: July 02, 2014, 07:37:39 PM »
Hey Guys,

PlasmaNapkin (you may know him from twitch chat) has been kind enough to host a public teamspeak server for guy-related stuff. If you want to come in and race, talk about your progress on the Butterfly screen in K3 :Kappa:, discuss fangame development problems, or just talk about your favorite Wannabe, you're welcome to join!


Just get Teamspeak 3 and join this server: iwanna.nitrado.net
(click to show/hide)

Look forward to seeing you there!

7
Unfinished / Incomplete / I Wanna Restore the Balance v0.5
« on: May 28, 2014, 02:32:38 AM »
Hey Guys,

This is my entry for YoSniper's Fangame Contest titled... I Wanna Restore the Balance

The name of the game is a double-entendre: On the one hand, your goal is to bring balance back to the world by finding the elements and restoring them to the elemental tree or whatever. But the real idea behind the game comes from my experience with the fangame community - a lot of the really nice, polished games are too hard for a beginner like me to play! I wanted to provide a good game for beginners to sink their teeth into, and this is the result of that.

My inspiration for the game is I Wanna See the Moon - an open-world, Metroidvania-esque style game. You'll visit 5 unique stages (only two in the beta :BibleThump: ). In each beautiful stage, you'll enjoy about fifteen screens of platforming, each punctuated by an epic boss! Each boss is guarding one of the elemental crystals, which will relinquish its power to you once you restore it. The power of the crystals give the kid new abilities, for instance...
(click to show/hide)
You'll be able to use these powers to progress to new areas within the game, and also come back to old stages later and explore new, secret areas!

Below are a couple of screenshots, just to pique your interest!

Swingin' like Tarzan
(click to show/hide)

What's this button do?
(click to show/hide)

If this sounds like something you're interested in, I welcome you to try it out! You can download it here: I Wanna Restore the Balance Version 0.5

Thanks for reading  :paraLamp:

8
Programming Questions / Create Events not firing?
« on: May 26, 2014, 04:17:39 PM »
Hey Guys, I'm having a weird issue in my fangame... let me start off with my specs:

Seph Edition Engine
Game Maker 8.1

So I've got this one room with a bunch of trolls. When you trigger them all and exit the room (as intended), the game starts acting very strangely. I'm not sure exactly what's happening, but it's like the create events are no longer being fired. The player starts moving faster than intended (but the physics seem to still be accurate), and the troll spikes in the previous room are clearly visible. You can see what I mean in the spoiler below. Caution: This is for my contest fangame, so if you don't want spoilers, don't open this tag!
(click to show/hide)
I have the troll spikes on layer -1000000, above everything, for development; in the create event I put them at layer 1000000, below everything, so you don't see them. However, it's like the code to hide them isn't being run!

I figured this might be a problem with my room transition code, since it was custom written. I've included it in the spoiler below if you want to look at it.
(click to show/hide)

Another strange occurrence is that this bug only happens in this exact room, and only when you exit it on the left for the first time. I cannot reproduce this bug by coming back here later. If it happens, F2 does not fix it; I have to close the game and reopen it, and then it works as intended for the rest of the game. Maybe it's an issue with my triggers? I've included the code for them as well in the spoiler below.
(click to show/hide)

If you require any other information, or would like to look at the project itself, let me know and I would be happy to share. Thanks for taking the time to read!

9
Off Topic / Post Your Favorite Come on And Slam Remix
« on: May 24, 2014, 09:32:58 PM »
Allow me to get this thread started with a small collection:

Oppa Spacejam Style

Slam Fukkireta
(click to show/hide)

Super Space Jam 64
(click to show/hide)

The Slam is Right!
(click to show/hide)

Green Slam Zone
(click to show/hide)

Also acceptable are resources to help us discover these remixes, which are surely god's gift to man. Resources like...

https://comeonandsl.am/
https://reddit.com/r/comeonandslam

10
Off Topic / Gimme Pizza
« on: May 09, 2014, 09:30:58 AM »
idk


11
Gameplay & Discussion / Tutorial: How to play Churatch
« on: April 27, 2014, 12:10:31 AM »
I Wanna Be The Churatch is a great 100 Floor game, and is especially easy on new players towards the beginning. It's a shame that in order to actually start playing it, you have to have some inside knowledge about how the game works. So I'm gonna compile a list of commonly asked questions about Churatch. If you see someone in twitch chat who wants to play, but they're having problems, you can refer them here and this should get them started.

Where can I get Churatch?
You can get Churatch on The Fangame Wiki. Just go there, and scroll down until you find "I Wanna Be The Churatch," and then download it.

I downloaded Churatch but it's corrupted/it won't open!
The creator of Churatch included some Japanese characters in the filename, and for one reason or another, some installations of Windows have trouble reading files when they're like that. So you just need to do a little cleanup - remove any characters that aren't English A-Z or numbers. Check out the picture in the spoiler tag to see exactly what's going on:
(click to show/hide)

I can't go in the medium warp, only an impossible one that turns into "sunpossible"
OR when I play, my R key doesn't work and the game ends after 3 deaths!

On the stage select screen, there's three warps - "medium" "load game" and "impossible". The medium warp disappears as soon as you touch it. The impossible warp turns into a "sunpossible" warp when you jump in. Sunpossible is a custom mode where you get 3 lives, and that's it! Of course, this being your first time, you just want to play the normal game. Luckily, there's a "medium" difficulty available, but it's hidden. Click the spoiler below to see an image which will show you how to find it.
(click to show/hide)

12
Game Design / Tutorial: Adding a Sunpossible Mode to Your Game!
« on: April 12, 2014, 11:28:56 AM »
Hey guys,

After helping Piece & Para out by adding Sunpossible to Cultured, I thought I'd share the information in case anyone else felt like they wanted to add it to their game. This tutorial assumes you're using the Yuuutu engine, but the concept is easily extendable once you know what you're doing.

Oh, and for you plebs that don't know what Sunpossible mode is... it's a mode inspired by IWBTChuratch; you get a set amount of lives and that's it - every move you make counts.

Sunpossible Functionality Scripts

I've provided some scripts below; just make some new scripts in Game Maker, name them the bold names, and copy-pasta the code into the script. These make it easy to access the various values associated with Sunpossible mode, so you don't have to worry about the underlying code when you're designing your game.

sunAskForLives
Code: [Select]
global.lifeCount = min(floor(abs(real(string_digits(get_string("How many lives?","50"))))),1000000);
The first thing you might be saying is "WTF why so many parentheses dude" and to that I say... blame Paragus for breaking my code :Kappa:
When you call this function, It will prompt the player with an input box, asking them how many lives they want to play with. The reason there's so many extra functions in there is to make sure you get a nice number out of it, even if the player enters "-3.14159KappaFace" It takes all the digits out of the string the player entered (string_digits), makes it a number (real), makes it positive (abs), drops the fractional part (floor) and makes sure it's less than one million (min) - so if the player entered "-3.14159KappaFace" they would get 314159 lives.

Call this function whenever you want to ask the player how many lives they want - I recommend the warpStart's Player Collision event, but anywhere else that makes logical sense works too.

sunIsSunpossibleMode
Code: [Select]
return global.lifeCount > 0This function is just a simple way for you to see if it's sunpossible mode or not - If you never set global.lifeCount, it'll be zero, and we consider that not sunpossible mode.

sunGetRemainingLives
Code: [Select]
return global.lifeCount - global.death[global.savenum]This one's pretty simple too; call it to get the number of lives remaining.

sunSaveLives
Code: [Select]
var tem;
tem = global.lifeCount;
file_bin_write_byte(argument0,floor(tem/10000));
tem -= floor(tem/10000)*10000;
file_bin_write_byte(argument0,floor(tem/100));
tem -= floor(tem/100)*100;
file_bin_write_byte(argument0,tem);
This is a copy of the code from saveGame that saves the player's position. This allows you to save values greater than 255; you can save up to 1,000,000 in fact ;)

sunLoadLives
Code: [Select]
global.lifeCount = file_bin_read_byte(argument0)*10000;
global.lifeCount += file_bin_read_byte(argument0)*100;
global.lifeCount += file_bin_read_byte(argument0);
This is the reverse of the script above - it rebuilds the life count from the file in the opposite way that we encoded it.

Hooking Sunpossible Mode Into the Engine

Now that you've got your supporting scripts, let's hook them into the engine:

In the saveGame script, right before the call to file_bin_close, add this code:
Code: [Select]
sunSaveLives(f);And that's all you have to do to save your life count to your save file!

In the saveExe script, right before the call to file_bin_close, add this code:
Code: [Select]
sunLoadLives(f);And again, your life count has been loaded from the save file! MAKE SURE you save & load all the values in the same order - Game Maker doesn't know what each value in the file is, it relies on you to load them in the same order you saved them.

In the saveExe script, at the very end, add this code:
Code: [Select]
if (sunIsSunpossibleMode() && (sunGetRemainingLives() <= 0)) {
    with (player) instance_destroy();
    room_goto(rSunpossibleEnd);
}
This code checks as soon as you load the game (or when you press R after you die) and if it's sunpossible mode and you're out of lives; it sends you to a room to be used as a "permanent game over" room, which I named "rSunpossibleEnd". You could do anything else here, like deleting the save file or whatever, but this is the condition that cheks to see if the player is out of lives

In the World's "Press R-key" event, add this code:
Code: [Select]
if (sunIsSunpossibleMode() && room != rSunpossibleEnd && instance_exists(player)) {
    global.death[global.savenum] += 1;
    saveDeathTime();
}
This code is optional. It forces the player to lose a life if he's still alive when he presses R - perfect for those m9 traps :Kappa:



And that's all you should have to do to implement Sunpossible mode! Let me know if there are any bugs; I just typed this all directly into the post and so it's possible I typoed something :Kappa:

13
Off Topic / The Worst Song Ever
« on: February 13, 2014, 11:46:19 AM »
I made the worst song ever while watching TJ play crimson today. He was just playing his Slam Jam remixes, as usual, when I requested a Guy Rock + Slam Jam mashup. He checked for it, and returned from his search devastated, for he could not find it. In order to return order to the universe, I made it happen.

klazen.com/IWBTG/archive/I%20Wanna%20Slam%20the%20Jam.mp3

14
Gameplay & Discussion / Boshy W4 Skip Instructional Image
« on: February 12, 2014, 02:52:26 PM »
Someone posted an image of the path to take for the Boshy W4 skip a while back, and I thought I'd throw it up here for others to reference. It also explains why sometimes you can hear a strange noise during the trick ;)

I take no credit for this! If you know whose it is, let me know so I can credit them.

(click to show/hide)

15
Game Design / [UPDATED] Tutorial: Getting Started With Fangame Development
« on: February 12, 2014, 02:13:25 PM »
THIS TUTORIAL IS OUTDATED!  Version 2.0 can be found here

If you've ever said the words "I wanna make my own fangame" (pun intended), but have NO idea how to get started, then you're in the right place! I'm gonna try and go over all the basic information on Game Maker and fangame engines required to make your own fangame. This is by no means a comprehensive tutorial, it's just enough to get you on your feet. But after this tutorial, you should be able to start asking the right questions!

Note: screenshots of the editing process are included in the tutorial as "Spoilers". Just click the "Spoiler" button to see them!

Table of Contents:
Environment Setup: Get your computer ready to design fangames!
Learning the Basics: Try the example game provided with the engine!
Sprites: The images and animations in your game!
Objects: The actual "things"! Learn to code!
   DnD Actions: Simple and Abstract
   Script Actions: Complex and Powerful
Backgrounds: Because no one wants to play a game with a spring green background!
Sounds: Repeating guy rock? No thank you!
Rooms: The actual platforming and level design!
Advanced Topics: How the pros do it!
   Changing Rooms: For games longer than one level!
   Triggers: Who doesn't love a good troll trap every once in a while!
   Non-Restarting Music: Pretty self explanatory
Bosses: It gets serious from here!
        Giving your boss HP: So you can kill it, of course!
        Boss Movement: Gotta go fast! (not done yet :BibleThump: )
        Boss Attacks: Get Rekt! (not done yet :BibleThump: )
                Targetted Apples: Shooting at the player
                Apple-splosions: Rings of apples are dabes

Environment Setup

Alright, the first step in development is to get yourself set up with the tools you need. Most guy games (IWBTG and Boshy being the biggest counterexamples) are made using a program called Game Maker (hereby referred to as GM), from the company YoYo Games. The current version of GM is known as GM Studio, but don't go download that just yet...

A few kind developers have released "engines", or pre-made Game Maker game files, that already have all the physics ironed out for you. Unfortunately, the good engines are not made for GM Studio, but rather for an older version (Game Maker 8.1). So, in order to make fangames using these engines, you'll need to get GM 8.1. This version is out of production, so you'll have to find that on your own. We cannot provide you with a link for it. We can, however, provide you with links to the engines:


PLEASE do not use any engine but the ones above. All the good players are used to these physics; using a different engine will just piss them off ;) For this tutorial, we'll be using the Yuuutu edition (for the sole reason that it's what I'm currently using; I recommend using the Lemon edition when you really get started).

So now you should have downloaded and installed GM, and have downloaded one of the engines (Yuuutu). Open the engine file in GM (unzip it first if it's in a ZIP file!). Now we can get to work!

Learning the Basics

After opening the engine in GM:
(click to show/hide)

As a beginner, the very first thing you should do is run the sample game included with the engine and see what you're about to be dealing with. Run the game by pressing the green arrow on the toolbar at the top of the screen, or by pressing F5. It will start in traditional fangame fashion, and you can test it out for yourself. Why is it so important to play the sample game, you ask? Well, it's because we'll be modifying it, and I want you to know what everything is like before our modifications so you can see the effects.

Once you've had enough fun with the sample, press "Esc" to quit and be dumped back at the GM window.

At first, the GM interface can be daunting, but it's all divided up into easy-to-grasp sections, which you can see on the left of the window. Let's walk through these sections and see what's going on.

Sprites

"Sprite" is just fancy game developer lingo for an animated image. You'll use sprites for anything that isn't part of the background, or that may move in-game (think cherries, spikes, the player, bosses, etc). If you open the Sprites folder, you'll see a bunch of subfolders, which the engine developer made for you (you can make your own by right-clicking and choosing "Create Group"; same for making a new Sprite). Open up the "random threats" folder, and double-click the "sprSpikeUp" Sprite to open the Sprite Properties window.

(click to show/hide)

The Sprite Properties window allows you to modify the sprite. Click Edit Sprite to get the Sprite Editor window. Hover over all the buttons on the toolbar to figure out what they do. We'll be making an animated spike to get accustomed to the editor, so select image 0 (the spike image), and then click the copy button (the two sheets of paper) and the paste button (clipboard with paper) to create a second image frame (yes, ctrl-c/ctrl-v works). Go ahead and check the "Show Preview" box on the left too. The image you see is animated, but it doesn't look special yet because both frames of animation are the same. Let's change one to see what it does.

Sprite Editor:
(click to show/hide)

Select image 1, and then click the pencil button on the toolbar to open the Image Editor. This isn't an image editing tutorial, so I won't go into detail, but go ahead and make something of the spike. Do whatever you want, I'll wait for you ;) Once you're done playing with the image editor, click the green checkmark button at the top left to save the image.

Image Editor:
(click to show/hide)

Back at the sprite editor, you should see a rapidly-flashing animation of your new spike on the left. Change the "Speed" from 30 to something lower for a less epilepsy-inducing animation (like it says, this speed is only for the preview, we'll correct this in-game later). Press F5 to start the game, and go find a spike. You'll see it flashing like crazy. Be proud! You've just made your first animated spike, and are well on your way to crafting your own HD Spikes :) We'll fix the crazy flashing in the next section, Objects.

Already have some images you want to put in your game? Try File->Add From File. Got a single image with multiple frames of animation that you want to split and add all at once? Try File->Create From Strip. Anything else you'll have to Google for help; that's beyond the scope of our tutorial.

Create From Strip:
(click to show/hide)

Objects

Objects are the actual "things" in your game. They use sprites as their images, and their behaviour is determined by code you write (don't freak out just yet!). We just edited the sprite of the upwards spike, so let's open that object to fix the animation flashing. Open the Objects folder, then the generic threats folder, and finally double-click the spikeUp object. You'll get the Object Properties window, much like you got the Sprite Properties window when you double-clicked the spike sprite (see, it makes sense!).

(click to show/hide)

On the left, you'll see a bunch of parameters for the object:
  • Sprite: allows you to specify the sprite for the object. Clicking the name "sprSpikeUp" will bring up a list of sprites you can change to, but don't do that here.
  • "Visible" and "Solid" checkboxes: determine if the object is visible and solid when it is first created in-game.
  • Depth: determines the drawing order, with high values at the back, and low numbers in front (negative numbers are allowed). The depth of this spike is 10, which means that anything with a depth of 11 or higher shows up behind the spike ingame, and anything with a depth of 9 or less will be in front of the spike.
  • Persistent: basically means "keep this object alive even if you leave the room", don't check this unless you have a very good reason (you don't).
  • Parent: Specifying a Parent object makes this object "inherit" all behaviour from the parent - you can see here the spike is a child of "playerKiller"; any child of playerKiller will kill the kid on contact (playerKiller itself is an object in the engine - you can go look at it for more information).
  • Mask: The mask allows you to specify a sprite which acts as the "collision box". For instance, if you create a spike that isn't the exact same size as a regular spike, but want it to act exactly like a regular spike, use a regular spike sprite for the mask. You typically won't need to do this though.

The real meat of the object editor is in the Event/Action lists. This allows you to specify behaviour for the object. It's a cause & effect system: when an "event" happens, it performs a set of "actions". On the far right, you can see all the actions you can perform. It'll take a while, but you'll learn them if you keep trying. All of these are known as "Drag and Drop" actions, or "DnD" (helps to know this when you're Googling for help). For more advanced control, you'll need to actually write code. We'll fix the spike animation using both DnD and code, so you can see both in action.

But first, I want to make a small note about terminology. When talking about objects, you'll often hear the word "instance" used. You may not know what that means, or at least not what it means in programming lingo, but it's real simple. Think of an "Object" as a prototype, or blueprint, or set of instructions, from which you can create any amount of "Instances". GM gives you a special section to code for each individual instance, called Instance Creation Code. For example, if you have a moving platform that can go anywhere as the object, in the instance creation code you can specify the direction and speed for that particular platform. We'll revisit this topic later in "Rooms".

DnD Actions

Back to fixing our spike. First, we need to specify an event. We want to specify an "animation speed" for every instance of the spikeUp object. How can we do this? Why not have the game do it every time it creates an instance? Add a Create event with Add Event->Create. Now, select the Create event. The Actions list on the right now lists all the actions that happen at instance creation (none yet!). Click the "main1" tab on the right, and drag the "Change Sprite" action (the red Pacman) into the Actions list. In the action properties window, select the sprSpikeUp sprite from earlier, leave subimage as 0 (remember image 0/image 1 from the sprite editor? This field specifies which image we start at), and for speed type this exactly: 1/room_speed

Sprite Change Action Window:
(click to show/hide)

Technical information warning! "room_speed" is one of GM's built-in variables. Its value is the number of "ticks", or updates, that the game performs per second. You should never need to change this, but in the Yuuutu engine, it's 50. The "speed" is added to a counter behind-the-scenes every second, and the value of this counter determines which image of the sprite is to be drawn. This means that every "tick", 1/50 is added to the image counter, and since 50 "ticks" happen per second, the counter increases by 1 every second. If the counter goes past the number of images in the sprite, it just goes back to 0 and keeps going. So we get animation at one frame per second!

That's all you have to do to fix the animation! Go start the game again, and look at the spikes. Every second, they'll switch back and forth between the images you made in the sprite editor. If it's too slow for you, try raising the speed (2/room_speed would be 2 frames per second, 3/room_speed is 3, etc.) Also try adding more animation frames to make it look cooler!

Script Actions

Ok, that was the drag-and-drop tutorial. But for anything interesting, you'll need to delve into the code... so you might as well learn now! Code is added to actions just like the other DnD actions; go to the "Control" tab in the Object Properties window, and drag the "Execute Code" action (the piece of paper) into the Actions list. Brace yourself, because it will immediately open the Execute Code script editor. Luckily, all we are trying to do here is fix the image speed, so it'll take just one line of code. And... here... it... is:

Code: [Select]
image_speed = 1/room_speed;
Execute Code Action Window:
(click to show/hide)

Not bad, huh? Notice how the words "image_speed" and "room_speed" are both red? That means GM recognizes them as special variables, like I mentioned before. There will be a red highlight to the left of the text if you messed it up, so make sure you copied it exactly! Hit the green checkmark to save the script, and then, back at the Object Properties window, click the old DnD action in the list, and press the "Del" key to delete it. Now, there's only code controlling your object; let's go see how it does. Oh, what's that you say, it worked great? Good. Well, that's all I have to tell you about scripting, but PLEASE go read the GML (Game Maker Language) Reference at https://docs.yoyogames.com/source/dadiospice/002_reference/index.html to learn more about GML, the functions and variables you can use, and what you can do with it.

Tutorial continues in next post...

Pages: [1] 2