Posts: 44
Threads: 10
Joined: Dec 2012
12-24-2013, 01:38 AM
Maybe it sound weird, but I would like to request a script which changes the type of movement of the character when stepping on it, let me explain:
Suppose you have some stairs, they are drown diagonally and everytime the character steps on them he/she has to move accordingly, in other words, diagonally. What I want is to define a type of terrain in which whenever the character wants to move left, he will move up-left diagonally instead, whenever he wants to move right, he will move down-right and another one with exactly the opposite (left-down, right-up), this way, whenever the stairs tile is determined, he will automatically move according to the stairs.
Hope I made myself clear :O Thanks before hand!
I'm looking for a scripter to help me with my proyect. Need some minor adjustments-modifications and some larger codes. The larger ones will be remunerated :) Thanks beforehand.
Posts: 11,228
Threads: 648
Joined: May 2009
Would you believe you can do that with events???
Here's a basic event code that can make a character move down-left or up-right: (and you set the trigger to 'player touch')
Code:
@>Button Input Processing: [0025]
@>Conditional Branch: Variable [0025] == 2
@>Set Move Route: Player
: :$>Move Lower Left
@>
: Else
@>Conditional Branch: Variable [0025] == 4
@>Set Move Route: Player
: :$>Move Lower Left
@>
: Else
@>Conditional Branch: Variable [0025] == 6
@>Set Move Route: Player
: :$>Move Upper Right
@>
: Else
@>Conditional Branch: Variable [0025] == 4
@>Set Move Route: Player
: :$>Move Lower Left
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
You'd have an event with this code on every navigatable step in your steps. Some concessions will be needed if you want to let the player move straight up from the top of the steps, down from the bottom most steps, or left/right from either or. But this should help without the need of a script.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 422
Threads: 23
Joined: Aug 2011
Here is how to do it by terrain tags, if you don't feel like placing all those events.
Parallel event that is enabled by a switch. In order to make it run all the time you have to turn the switch on at the start of your game and leave it on.
EDIT: Oh whoops, mine moves them forcibly and not when they press a key. if you replace my "Set Move Route"s with VVulf's event code, it should work.
Posts: 44
Threads: 10
Joined: Dec 2012
Huh, didn't think of that, however, there is an inconvenient. I suppose that the event recognizes an Input.press? instead of Input.trigger? (or the other way around I don't remember which one's which right now xd) so when the character arrives at the tile it stops the movement, and then, when you press the direction again, it moves.
I'm looking for a scripter to help me with my proyect. Need some minor adjustments-modifications and some larger codes. The larger ones will be remunerated :) Thanks beforehand.
Posts: 422
Threads: 23
Joined: Aug 2011
You could use a script condition to check for an Input.dir4 == 2 or similar?
Posts: 44
Threads: 10
Joined: Dec 2012
Not sure how to do it, as I said, I'm not very good at scripting :/
I'm looking for a scripter to help me with my proyect. Need some minor adjustments-modifications and some larger codes. The larger ones will be remunerated :) Thanks beforehand.
Posts: 11,228
Threads: 648
Joined: May 2009
When you go into 'Conditional Branch' in the events editor, look at the list of stuff in the 4th tab. The last item on the list is 'Script'. There, you can script a condition, such as "
Input.dir4 == 2" You don't need an
if in this case.
So, it will look like:
Code:
@>Conditional Branch: Script: Input.dir4 == 2
@>Set Move Route: Player
: :$>Move Lower Left
@>
: Else
@>Conditional Branch: Script: Input.dir4 == 4
@>Set Move Route: Player
: :$>Move Lower Left
You wouldn't need the first 'Button Input Processing' command then.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 44
Threads: 10
Joined: Dec 2012
Well I didn't know that :O It works now, however, I have to set the trigger event to 'Collision' instead of 'Player Touch', because with 'Player Touch', when the character stops in the event tile and then tries to move, it moves left or right instead of diagonally. Thanks for the help guys :D And merry christmas!
I'm looking for a scripter to help me with my proyect. Need some minor adjustments-modifications and some larger codes. The larger ones will be remunerated :) Thanks beforehand.