Help with character movements

Nakmeath

Villager
Member
Joined
Sep 11, 2013
Messages
17
Reaction score
2
First Language
English
Primarily Uses
Okay, I need help understand how to move the characters I want, as I've tried searching and looking and there's no clear definition on how the various commands should work.


However, what I"m currently having trouble getting to work is below.


//Inn keeper moving.
$gameMap.events()[0].forceMoveRoute({list:[{
code: 1, indent: null, parameters:[]},
{code: 1, indent: null, parameters:[]},
{code: 17, indent: null, parameters:[]},
{code: 0, indent: null, parameters:[]}],
repeat:false, skippable:false, wait:true});
//door moving.
$gameMap.events()[1].forceMoveRoute({list:[{
code: 44, indent: null, parameters:['Door1']},
{code: 42, indent: null, parameters:[0]},
{code: 0, indent: null, parameters:[]} ],
repeat:false, skippable:false, wait:true });
//Inn keeper moving again.
$gameMap.events()[0].foreMoveRoute({list:[{
code: 37, indent: null, parameters:[]},
{code: 4, indent: null, parameters:[]},
{code: 4, indent: null, parameters:[]},
{code: 38, indent: null, parameters:[]},
{code: 0, indent: null, parameters:[]}],
repeat:false, skippable:false, wait:true });


Basically I'm trying to have the 'Inn Keeper' move down twice, then turn left. Then have the door play the door1 se and turn it's opacity to 0. Then have Through turned on for the inn keeper event and have him walk to the left two times currently.


I have my reasons for needing to do it by scripting. So please... any help in understanding how to do this will be appreciated. I have searched for days and hours on how to do this right, using google to find my answers and all I have found was just the beginning steps that does not give much clarification. 
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,440
First Language
French
Primarily Uses
RMMV
Okay, I need help understand how to move the characters I want, as I've tried searching and looking and there's no clear definition on how the various ...........
i found this.


I dont know if this can help you.


line 6220


rpg_objects.js

