Youtube video of the engine in action .
Download the library here.
Download the demo map (Seen in the youtube vid) here.
I don't feel like making this a big flashy tutorial (for now anyway) so here are the basics:
Import the Library
Import the library into your map and change the library ID to 'WASD'. If you don't do this you won't be able to save the map.
Import the Sprites
Import the frames individually for each animation in the following name scheme:
/Sprites/(NPC Name)/(Animation Name)_(Direction)_(Frame).tga
For example, if I had an animation of Chronos walking toward the screen that was 4 frames long, I would import:
/Sprites/Chronos/Walk_2_0.tga
/Sprites/Chronos/Walk_2_1.tga
/Sprites/Chronos/Walk_2_2.tga
/Sprites/Chronos/Walk_2_3.tga
"Direction" is based on the numpad; 2 is down, 4 is left, 6 is right, 8 is up.
Create a Base Unit
Create a new base unit by duplicating a marine and its actor. Change the actor's models to 'Invisible' and change its Editor Model to whatever you like (This is so you can see it in the editor). Place a few of these base units on the map so we can attach sprites to them.
Define Your Sprites
Create an 'on map init' trigger. There are 3 functions you'll want to use here:
Define Sprite
This basic function attaches a unit name to an index. The name corresponds to the name used in your files, so it must match. Your first sprite will be index 0, next 1, next 2, etc. For a more elaborate approach, you should use a Preset that acts as a list of all of your sprites. I will elaborate more on this optional step later. There is currently a limit of 1024 maximum sprite templates.
Examples:
Define Sprite(0, "Chronos")
or if you're using a Record Set:
Define Sprite((Integer(Chronos)), "Chronos")
Define Sprite Animation
This function is similar to Define Sprite. It designates a new animation name to an animation index of a Sprite. The name corresponds to the animation name used in your files, so it too must match. First animation will be index 0, etc. You can specify how many frames are in the animation, the interval at which to play the animation (Basically each unit is 1/16 of a second delay) and whether the animation gets reversed or loops to the first frame when it ends. As with the Sprites, I would also recommend creating a Preset for animations. There is currently a limit of 16 animations per individual sprite.
Examples:
Define Sprite Animation(0, 0, "Walk", 5, 3, true)
or if you're using a Record Set:
Define Sprite Animation((Integer(Chronos)), (Integer(Walk)), "Stand", 5, 3, true)
Set Active Sprite
This function adds one of your defined sprites into the actual game world to be seen and used. You need to specify which Sprite you want to add, which base unit you want to attach it to (remember we made and placed these earlier) and what you want its default animation to be. There is currently a limit of 128 active sprites at any point in time (You will want to create/destroy sprites based on the player's vicinity).
Examples:
Add Active Sprite(0, My Base Unit [116.51, 131.22], 0)
or if you're using a Record Set:
Add Active Sprite((Integer(Chronos)), My Base Unit [116.51, 131.22], (Integer(Stand)))
Example Image
Here is an image showing how I use these 3 functions in my example map, which is also seen on the youtube preview:
Notice the last control (WASD Set Controlled Unit) sets my WASD-controlled unit to one of my sprites.
Start the Engine (Vroom Vroom)
All we need to do now is start the engine. Make a periodic trigger that runs every 0.0 seconds. Add the function "Animate Sprites()". Voila, you're done.
Make it Playable
Basically all that's left is making it playable. For now the engine uses WASD to determine which way the unit is facing, so you'll have to use WASD or implement your own direction-setting function. Simply hook up one of your Base Units as the Controlled Unit, add your KeyDown/KeyUp trigger checks and add a camera-follow function (If applicable). You can find more info on using my WASD system here.
Optional but Recommended: Using Presets
Managing all of your code with this system will be a nightmare unless you use presets to organize all of your sprites. For instance, what sprite does the index 57 represent? Who knows, I'd have to go check! With a preset, you basically assign those index numbers to a recognizable name. For instance, instead of "0, 1 and 2" you could reference "Hero, Lady NPC and Dog NPC". For animations, instead of "0, 1 and 2" you could reference "Stand, Walk and Attack". New->New Preset Type (Or ctrl+P) in your trigger list will create a new preset. Then you use use New Element (Or ctrl+W) to add a preset name. It handles all of the assigning indexes for you, so you don't have to deal with it. Simply use them as indexes in place of integers. Easy, clean, fun!
Nice :) Defenatly something neat you figured our there :) imagine using trasparents srites from KH when someone does a special attack :) im sure its possible with a 3D program But with this there is more versitility for graphix :) someone could even include paper mario, classic pixel megaman or even some bitAugumons in the game play^.^
Hi, sorry I'm quite new to to this still.
I wanna put sprites in but do I need to connect the animations to wasd? because I want to use click to move with my sprites.
Book your airport taxi now! Enjoy airport taxi transfer from your front door to the airport gate. No hidden fees. Only fixed prices and comfortable transfers.
Import the Library
Import the library into your map and change the library ID to 'WASD'. If you don't do this you won't be able to save the map.Import the Sprites
Import the frames individually for each animation in the following name scheme: /Sprites/(NPC Name)/(Animation Name)_(Direction)_(Frame).tga For example, if I had an animation of Chronos walking toward the screen that was 4 frames long, I would import: /Sprites/Chronos/Walk_2_0.tga /Sprites/Chronos/Walk_2_1.tga /Sprites/Chronos/Walk_2_2.tga /Sprites/Chronos/Walk_2_3.tga "Direction" is based on the numpad; 2 is down, 4 is left, 6 is right, 8 is up.Create a Base Unit
Create a new base unit by duplicating a marine and its actor. Change the actor's models to 'Invisible' and change its Editor Model to whatever you like (This is so you can see it in the editor). Place a few of these base units on the map so we can attach sprites to them.Define Your Sprites
Create an 'on map init' trigger. There are 3 functions you'll want to use here:Define Sprite
This basic function attaches a unit name to an index. The name corresponds to the name used in your files, so it must match. Your first sprite will be index 0, next 1, next 2, etc. For a more elaborate approach, you should use a Preset that acts as a list of all of your sprites. I will elaborate more on this optional step later. There is currently a limit of 1024 maximum sprite templates. Examples: Define Sprite(0, "Chronos") or if you're using a Record Set: Define Sprite((Integer(Chronos)), "Chronos")Define Sprite Animation
This function is similar to Define Sprite. It designates a new animation name to an animation index of a Sprite. The name corresponds to the animation name used in your files, so it too must match. First animation will be index 0, etc. You can specify how many frames are in the animation, the interval at which to play the animation (Basically each unit is 1/16 of a second delay) and whether the animation gets reversed or loops to the first frame when it ends. As with the Sprites, I would also recommend creating a Preset for animations. There is currently a limit of 16 animations per individual sprite. Examples: Define Sprite Animation(0, 0, "Walk", 5, 3, true) or if you're using a Record Set: Define Sprite Animation((Integer(Chronos)), (Integer(Walk)), "Stand", 5, 3, true)Set Active Sprite
This function adds one of your defined sprites into the actual game world to be seen and used. You need to specify which Sprite you want to add, which base unit you want to attach it to (remember we made and placed these earlier) and what you want its default animation to be. There is currently a limit of 128 active sprites at any point in time (You will want to create/destroy sprites based on the player's vicinity). Examples: Add Active Sprite(0, My Base Unit [116.51, 131.22], 0) or if you're using a Record Set: Add Active Sprite((Integer(Chronos)), My Base Unit [116.51, 131.22], (Integer(Stand)))Example Image
Here is an image showing how I use these 3 functions in my example map, which is also seen on the youtube preview: Notice the last control (WASD Set Controlled Unit) sets my WASD-controlled unit to one of my sprites.Start the Engine (Vroom Vroom)
All we need to do now is start the engine. Make a periodic trigger that runs every 0.0 seconds. Add the function "Animate Sprites()". Voila, you're done.Make it Playable
Basically all that's left is making it playable. For now the engine uses WASD to determine which way the unit is facing, so you'll have to use WASD or implement your own direction-setting function. Simply hook up one of your Base Units as the Controlled Unit, add your KeyDown/KeyUp trigger checks and add a camera-follow function (If applicable). You can find more info on using my WASD system here.Optional but Recommended: Using Presets
Managing all of your code with this system will be a nightmare unless you use presets to organize all of your sprites. For instance, what sprite does the index 57 represent? Who knows, I'd have to go check! With a preset, you basically assign those index numbers to a recognizable name. For instance, instead of "0, 1 and 2" you could reference "Hero, Lady NPC and Dog NPC". For animations, instead of "0, 1 and 2" you could reference "Stand, Walk and Attack". New->New Preset Type (Or ctrl+P) in your trigger list will create a new preset. Then you use use New Element (Or ctrl+W) to add a preset name. It handles all of the assigning indexes for you, so you don't have to deal with it. Simply use them as indexes in place of integers. Easy, clean, fun!This is pretty cool. Thanks.
jesus scratch is the biggest piece of sh.
i got some sprite sheets and i read that u can edit them on scratch but the piece of sh doesnt export in a usable format.
any recommendable software for editing and exporting sprite sheets?
Nice :) Defenatly something neat you figured our there :) imagine using trasparents srites from KH when someone does a special attack :) im sure its possible with a 3D program But with this there is more versitility for graphix :) someone could even include paper mario, classic pixel megaman or even some bitAugumons in the game play^.^
Hi, sorry I'm quite new to to this still. I wanna put sprites in but do I need to connect the animations to wasd? because I want to use click to move with my sprites.
Book your airport taxi now! Enjoy airport taxi transfer from your front door to the airport gate. No hidden fees. Only fixed prices and comfortable transfers.
https://atobtransfer.com/