Click here to join us on IRC (#charas on irc.freenode.net)!
@>conditional branch: down button is being pressed, Self Switch: a = on (make self switch "a" on when down button is pressed.)branch end@>conditional branch: right button is being pressed, Self Switch: a= on (make self switch "a" on)branch end@>conditional branch: left button is being pressed, Self Switch: a = on (make self switch "a" on)branch end@>conditional branch: up button is being pressed, Self Switch: a = on (make self switch "a" on)branch end
@>conditional branch: self switch a is on set move route [this event] (set move route of this event towards player) > move towards playerBranch end
@>conditional branch: player is facing down @>conditional branch: [caterpilar 1] is facing up @>set move route: [caterpilar1] (if the player is facing down and the guy behind you is facing up, > trough ON or basicly: if the player faces the guy, allow the player the move trough the guy)@> else (if they do not face each others.) > set move route [caterpilar1] trough off (now he might now longer move trough the player.) branch endbranch end.@>conditional branch: player is facing right @>conditional branch: [caterpilar 1] is facing left @>set move route: [caterpilar1] > trough ON branch endbranch end@>conditional branch: player is facing left @>conditional branch: [caterpilar 1] is facing right @>set move route: [caterpilar1] > trough ON@> else (if they do not face each others.) > set move route [caterpilar1] trough off (now he might now longer move trough the player.) branch endbranch end@>conditional branch: player is facing up @>conditional branch: [caterpilar 1] is facing down @>set move route: [caterpilar1] > trough ON@> else (if they do not face each others.) > set move route [caterpilar1] trough off (now he might now longer move trough the player.) branch endbranch end.
Ok, to start off with, you will need one more hero so do that in your database now. Next you need to make 2 maps but DO NOT add any events yet. You will also need 4 variables listed here.V1-HeroXV2-HeroYV3-Hero2XV4-Hero2YYou also need two eventsEv1-Set Hero2Ev2-Hero2Now, set each one to a parallel process and check "If hero whoever(hero2 in this case) is in the party". Now this firstevent sets the hero to your position. Also if hero2 is in the party on the first event only works if hero 2 is in the party. Now for the code. First go to variable operations and set HeroX to Sprite Hero X Coordinate. Now set HeroY to Sprite Hero Y Coordinate. Now after that have a move event for your Hero2 event that has phasing mode on. Now have a change Event location hero2 to the location referenced in variables HeroX and HeroY. Now have erase event.So what does this do? Simple. The Set Hero X/Y coordinates to the variables tracks the hero. The phasing mode acts as so the Hero2 can be on your hero and not freeze. The change event role is key in this because you have to change the event location to hero and you do not want it to freeze. The change event location just sets Hero2 to your location.The erase event, well erases the event. Why not a switch? Because with an erase event the event automatically brings the event back when you leave so basically it is reset.Now here is what the code should look like.<>Variable Oper:[Huh??:HeroX] Set, Hero X Coord.<>Variable Oper:[Huh??:HeroY] Set, Hero Y Coord.<>Move Event: Hero2, Phasing Mode ON<>Change Event Location: Hero2,(V[Huh??],V[Huh??])<>Erase EventThis is what the code should look like. Now, the Huh?? represents the variable value of whatever number you used.Now on to the second event which is your hero2. The box if hero2 is in the party should be checked. Also parallel process and same layer as hero. Also MAKE SURE that the move frequency is Normal. This is so when he follows the hero, that he can keep up with him. Now for the event part.You first need to set the coordinates again. HeroX equals Hero X Coordinate and HeroY equals Hero Y Coordinate. Now do the same with Hero2. Hero2X Set Hero2 X Coordinate and Hero2Y set Hero2 Y coordinate. Now you need to set it so the event knows where to walk and how to follow the hero. This part is important so listen well. Oh and first I tell what it does, THEN I explain. Now click on a fork conditon that states if HeroX is greater than Hero2X. No else case for any of these forks BTW. Now INSIDE the fork have a move event for Hero2 that has Phasing Mode OFF then Move Right.Now lets have another fork for if HeroX is less than Hero2X.In the fork have a Phasing Mode OFF and move left. Now for the up and down forks. Have a fork now that states if HeroY is greater than Hero2Y,inside the fork have phasing mode OFF and move down for Hero2 again. Now, the last fork, have one that says if HeroY is less than Hero2Y then Hero2 moves Phasing mode OFF and Up. That is the end!! Now for an explanation......First the Setting the variables(X and Y coordinate variables) to the Hero and Hero2 simply tracks them. Now for the forks. The If Hero X is greater, which means he is too the right of Hero2, then Hero2 moves right.Now the opposite applies for the others, if HeroX is LESS than Hero2X which means that he is too the left then Hero2 moves left. Now the HeroY is greater means he is below hero2so Hero2 moves down. Finally if HeroY is less than Hero2Y then he is above and Hero2 moves up. Oh, and the phasing mode turned OFF means so you can not walk over him anymore.Now for the actual code<>Variable Oper: [Huh??:HeroX] Set, Hero X Coord.<>Variable Oper: [Huh??:HeroY] Set, Hero Y Coord.<>Variable Oper: [Huh??:Hero2X] Set, Hero2 X Coord.<>Variable Oper: [Huh??:Hero2Y] Set, Hero2 Y Coord.<>Branch if Var [Huh??:HeroX] is V[Huh??] Greater<>Move Event: Hero2, Phasing Mode OFF, Move Right<>:End<>Branch if Var [Huh??:HeroX] is V[Huh??] Less<>Move Event: Hero2, Phasing Mode OFF, Move Left<>:End<>Branch if Var [Huh??:HeroY] is V[Huh??] Greater<>Move Event: Hero2, Phasing Mode OFF, Move Down<>:End<>Branch if Var [Huh??:HeroY] is V[Huh??] Less<>Move Event: Hero2, Phasing Mode OFF, Move Up<>:EndNow you are "ALMOST" done!! So, now you got your two events.Let me say this clearly "THESE EVENTS SHOULD BE THE FIRST EVENTS WHERE YOUR CATERPILLAR SYSTEM IS AT" If not then the events will be messed up. NOW, after the first map, the Hero2 Event should be FIRST, followed by the Set Hero2 event. Now that is all for the events
Is there a way to not have the character(s) following you block your movement? Especially in one tile areas ? They tend to trap the hero from moving . Is there a way to walk over or though the character's following the hero ?