GreenTree-Studios

Creator of Dragon Bones
Veteran
Joined
Feb 3, 2021
Messages
36
Reaction score
11
First Language
English
Primarily Uses
RMMV
I am going to try one last approach to redoing the fossil fighters-style cleaning scene. This time with character sprites that change depending on the currently equipped tool's interaction with the rock.

This is the sprite sheet I'm using for the fossil trapped inside said rock: 7_H_0.png
And this is what it should look like assembled in-game: 7H.png
To explain, the DS games (Fossil Fighters and its first sequel, Champions) use, not exactly layers, but individual sprites that are meant to resemble layers. The sprite sheet shown above consists of 111 (the remaining 33 are empty) individual 48x48 pixel sprites containing parts of the fossil. I'm currently trying to figure out a way to include character sprites in a custom scene outside of any custom windows. Thank you once again in advance.
- sincerely, GreenTree
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
1,283
Reaction score
824
First Language
Javascript
Primarily Uses
RMMZ
I am going to try one last approach to redoing the fossil fighters-style cleaning scene. This time with character sprites that change depending on the currently equipped tool's interaction with the rock.

This is the sprite sheet I'm using for the fossil trapped inside said rock: View attachment 241890
And this is what it should look like assembled in-game: View attachment 241891
To explain, the DS games (Fossil Fighters and its first sequel, Champions) use, not exactly layers, but individual sprites that are meant to resemble layers. The sprite sheet shown above consists of 111 (the remaining 33 are empty) individual 48x48 pixel sprites containing parts of the fossil. I'm currently trying to figure out a way to include character sprites in a custom scene outside of any custom windows. Thank you once again in advance.
- sincerely, GreenTree
Hmm.. couple things... it's actually not 48x48... pretty sure it's 24x24

Primary example is this:
1664858775062.png
The thick red square is 48x48 the smaller red squares are 24x24
if you tried to use the 48x48 as a "piece" of the tilemap/sprite sheet it just wouldn't really work out.

That said I have made a plugin to show the base process of how to use this.. though I'm still unsure of the pattern layout of the most efficient way to reassemble this.

..but to answer you main question see the plugin I've made for an example of how to use a sprite sheet like this in a custom scene.

To test the plugin place your fossil sprite sheet image in a folder in "img/fossil" then add it to the plugin parameter setting.
1664859402690.png

I only got this much done though...

1664859201156.pngsince it's quite a process to reassemble, I leave the rest up to you... but that plugin should at least sort of show you how it's done.

Anyways here is the plugin demo:
CTB_FossilsMZ Plugin: Click Here to Download

To start the custom scene use the following script:
JavaScript:
CTB.FossilsMZ.Play()

Again this was just a very rough example of how to do this. Just for demonstration purposes.
Hope you can at least get an idea from the code.
 

GreenTree-Studios

Creator of Dragon Bones
Veteran
Joined
Feb 3, 2021
Messages
36
Reaction score
11
First Language
English
Primarily Uses
RMMV
I managed to get it to work: 1664926378528.png

But before I give the official "thank you", I would like to know something else: Can the individual cells be changed to other sprites outside of the currently used sprite sheet? Allow me to elaborate:

As part of the cleaning system, I created four tools provided to the play for carving the fossil out of the rock without breaking it.

Cloth - used for clearing off loose debris. Does not break fossil inside of rock nor does it break through rock.
Drill - used for puncturing holes through the rock. Can potentially break fossil if not careful. Shown in the example image below.
Hammer - breaks a small radius of rock, can easily break fossil.
Chisel - useful for finding Buster Points or weak spots in the rock to break certain parts of it away from the fossil. An alternative to just using the hammer. Otherwise can be used to chip holes similar size to the drill.

Taking the drill I puncture a hole through this rock, notice the center of the red circle being a darker brown than the upper layer.


Example.png


