Help with my code

Status
Not open for further replies.

Taco7

Warper
Member
Joined
Mar 23, 2020
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMV
JavaScript:
function oneAnimationFrame() {
    // Picture Index for each slot
    idx = {
        base: 5,
        cage: 6,
        lower: 7,
        upper: 8,
        eyes: 9,
        mouth: 10,
        neck: 11,
        outfit: 12
    }
    // Base/Naked Always Rendered
    numstring = ($aframe < 10 ? base + "0" : "") + String($aframe)
    basepic = $animbase + numstring
    $gameScreen.showPicture(idx['base'], fullpic, 0, 0, 0, 100, 100, 255, 0);
    if($gameActors.actor(1).equips()[5] != null) {
        switch($gameActors.actor(1).equips()[5].id) {
            case 8:
                eqname = "cage";
                break;
            default:
                console.log("Error, you're not wearing a cage!");
        }
        cagepic = $animbase + eqname + numstring;
        $gameScreen.showPicture(idx['cage'], cagepic, 0, 0, 0, 100, 100, 255, 0);
    }
    if($gameActors.actor(1).equips()[4] != null) {
        switch($gameActors.actor(1).equips()[4].id) {
            case 2:
                eqname = "frill";
                break;
            case 4:
                eqname = "red";
                break;
            case 5:
                eqname = "blue";
                break;
            case 7:
                eqname = "green";
                break;
            default:
                console.log("Error, you're not wearing a lower item!");
        }
        lowerpic = $animbase + eqname + numstring;
        $gameScreen.showPicture(idx['lower'], lowerpic, 0, 0, 0, 100, 100, 255, 0);
    }
    if($gameActors.actor(1).equips()[6] != null) {
        switch($gameActors.actor(1).equips()[6].id) {
            case 3:
                eqname = "Frin";
                break;
            default:
                console.log("Error, you're not wearing an upper item!");
        }
        upperpic = $animbase + eqname + numstring;
        $gameScreen.showPicture(idx['upper'], upperpic, 0, 0, 0, 100, 100, 255, 0);
    }
    if($gameActors.actor(1).equips()[9] != null) {
        switch($gameActors.actor(1).equips()[9].id) {
            case 11:
                eqname = "fall";
                break;
            default:
                console.log("Error, you're not wearing an eye effect!");
        }
        eyespic = $animbase + eqname + numstring;
        $gameScreen.showPicture(idx['eyes'], eyespic, 0, 0, 0, 100, 100, 255, 0);
    }
    if($gameActors.actor(1).equips()[8] != null) {
        switch($gameActors.actor(1).equips()[8].id) {
            case 10:
                eqname = "bit";
                break;
            default:
                console.log("Error, you're not wearing a mouth item!");
        }
        mouthpic = $animbase + eqname + numstring;
        $gameScreen.showPicture(idx['mouth'], mouthpic, 0, 0, 0, 100, 100, 255, 0);
    }
    if($gameActors.actor(1).equips()[7] != null) {
        switch($gameActors.actor(1).equips()[7].id) {
            case 9:
                eqname = "col";
                break;
            default:
                console.log("Error, you're not wearing a neck accessory!");
        }
        neckpic = $animbase + eqname + numstring;
        $gameScreen.showPicture(idx['neck'], neckpic, 0, 0, 0, 100, 100, 255, 0);
    }
    if($gameActors.actor(1).equips()[3] != null) {
        switch($gameActors.actor(1).equips()[3].id) {
            case 6:
                eqname = "apr";
                break;
            default:
                console.log("Error, you're not wearing an outfit!");
        }
        outfitpic = $animbase + eqname + numstring;
        $gameScreen.showPicture(idx['outfit'], outfitpic, 0, 0, 0, 100, 100, 255, 0);
    }
}
A friend of mine is helping me with this code for my game, but he is better at vxace then mv so we're having trouble. I was hoping someone could tell me what's wrong with the code. It's supposed to show a bunch of different layers of a character animation.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
And what IS it doing?
 

Taco7

Warper
Member
Joined
Mar 23, 2020
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMV
Sorry for not being more clear. It wasn't doing anything.
But that was just do to a few errors in the code. I was able to figure it out after banging my head against a wall for a few hours. thank you anyway.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
@Taco7 good that you solved it, in such cases just report your topic to have it closed.

And for future cases: we can help a lot, but the more complex a problem is the more info we need to understand what happens and how to solve it. We don't have crystal balls to guess what happens on your computer ;-)
If we get the details we need, a problem can be solved quickly. What really delays problems (sometimes for several days) is when we have to ask for details and the OP has to give them and wait for our next question and so on.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top