MV Anyone know how to combine them?

I have a dashing and idle plugin command to switch actors graphic using common events. If I use one or the other it works fine but if I leave both commands in the js I get this.

error max.JPG


Is there a way to write this so they would conflict? I'm new to scripting so i just copied the idle/dead one to make the dash one. here's the js.

dead dash.JPG
Is there a way to write this so they would conflict?
I presume you mean "wouldn't" conflict.
I'm new to scripting so i just copied the idle/dead one to make the dash one.
This is just never a great idea, trying to make Frankenstein code if you don't actually know what you're doing. Would you say "I don't know how to fix cars, so I just shoved this tube from this car into that hole on that one"? 😛

I mean, it's fine that you're new to coding, but you should do some proper tutorials before trying to put stuff into your game. Looking at your screenshot I see two functions that have two duplicated names each - it is a very basic piece of knowledge that every function you want to use has to have its own name (and, in this case, you wouldn't use that many functions, you'd incorporate your changes into one).

It's clear you don't understand what the code says at all (which, again, is fine, I'm not trying to insult you, but you should be posting to ask for help on how to do this before copying code completely randomly). You wouldn't sit down at the piano having never taken any lessons and bang on it, asking, "Is this what a Bach Minuet sounds like?" 😉

So let's start over - what is the basic plugin you're using? Where did you get the two things you're trying to combine?
I posted several times offering money for people to make changes to the plugin I’m using and never once got a reply or any real help. I even tried fiver. I got fed up waiting so I started tampering with it myself and while I might not know much about coding I’ve gotten several things to work the way I wanted them too. I understand that these are two separate login commands in the one is just a copy but it’s all I have to go off of.
This is edited off of the ex character creator found at http://sumrndm.site/character-creator-ex/
I’ve added a idle and dash to this as well
I got fed up waiting so I started tampering with it myself
That's completely understandable, but again, your self-tampering ought to start with some JavaScript tutorials until you actually know what you're doing. What you did up there is drop a muffin, a hot dog, and Chinese chicken and broccoli into a mixing bowl in the hope you'd end up with pizza 😉 😛 It's just wasting your time that could be spent in an orderly fashion, making progress.

Anyway.

I presume your goal is to add a new plugin command? So you'd do SetDashCustomCharacter id true/false and replace the image?
That's completely understandable, but again, your self-tampering ought to start with some JavaScript tutorials until you actually know what you're doing. What you did up there is drop a muffin, a hot dog, and Chinese chicken and broccoli into a mixing bowl in the hope you'd end up with pizza 😉 😛 It's just wasting your time that could be spent in an orderly fashion, making progress.

Anyway.

I presume your goal is to add a new plugin command? So you'd do SetDashCustomCharacter id true/false and replace the image?
Yes. When you get out of the character creator, I have the idle controlled by common event that watches for directional input. I also have one that checks for if the shift button is being pressed for dash. Come to think of it the code might not actually have it as big an issue as I’m thinking. I get the error when I press the shift key. I wonder at certain points if it’s trying to place the idle and dash on top of each other?
Been watching this thread since I am also interested in similar modifications to the CCEX plugin, so I completely empathize with the frustrations with trying to find help with it -- if the issue is only happening when you press the shift key, then yeah, it sounds like it’s trying to change to both the idle and the dash at the same time. Your issue might be with how you're executing the plugin commands in your common event. Make sure that your isDashing command is nested in isMoving. Try something like this:
1631191763858.png


I'm sure there's a way to make this happen inside your edited CCEX, so all you have to do is execute the plugin command. I'm afraid I also know zero Javascript so I can't tell you how to do that in the .js file, but it's a starting point, at least. Give it a shot and see if it solves the error, and if it does, maybe someone who knows a little more than I do can advise you on a way to incorporate this into the plugin! If it doesn't solve the error, then I apologize!
Been watching this thread since I am also interested in similar modifications to the CCEX plugin, so I completely empathize with the frustrations with trying to find help with it -- if the issue is only happening when you press the shift key, then yeah, it sounds like it’s trying to change to both the idle and the dash at the same time. Your issue might be with how you're executing the plugin commands in your common event. Make sure that your isDashing command is nested in isMoving. Try something like this:
View attachment 200830

I'm sure there's a way to make this happen inside your edited CCEX, so all you have to do is execute the plugin command. I'm afraid I also know zero Javascript so I can't tell you how to do that in the .js file, but it's a starting point, at least. Give it a shot and see if it solves the error, and if it does, maybe someone who knows a little more than I do can advise you on a way to incorporate this into the plugin! If it doesn't solve the error, then I apologize!
Sweet I’ll give that a shot when I get home tonight. My work might not be perfect when it comes to the coding but just let me know if your trying to add poses and I can show you what I figured out. The only thing it seems to have issues with is changing the hue on pieces but Im not using that anyway. The color changes make pieces look weird. I figure if somebody really wants a piece change they can take the baseball and change it in their program of choice . I’m making a custom art character generator for people to build characters for their own games. I wanted to add a dash and an idle because I thought that help people out a lot.
@KillerPixEEL I am very interested in hearing about what you figured out for how to add idle and dash to CCEX!
Also if you know how to increase the number of walking frames from 3 to 6? I have a 6 frame walking animation, currently using Galv's Character Animations to make it work.

I would love to add the ability for users to create the character, rather than me pre-building options for them.
@KillerPixEEL Thank you, adding poses is definitely an end goal for me -- not for idle/dash, but for things like sitting down, and possibly swinging a tool! I'd love to hear what you figured out.

@patternBlue I haven't tested this out yet, but I believe that the relevant code for more walking frames is here
_.width = parseInt(params['Character Width']);
_.height = parseInt(params['Character Height']);
_.fileWidth = _.width * 3;
_.fileHeight = _.height * 4;

const pw = bitmap.width / (big ? 3 : 12);
const ph = bitmap.height / (big ? 4 : 8);

Try changing * 3 to * 6, and 3 : 12 to 6 : 24.
@KillerPixEEL Thank you, adding poses is definitely an end goal for me -- not for idle/dash, but for things like sitting down, and possibly swinging a tool! I'd love to hear what you figured out.

@patternBlue I haven't tested this out yet, but I believe that the relevant code for more walking frames is here
_.width = parseInt(params['Character Width']);
_.height = parseInt(params['Character Height']);
_.fileWidth = _.width * 3;
_.fileHeight = _.height * 4;

const pw = bitmap.width / (big ? 3 : 12);
const ph = bitmap.height / (big ? 4 : 8);

Try changing * 3 to * 6, and 3 : 12 to 6 : 24.
Thanks! I will give this a test sometime soon. I'm excited to see if this will do the trick.
Been watching this thread since I am also interested in similar modifications to the CCEX plugin, so I completely empathize with the frustrations with trying to find help with it -- if the issue is only happening when you press the shift key, then yeah, it sounds like it’s trying to change to both the idle and the dash at the same time. Your issue might be with how you're executing the plugin commands in your common event. Make sure that your isDashing command is nested in isMoving. Try something like this:
View attachment 200830

I'm sure there's a way to make this happen inside your edited CCEX, so all you have to do is execute the plugin command. I'm afraid I also know zero Javascript so I can't tell you how to do that in the .js file, but it's a starting point, at least. Give it a shot and see if it solves the error, and if it does, maybe someone who knows a little more than I do can advise you on a way to incorporate this into the plugin! If it doesn't solve the error, then I apologize!
Nevermind it come up after title screen.... There something conflicting with the two plugin command calls.

UPDATE:

so I played around with the wording in the plugin command script and got it to work. lol It works perfectly but I'm worried all my tampering is going to hit some errors someday XD


UPDATE: "Damit.... lol I changed I thought it worked but it just changed the walking graphic to dashing....
Very excited to report that I got poses working as well! So far I just have the one additional spritesheet (a 3x4 "pose" sheet with four different sitting poses), but once I whip up some more base sprites to test with, I plan on adding some swinging animations as well. :>

I DID run into an error myself at one point -- different from your max call stack exceeded, tho. I got an error where the game thought that plugin wasn't even installed lol. What fixed that for me was starting fresh, and then going back in and adding in one line of extra code at a time, testing the game to see if the error popped up after each code. Turns out my error was a typo on my part, I had missed a closing bracket!

@KillerPixEEL That's honestly really interesting that it changed the walking graphic to dashing? Like, without using any plugin commands, just the default "walk" animation is now your dashing animation? What does your folder structure look like? For example, in each of my generator sections, I have:
/walk/
/dead/
/face/
/sv/
/pose/

I assume yours probably looks something like this?
/walk/
/dead/
/face/
/sv/
/idle/
/dash/

Dumb troubleshooting question, but are all the graphics in your /walk/ folders using your walk sprites? Is it possible that you accidentally copied some of the images for your dash sprites in there?

If all your graphics are indeed in order, then I'm not sure what the problem is, but I'd love to help you figure it out, since you gave me the confidence to try and attempt coding it in myself! Were you able to get the dash working just by itself, without adding in the code for the idle command?
How did you set up your plug-in command for the sitting pose? I think the reason it changed it to a dash is because when I copied the code for the dead/idle plug in command I changed the ) else ( to dashing instead of walk I guess. I took out the dead pose because I didn’t like the three downward facing set up and changed it to my idle 8 x 4 sheet. Besides that I added the dash pose and a preview in the file list that contains the name and a description of every part and location so people can grab the parts that they use to make their own character sheets.
Well, to start, I took a leaf from your book, and I looked at every instance of "dead" and "dataDd," and replicated it. Instead of "dead," I used "pose," and instead of dataDd, i used dataPs. I did have to make some changes to the code, though. For example, I remember this posed a problem for me:

Spoiler
Code:
Game_CharacterCreations.prototype.buildBitmapDead = function(id, info) {
    if($gameTemp.deadConstructor === undefined) {
        $gameTemp.deadConstructor = new Window_CharacterCreator_Preview(0, 0, _.fileWidth, _.height);
        $gameTemp.deadConstructor._sprite.x = 0;
        $gameTemp.deadConstructor._sprite.y = 0;
    }
    const data = info || this.getInfo(id, 'dead');
    if(!data) return null;
    $gameTemp.deadConstructor.setInfo(data);
    const bit = Bitmap.snapSprite($gameTemp.deadConstructor._sprite, _.fileWidth, _.height);
    const result = new Bitmap(_.fileWidth, _.fileHeight);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, 0);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, _.height * 1);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, _.height * 2);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, _.height * 3);
    return result;
};

