How to jump and event help..

● ARCHIVED · READ-ONLY
Started by wandering-warrior 7 posts View original ↗
  1. Hi guys..... so i finally got my swimming sprite for my character...so i am using this common event to change actor's graphic.....

    Spoiler
    CHANGE ACTOR GRAPHIC DEPENDING ON LOCATIONThis event is just as simple as the previous one. What it does is change the actor's graphic depending on their location - so if they are swimming it will automatically change to a swimming graphic, and back to a walking graphic if they go on land.

    The first step is to create a common event named Swimming (or whatever you want) with a Trigger: Parallel Process and a Condition Switch: Swimming. You will need to set three variables: one for the player's X value, one for the player's Y value, and the last to hold the location info value (you can reuse the ones in the previous code if you're using them both). The code inside the event should be as follows:

    Control Variables: [0001:X] = Players Map X

    Control Variables: [0002:Y] = Players Map Y

    Get Location Info: [0003], Terrain Tag, Variable [0001][0002]

    Conditional Branch: Variable [0003:Location Info] == 1

    Change Actor Graphic: [Eric], 'swimming eric', 0, 'Actor4', 0

    Else

    Change Actor Graphic: [Eric], 'Actor4', 0, 'Actor4', 0

    Branch End

    And that's the entire code! Now you have two more steps, but they are relatively easy. The first is to go to tileset -> terrain tag and denote whatever tiles you want to change the graphic while on. I used the coast tiles in the A tab. The second step is for you to change the passage setting for those tiles so the player can freely enter and exit them. And that's it! You can use the darker ocean tiles as a border to keep the player from swimming too far into the water, and If you want to keep the player from swimming entirely, simply flip the Condition Switch: Swimming off.
    So... i wanted to trigger an event as soon as the player reaches the water saying... " do u want to swim " or something like that and then the player jumps and then the graphic changes... so i can use Victor sant's jumping script but how do i use it with this common event
  2. After "Conditional Branch: Variable [0003:Location Info] == 1", enter a show text "Do you want to swim?" followed by show selection Yes/No.

    Inside the Yes answer, you set the conditional branch "Change Actor Graphic: [Eric], 'swimming eric', 0, 'Actor4', 0" and turn on self-switch to avoid having the question pop up every step/frame. On the second page, you again start the same as on the first but the conditional branch altered to "Conditional Branch: Variable [0003:Location Info] != 1" (!= sets the condition of "is not") and follow up with the "Change Actor Graphic: [Eric], 'Actor4', 0, 'Actor4', 0" if the condition is met and end the branch with self-switch off, which will bring it back to page one.

    Only weakpoint in my answer that I can see, I have no iea how to prevent you from walking into the water when you choose not to swimm. Maybe it would be better to just let the player swim automatically as the original intents.
  3. Ok i got that but there is one more problem the player graphic changes before going into the water.. what's happening???

    here is a screenshot

    swim.png
  4. gamers694 said:
    Ok i got that but there is one more problem the player graphic changes before going into the water.. what's happening???

    here is a screenshot

    View attachment 791
    Have the character jump into the water, wait for completion, THEN change the graphic! That should work then :3
  5. I'll try what u said but i think its because im using pixel movement script of victor sant...... whaddya think??
  6. gamers694 said:
    I'll try what i said but u i think its because im using pixel movement script of victor sant...... whaddya think??
    Maaybe....I thought that the jump command did it in tiles, maybe victor script changes that though 3:
  7. OK forget about the stupid text... its not working......i just want to jump before going into water... but i can't because im using terrain tags so it starts jumping before going into water and then never stops :(

    EDIT:- if i don't want to jump through events but through victor sant's script, how do i limit myself that every time i reach the edge i have to press jump button before going into water??