- Joined
- Sep 27, 2012
- Messages
- 3
- Reaction score
- 0
- Primarily Uses
I am new to using VX Ace and am creating some events and enhancing them with script as needed. I have run into a situation where I want to dynamically set the speed and frequency of 4 events. I have 4 variables to hold the speed and 4 variables to hold the frequency of the 4 events. I choose random values for each variable and I want to set the speed and frequency of the 4 events at once.
Pseudocode would go like this:
speed1 = random number between 1 and 6
speed2 = random number between 1 and 6
speed3 = random number between 1 and 6
speed4 = random number between 1 and 6
freq1 = random number between 1 and 5
freq2 = random number between 1 and 5
freq3 = random number between 1 and 5
freq4 = random number between 1 and 5
event1.speed = speed1
event2.speed = speed2
event3.speed = speed3
event4.speed = speed4
event1.frequency = freq1
event2.frequency = freq2
event3.frequency = freq3
event4.frequency = freq4
I know I can reference the event via script like so:
$game_map.events[event_id]But, I want to do something like this:
$game_map.events[event_id].move_speed = $game_variables[1]$game_map.events[event_id].frequency = $game_variables[2]Does anyone know the properties to reference here?
Also, does anyone know of some good resources to help me understand the game engine. I am learning Ruby, but as far as the object model of the engine itself, is there any type of good object reference out there anywhere? I have found some snippets and have learned from those, but a broader scope would help me grasp the engine.
Thanks!
Pseudocode would go like this:
speed1 = random number between 1 and 6
speed2 = random number between 1 and 6
speed3 = random number between 1 and 6
speed4 = random number between 1 and 6
freq1 = random number between 1 and 5
freq2 = random number between 1 and 5
freq3 = random number between 1 and 5
freq4 = random number between 1 and 5
event1.speed = speed1
event2.speed = speed2
event3.speed = speed3
event4.speed = speed4
event1.frequency = freq1
event2.frequency = freq2
event3.frequency = freq3
event4.frequency = freq4
I know I can reference the event via script like so:
$game_map.events[event_id]But, I want to do something like this:
$game_map.events[event_id].move_speed = $game_variables[1]$game_map.events[event_id].frequency = $game_variables[2]Does anyone know the properties to reference here?
Also, does anyone know of some good resources to help me understand the game engine. I am learning Ruby, but as far as the object model of the engine itself, is there any type of good object reference out there anywhere? I have found some snippets and have learned from those, but a broader scope would help me grasp the engine.
Thanks!