That returns the standard dead pose: single sprite, three frames. I couldn't use that with my 3x4 sprite sheet, so I rewrote that part by refererencing the constructor for the walk sprite (charConstructor).

That's just one, possibly irrelevant, thought I had for what might be posing a challenge w the dash sprite. I'm stuck at work now so I don't have access to my computer with my game stuff on it, unfortunately, but this evening I'll look at my code and let you know exactly how I set up the plugin command!

Edit: Out of work! Here's what I meant about needing to change the buildBitmap for the pose sheet:

Spoiler: buildBitmapPose
JavaScript:
Game_CharacterCreations.prototype.buildBitmapPose = function(id, info) {
    if($gameTemp.poseConstructor === undefined) {
        $gameTemp.poseConstructor = new Window_CharacterCreator_Preview(0, 0, _.fileWidth, _.fileHeight);
        $gameTemp.poseConstructor._sprite.x = 0;
        $gameTemp.poseConstructor._sprite.y = 0;
    }
    const data = info || this.getInfo(id, 'pose');
    if(!data) return null;
    $gameTemp.poseConstructor.setInfo(data);
    const bit = Bitmap.snapSprite($gameTemp.poseConstructor._sprite, _.fileWidth, _.fileHeight);
    return bit;
};

And here's how i set up the plugin command!

