Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

how to create .json or .hscript for a character?

A topic by NikRetaNCAM created Jul 12, 2021 Views: 4,503 Replies: 6
Viewing posts 1 to 5
(-1)

I want my characters to go with it's own offset and them not to flow

first open the hscript (i use weeklys mainly so i dont have any json stuff for you)

then open the xml of you char then copy the animation names and numbers to the correct place like this

trace(": )");

// char is a Character

function init(char) {

    trace(": )");

    var tex = FlxAtlasFrames.fromSparrow(hscriptPath + 'char.png', hscriptPath + 'char.xml');

    trace(": )");

    char.frames = tex;

    char.animation.addByPrefix('idle', 'Idle', 34, false);

    char.animation.addByPrefix('singUP', 'Sing Up', 7, false);

    char.animation.addByPrefix('singLEFT','Sing Left', 7, false);

    char.animation.addByPrefix('singRIGHT', 'Sing Right', 7, false);

    char.animation.addByPrefix('singDOWN', 'Sing Down', 7, false);

    trace("finish anim");

    char.addOffset('idle', 2, -42);

    char.addOffset('singUP',-6, 73);

    char.addOffset('singRIGHT',-36, 17);

    char.addOffset('singLEFT', 64, 6);

    char.addOffset('singDOWN', 1, -363);

    char.playAnim('idle');

    char.flipX = false;

    char.enemyOffsetX = 0;

    char.enemyOffsetY = 0;

    char.playerOffsetX = 0;

    char.playerOffsetY = 0;

    char.followCamX = 259;

    char.followCamY = -100;

    char.midpointX = 0;

    char.midpointY = 0;

}

portraitOffset = [0, 0];

dadVar = 6.1;

isPixel = false;

function update(elapsed, char) {

    // do nothing...

}

var danced = false;

function dance(char) {

    trace(": )");

    char.playAnim('idle');

}

trace("done");

then simpley add it to custom_chars.jsonc

and bam and dont forget to add the icons and such like this

,"tord" : {

         "icons" : [

             0

            ,1

            ,2

        ]

        ,"colors" : [

             "#EE20D9"

        ]

        ,"like" : "tord"

there you go with hscript and modcharts are possible in weeklys in the hscript format

also the offset pos is easy just press 8 in a song with your char and then postion him then go back to the hscript then do this

char.addOffset('idle', 0, -155);

    char.addOffset('singUP', -6, -155);

    char.addOffset('singRIGHT',0, -155);

    char.addOffset('singLEFT', -10, -155);

    char.addOffset('singDOWN', 0, -155);

and bam you are good

how do you make a .json file

sadly idk

(1 edit)

i use pyshengine and i try to port scratch cat heres the xml 

<?xml version='1.0' encoding='utf-8'?>

<TextureAtlas imagePath="scratchcat.png"><SubTexture name=" idle0000" x="0" y="0" width="189" height="165" frameX="0" frameY="0" frameWidth="189" frameHeight="165" />

<SubTexture name=" left0000" x="189" y="0" width="189" height="165" frameX="0" frameY="0" frameWidth="189" frameHeight="165" />

<SubTexture name=" right0000" x="0" y="165" width="189" height="165" frameX="0" frameY="0" frameWidth="189" frameHeight="165" />

<SubTexture name=" down0000" x="189" y="165" width="189" height="165" frameX="0" frameY="0" frameWidth="189" frameHeight="165" />

<SubTexture name=" up0000" x="0" y="330" width="189" height="165" frameX="0" frameY="0" frameWidth="189" frameHeight="165" />

<SubTexture name=" hey0000" x="189" y="330" width="189" height="156" frameX="0" frameY="0" frameWidth="189" frameHeight="156" />

</TextureAtlas> the hey is the scream

how to make gf invisible?