Code:
Game_Character.prototype.processMoveCommand = function(command) {
    var gc = Game_Character;
    var params = command.parameters;
    switch (command.code) {
    case gc.ROUTE_END:
        this.processRouteEnd();
        break;
    case gc.ROUTE_MOVE_DOWN:
        this.moveStraight(2);
        break;
    case gc.ROUTE_MOVE_LEFT:
        this.moveStraight(4);
        break;
    case gc.ROUTE_MOVE_RIGHT:
        this.moveStraight(6);
        break;
    case gc.ROUTE_MOVE_UP:
        this.moveStraight(8);
        break;
    case gc.ROUTE_MOVE_LOWER_L:
        this.moveDiagonally(4, 2);
        break;
    case gc.ROUTE_MOVE_LOWER_R:
        this.moveDiagonally(6, 2);
        break;
    case gc.ROUTE_MOVE_UPPER_L:
        this.moveDiagonally(4, 8);
        break;
    case gc.ROUTE_MOVE_UPPER_R:
        this.moveDiagonally(6, 8);
        break;
    case gc.ROUTE_MOVE_RANDOM:
        this.moveRandom();
        break;
    case gc.ROUTE_MOVE_TOWARD:
        this.moveTowardPlayer();
        break;
    case gc.ROUTE_MOVE_AWAY:
        this.moveAwayFromPlayer();
        break;
    case gc.ROUTE_MOVE_FORWARD:
        this.moveForward();
        break;
    case gc.ROUTE_MOVE_BACKWARD:
        this.moveBackward();
        break;
    case gc.ROUTE_JUMP:
        this.jump(params[0], params[1]);
        break;
    case gc.ROUTE_WAIT:
        this._waitCount = params[0] - 1;
        break;
    case gc.ROUTE_TURN_DOWN:
        this.setDirection(2);
        break;
    case gc.ROUTE_TURN_LEFT:
        this.setDirection(4);
        break;
    case gc.ROUTE_TURN_RIGHT:
        this.setDirection(6);
        break;
    case gc.ROUTE_TURN_UP:
        this.setDirection(8);
        break;
    case gc.ROUTE_TURN_90D_R:
        this.turnRight90();
        break;
    case gc.ROUTE_TURN_90D_L:
        this.turnLeft90();
        break;
    case gc.ROUTE_TURN_180D:
        this.turn180();
        break;
    case gc.ROUTE_TURN_90D_R_L:
        this.turnRightOrLeft90();
        break;
    case gc.ROUTE_TURN_RANDOM:
        this.turnRandom();
        break;
    case gc.ROUTE_TURN_TOWARD:
        this.turnTowardPlayer();
        break;
    case gc.ROUTE_TURN_AWAY:
        this.turnAwayFromPlayer();
        break;
    case gc.ROUTE_SWITCH_ON:
        $gameSwitches.setValue(params[0], true);
        break;
    case gc.ROUTE_SWITCH_OFF:
        $gameSwitches.setValue(params[0], false);
        break;
    case gc.ROUTE_CHANGE_SPEED:
        this.setMoveSpeed(params[0]);
        break;
    case gc.ROUTE_CHANGE_FREQ:
        this.setMoveFrequency(params[0]);
        break;
    case gc.ROUTE_WALK_ANIME_ON:
        this.setWalkAnime(true);
        break;
    case gc.ROUTE_WALK_ANIME_OFF:
        this.setWalkAnime(false);
        break;
    case gc.ROUTE_STEP_ANIME_ON:
        this.setStepAnime(true);
        break;
    case gc.ROUTE_STEP_ANIME_OFF:
        this.setStepAnime(false);
        break;
    case gc.ROUTE_DIR_FIX_ON:
        this.setDirectionFix(true);
        break;
    case gc.ROUTE_DIR_FIX_OFF:
        this.setDirectionFix(false);
        break;
    case gc.ROUTE_THROUGH_ON:
        this.setThrough(true);
        break;
    case gc.ROUTE_THROUGH_OFF:
        this.setThrough(false);
        break;
    case gc.ROUTE_TRANSPARENT_ON:
        this.setTransparent(true);
        break;
    case gc.ROUTE_TRANSPARENT_OFF:
        this.setTransparent(false);
        break;
    case gc.ROUTE_CHANGE_IMAGE:
        this.setImage(params[0], params[1]);
        break;
    case gc.ROUTE_CHANGE_OPACITY:
        this.setOpacity(params[0]);
        break;
    case gc.ROUTE_CHANGE_BLEND_MODE:
        this.setBlendMode(params[0]);
        break;
    case gc.ROUTE_PLAY_SE:
        AudioManager.playSe(params[0]);
        break;
    case gc.ROUTE_SCRIPT:
        eval(params[0]);
        break;
    }
};
 
Last edited by a moderator:

Nakmeath

Villager
Member
Joined
Sep 11, 2013
Messages
17
Reaction score
2
First Language
English
Primarily Uses
I was already referring to that, but for some reason the first event won't move still. To clarify, which I forgot to add this, the Inn Keeper event Id is 01 and the door event id is 02. I've tried putting those numbers in before and instead, the door moved towards the right, as I used the '2' in 'code: '. So I had to rethink back to my old computer science classes with arrays starting at '0' and at first the first line did work... but then I realized I had some things wrong with the coding... and I'm now right back at square one.  NOw the movement at first was just with the inn keeper without the 'code: 17' line being placed within. So I'm wondering if the value 17 is not really for turning left... but I do not know, as I counted from the top (end route line starting at 0) all the way down to the code that I needed. 


Edit:


Nvm, after some thinking about it, I actually solved the issue of the Inn Keeper not moving. Turns out I had to add at the start of the movement code:


{code: 15, indent: null, parameters:[]},


Which basically makes him turn down. Why this is actually needed before he moves I don't understand. Now that i've cleared that hurdle, I've also noticed something else when scripting the movements. You also have to set the stepping as well as movement speed it seems. Thank you @JonForum for trying to help me. Now to tackle the rest of the movement... and hopefully with no errors, which there might be. 


Edit 2: Now the sound for the door will not play. So... back to the drawing board for it.


Edit 3: Sorry for being stupid... but I did manage to figure it out looking something else up and changed the sound code to:


{code: 44, indent: null, parameters:[{name:'Door1',volume:100,pitch:100,pan:0,pos:0}]},


I'm sharing this cause... well I was an idiot over this and I'm sure there are some like me. X_X


Now... I want to get some ice for my head hurting so much. Anyways, thanks again for the help @Jonforum
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top