Spoiler: Game_Interpreter_pluginCommand
JavaScript:
_.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _.Game_Interpreter_pluginCommand.apply(this, arguments);
    if(command.trim().toLowerCase() === 'opencharactercreator') {
        $gameCharacterCreations._tempActorId = parseInt(args[0]);
        SceneManager.push(Scene_CharacterCreator);
    } else if(command.trim().toLowerCase() === 'setdeadcustomcharacter') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor._isDeadCustomCharacter = (args[1].trim().toLowerCase() === 'true');
        actor._neededCustomUpdate = true;
    } else if(command.trim().toLowerCase() === 'setposecustomcharacter') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor._isPoseCustomCharacter = (args[1].trim().toLowerCase() === 'true');
        actor._neededCustomUpdate = true;
    } else if(command.trim().toLowerCase() === 'disablecharactercreatorimages') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor["character-creator"] = true;
        actor._neededCustomUpdate = true;
    } else if(command.trim().toLowerCase() === 'enablecharactercreatorimages') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor["character-creator"] = false;
        actor._neededCustomUpdate = true;
    }
};

Lmk if this helps any!
Well, to start, I took a leaf from your book, and I looked at every instance of "dead" and "dataDd," and replicated it. Instead of "dead," I used "pose," and instead of dataDd, i used dataPs. I did have to make some changes to the code, though. For example, I remember this posed a problem for me:

Spoiler
Code:
Game_CharacterCreations.prototype.buildBitmapDead = function(id, info) {
    if($gameTemp.deadConstructor === undefined) {
        $gameTemp.deadConstructor = new Window_CharacterCreator_Preview(0, 0, _.fileWidth, _.height);
        $gameTemp.deadConstructor._sprite.x = 0;
        $gameTemp.deadConstructor._sprite.y = 0;
    }
    const data = info || this.getInfo(id, 'dead');
    if(!data) return null;
    $gameTemp.deadConstructor.setInfo(data);
    const bit = Bitmap.snapSprite($gameTemp.deadConstructor._sprite, _.fileWidth, _.height);
    const result = new Bitmap(_.fileWidth, _.fileHeight);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, 0);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, _.height * 1);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, _.height * 2);
    result.blt(bit, 0, 0, bit.width, bit.height, 0, _.height * 3);
    return result;
};

