Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Let me explain first what I am trying to do; I am making a vehicle move in one direction across a road in a custom move route using a pixel-movement script, and change the direction of the vehicle when it reaches the point, I actually DID make it work using this script call in the move route: 

set_direction(6) if @x == 11 && @y == 32

HOWEVER because it is pixel movement, it moves forward one time and checks the script, repeating over and over so it moves like choppy/laggy because it stops to check the script.
Is there any way I can do this? Maybe there's a script call that doesn't stop the event? Really need this, thanks in advance!
 
Last edited by a moderator:

HitYourGrandma

Ruler of all Evil and Procrastination
Veteran
Joined
Sep 28, 2015
Messages
64
Reaction score
20
First Language
English
Primarily Uses
N/A
This would probably work.

Capture.PNG



The 11 there is just the map x (or y) that you want the event to reach. The second page is set to 'Self Switch: A is ON' where whatever you want to happen happens after that point is reached.
 

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Oh yeah that seems pretty good, but being a parallel process would probably make it laggy, wouldn't it? There will probably be around 3-4 vehicles roaming around which is why I went with the move route way, also if I make it parallel process I can't think of a way to make the event "kill" the player when it touches him, forgot about that too.
 

HitYourGrandma

Ruler of all Evil and Procrastination
Veteran
Joined
Sep 28, 2015
Messages
64
Reaction score
20
First Language
English
Primarily Uses
N/A
You could just have the move route of the vehicle go until it reaches the desired x and/or y. Set the priority as 'same as characters' and the trigger 'player touch', where the event page is the desired effect, such as a game over.
 
Last edited by a moderator:

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
And how do I do that exactly?  Move forward if X =! 11 and Y =! 20? I mean how do I write that in the script? I'm not good at all at scripting
 
Last edited by a moderator:

HitYourGrandma

Ruler of all Evil and Procrastination
Veteran
Joined
Sep 28, 2015
Messages
64
Reaction score
20
First Language
English
Primarily Uses
N/A

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Yeah I know how to do that, but I want it to repeat move right until it reaches and X/Y (for example) like you did before (think like a conditional branch within the move route with a Script)
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
220
First Language
English
Primarily Uses
RMVXA
You didn't show us your original event or link the script you're using so there may be a lot of important details I'm missing here.


Anyway, try something like this within the event's Autonomous Movement.


Locate Script..., the last item on the last column, insert this into the box, and change/remove the coordinates as needed.


case [x, y] when [1,1] ; move_straight(6) when [14, 1] ; move_straight(2) when [14, 11] ; move_straight(4) when [1, 11] ; move_straight(8) else move_forward end


By default, the event should move in a square so long as you place it correctly.
 
Last edited by a moderator:

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
THANK YOU Rinobi! That was it, works like a charm!! I really appreciate and will for sure credit you when I finish this.
Thanks to both of you.

One last thing though, what do I type in to activate a switch when it reaches a certain X/Y too? when [14,1] ; $game_switches(40) ? Something like that. (Or a self-switch for that matter)

(For example, a car reaches a stop sign and activates a switch, while on this switch you can interact with the car, I have something that accomplishes this task but sometimes events get on the way and it stops before it should)
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
220
First Language
English
Primarily Uses
RMVXA
You're close. The syntax for turning that global switch on would be:


when [14, 1] ; $game_switches[40] = true




As for self switches, it depends on if you're setting the switch within the event page, within the move route, or somewhere else.

Code:
$game_self_switches[[@map_id, @event_id, "A"]] = true # Turn self switch A on within an event's pages.

$game_self_switches[[$game_map.map_id, id, "A"]] = true # Turn self switch A on within an event's move route

$game_self_switches[[4, 8, "A"]] = true # Turn self switch A on for event 8 on map 4
 
Last edited by a moderator:

Cocosetton

Villager
Member
Joined
Jul 1, 2016
Messages
11
Reaction score
3
First Language
Spanish
Primarily Uses
Thank you so much. This can be closed now.
 

Latest Threads

Latest Profile Posts

edit: third time's the charm? some graphic text I whipped up that I like for the mid-game intertitle, now with all of the actual letters in the stupid damn words I was trying to spell :uswt2:
kcsmall.png
It is december, my dudes

badge_xmas.png
I love it when a plan comes together, and especially when Ruby decides to work with me when I decide to code. :kaopride:
Got sick and had to take a few days off work in order to get tested and make sure it wasn't the big one. Felt a lot better today and thought to myself, "Hey now, I can't get tested until tomorrow anyway, I can get so much character art done today!"
....I watched Youtube and browsed this site for hours instead.
>.>
But at least I'm doing the art now! Yaaaaay.......

Forum statistics

Threads
117,095
Messages
1,104,533
Members
153,103
Latest member
nicolas974
Top