I just want to know if its possible with the similar logic to autotiles (for say if I used drilled around the red circle's edge to make a bigger hole in the rock).
 

GreenTree-Studios

Creator of Dragon Bones
Veteran
Joined
Feb 3, 2021
Messages
36
Reaction score
11
First Language
English
Primarily Uses
RMMV
@ct_bolt: I want to know how to select a single sprite while holding the left mouse button using TouchInput.isPressed() in order to make it seem invisible. Thank you for the demonstration btw.

This is the code I'm currently using:

JavaScript:
Scene_FossilGame.prototype.update = function() {
        Scene_MenuBase.prototype.update.call(this);
        this.updateFossil();
    };
    Scene_FossilGame.prototype.updateFossil = function(){
        const cellSize = 24;
        const toolX = TouchInput.x;
        const toolY = TouchInput.y;
        const cols  = $_$._fossilBitmap.width  / cellSize;
        const rows  = $_$._fossilBitmap.height / cellSize;
        for(var i = 0; i < rows*cols; i++){
            if(drillEquipped == true && TouchInput.isPressed()){
                if(toolX >= this._fossilPieces[i].x && toolY <= this._fossilPieces[i].y + 24){
                    this._fossilPieces[i].visible = false;
                }
            }
        }
    };

I managed to get to work but it only affects multiple sprites, when I'm aiming for one sprite at a time. What is your thought process in order to solve this?
 

GreenTree-Studios

Creator of Dragon Bones
Veteran
Joined
Feb 3, 2021
Messages
36
Reaction score
11
First Language
English
Primarily Uses
RMMV
Never mind! solved that one!

JavaScript:
Scene_FossilGame.prototype.update = function() {
        Scene_MenuBase.prototype.update.call(this);
        this.updateFossil();
    };
    Scene_FossilGame.prototype.updateFossil = function(){
        const cellSize = 24;
        const toolX = TouchInput.x;
        const toolY = TouchInput.y;
        const cols  = $_$._fossilBitmap.width  / cellSize;
        const rows  = $_$._fossilBitmap.height / cellSize;
        for(var i = 0; i < 522; i++){
            if(drillEquipped == true && TouchInput.isPressed()){
                if(toolX >= this._fossilPieces[i].x && toolX < this._fossilPieces[i].x + 24){
                    if(toolY >= this._fossilPieces[i].y && toolY < this._fossilPieces[i].y + 24){
                        this._fossilPieces[i].visible = false;
                    }
                }
            }
        }
    };
 

GreenTree-Studios

Creator of Dragon Bones
Veteran
Joined
Feb 3, 2021
Messages
36
Reaction score
11
First Language
English
Primarily Uses
RMMV
Now the question is how to replace the sprite clicked on with a new sprite from a different sheet?
 

GreenTree-Studios

Creator of Dragon Bones
Veteran
Joined
Feb 3, 2021
Messages
36
Reaction score
11
First Language
English
Primarily Uses
RMMV
Thanks for helping me get started, Bolt!:
 

Roxus

Veteran
Veteran
Joined
Oct 22, 2022
Messages
51
Reaction score
31
First Language
English
Primarily Uses
RMMZ
This is a really interesting and unique idea.
Do you guys mind if I can use it too? I am new to RPGM but I am trying to make a game.
I will of course credit both of you, if I manage to make it work that is xD
 

Latest Threads

Latest Posts

Latest Profile Posts

ScreenShot_11_27_2022_10_0_8.png
finally finished all the sprites for my friend's Comic book OC that I put in my game.
1669612924226.png
Added collectible trading cards to my current game, bio-Synthetica.
I plan to have a total of 20 different BATTLE-bot cards you can find & collect.
100 likes.jpg

I reached 100 followers on my new twitter! It's not much but it's honest work
Made this sign for a you-know-what type of business, completely from scratch.
Gotta admit, i'm extremely proud of it.

image.png

Forum statistics

Threads
126,892
Messages
1,182,140
Members
166,692
Latest member
roseribbon
Top