That returns the standard dead pose: single sprite, three frames. I couldn't use that with my 3x4 sprite sheet, so I rewrote that part by refererencing the constructor for the walk sprite (charConstructor).

That's just one, possibly irrelevant, thought I had for what might be posing a challenge w the dash sprite. I'm stuck at work now so I don't have access to my computer with my game stuff on it, unfortunately, but this evening I'll look at my code and let you know exactly how I set up the plugin command!

Edit: Out of work! Here's what I meant about needing to change the buildBitmap for the pose sheet:

Spoiler: buildBitmapPose
JavaScript:
Game_CharacterCreations.prototype.buildBitmapPose = function(id, info) {
    if($gameTemp.poseConstructor === undefined) {
        $gameTemp.poseConstructor = new Window_CharacterCreator_Preview(0, 0, _.fileWidth, _.fileHeight);
        $gameTemp.poseConstructor._sprite.x = 0;
        $gameTemp.poseConstructor._sprite.y = 0;
    }
    const data = info || this.getInfo(id, 'pose');
    if(!data) return null;
    $gameTemp.poseConstructor.setInfo(data);
    const bit = Bitmap.snapSprite($gameTemp.poseConstructor._sprite, _.fileWidth, _.fileHeight);
    return bit;
};

And here's how i set up the plugin command!

Spoiler: Game_Interpreter_pluginCommand
JavaScript:
_.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _.Game_Interpreter_pluginCommand.apply(this, arguments);
    if(command.trim().toLowerCase() === 'opencharactercreator') {
        $gameCharacterCreations._tempActorId = parseInt(args[0]);
        SceneManager.push(Scene_CharacterCreator);
    } else if(command.trim().toLowerCase() === 'setdeadcustomcharacter') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor._isDeadCustomCharacter = (args[1].trim().toLowerCase() === 'true');
        actor._neededCustomUpdate = true;
    } else if(command.trim().toLowerCase() === 'setposecustomcharacter') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor._isPoseCustomCharacter = (args[1].trim().toLowerCase() === 'true');
        actor._neededCustomUpdate = true;
    } else if(command.trim().toLowerCase() === 'disablecharactercreatorimages') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor["character-creator"] = true;
        actor._neededCustomUpdate = true;
    } else if(command.trim().toLowerCase() === 'enablecharactercreatorimages') {
        const actor = $gameActors.actor(parseInt(args[0]));
        actor["character-creator"] = false;
        actor._neededCustomUpdate = true;
    }
};

Lmk if this helps any!
weird.... I took your your plugin code and changed the setposecustomcharacter to setdashingcustomcharacter and still got the same message. I wonder if there's something else in my code thats causing the issue...
Is this the same issue as the Classifieds thread you opened and hired someone for? If so, which one do you want me to close?

Is this the same issue as the Classifieds thread you opened and hired someone for? If so, which one do you want me to close?

I posted originally here to see if I could get help. Afterwards I posted there to see if I could hire to fix. you can close the other one if only one is allowed.
We prefer not to have the same request posted in multiple places. Normally if you can't get it filled when asking for it here (for free) and want to offer payment, we'd just move it to Classifieds and get you to add your budget.

Having a thread in both places causes a conflict. You told me you hired someone who could get this done for you today. If they are now working on it, but you get a solution here instead, you are still under obligation to pay them as per your agreement. If they have since changed their mind, or you tell them to stop before they spend any time, that's okay, and we can just close that thread.
We prefer not to have the same request posted in multiple places. Normally if you can't get it filled when asking for it here (for free) and want to offer payment, we'd just move it to Classifieds and get you to add your budget.

Having a thread in both places causes a conflict. You told me you hired someone who could get this done for you today. If they are now working on it, but you get a solution here instead, you are still under obligation to pay them as per your agreement. If they have since changed their mind, or you tell them to stop before they spend any time, that's okay, and we can just close that thread.
They wanted to be paid upfront and have received payment. I'm currently waiting on their reply back. I still would like to get a better understanding of what I'm doing with this especially if their method or fix doesn't work. It's nice here because these two are both personally interesting in the plugin and want to make changes as well.
okay, I will close your thread in Classifieds and let the discussion continue here.

Original thread: https://forums.rpgmakerweb.com/threads/anyone-know-how-to-combine-them.140256/