Emily Frost

Villager
Member
Joined
May 15, 2013
Messages
8
Reaction score
1
First Language
English
Primarily Uses
How would I set up a check using the 'direction fix' tick box of an event as a conditional?

The check would be performed when you press the action button to interact with the event, so ideally it would be a 'this event' type of self check.

And, on the same topic, can things like the speed and frequency of an event be used as conditionals?

Thanks in advance.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,604
Reaction score
3,866
First Language
Java's Crypt
Primarily Uses
RMMZ
You want to make a conditional branch test if the "Direction fix" option is checked?

I guess putting this script in a conditional branch would work:

$game_map.interpreter.get_character(0).direction_fixAs for the speed and frequency, you can use them in a conditional branch with this script:

$game_map.interpreter.get_character(0).move_speed == 3
Code:
$game_map.interpreter.get_character(0).move_frequency == 3
 

Just change the number 3 by the speed / frequency you want to compare it to 
 
Last edited by a moderator:

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,347
First Language
No idea...
Primarily Uses
RMMV
You can use this script call in your conditional branch :

For checking direction fix:

$game_player.direction_fix == true

(to check player)

$game_map.events[x].direction_fix == true

(to check a map event, where x is the event's ID.)
For checking movement speed:

$game_player.move_speed == 3

$game_map.events[x].move_speed == 3

(adjust the movement speed accordingly)
For checking movement frequency:

$game_player.move_frequency == 3

$game_map.events[x].move_frequency == 3

(adjust the movement frequency accordingly)
You can get the map event's ID by looking at the upper right side of the event's window.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
EDIT: hmmm oh wait...
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV
If you want to check if the current event (the one that's running the code) has direction fix on, you'd do this:

Code:
$game_map.events[@event_id].direction_fix
You could also copy and paste that to other events - it basically says "do I have direction fix on?" so each event will refer to its own setting.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
Though I'm wondering why... If it's on the same event, then you should already know the answer since you'd be the one modifying it anyways... unless there is a parallel process running which modifies it randomly...
 

Emily Frost

Villager
Member
Joined
May 15, 2013
Messages
8
Reaction score
1
First Language
English
Primarily Uses
Thank you both. This worked flawlessly.

Hudell's method is exactly what I was looking for in this particular instance, but the method Susan provided will certainly be useful to me down the line when I attempt to do something more complex.

Though I'm wondering why... If it's on the same event, then you should already know the answer since you'd be the one modifying it anyways... unless there is a parallel process running which modifies it randomly...
I have a common event that tells me what direction an event is facing in relation to the player position (used for sneaking up behind an enemy) but I now have a common event that checks if the enemy was direction fixed, if so unfixes the direction and faces the player, then refixes the direction lock. So the player can be caught if he fails his stealth check and now the enemy is alerted and locked facing the correct direction.
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

Hello, my nickname is Rigomor, but I am also known as Mopsikus. I work on RPG Maker games, and are currently working on a game called Peony of War.
If the world treats you like an enemy... Then the world must be your enemy...
What started as 1 RPG in development on the Nintendo DS, turned into 4 RPGs in development (1 on VX and 3 on VX Ace). Wish me luck.
Last monday Hawkzombie played ATV.

Here are the videos:


Yes, I'm alive. No the semester didn't kill me. Though there are days I feel like I am dead.

Forum statistics

Threads
117,290
Messages
1,106,188
Members
153,479
Latest member
tc633
Top