Hyperly

i like rocks
Veteran
Joined
Jun 25, 2016
Messages
72
Reaction score
11
First Language
English
Primarily Uses
RMXP
VXAce uses this and it seems to work for them " wait($game_variables[1]) "
whatabout for XP? I get a syntax error everytime I do that.
Also how would I be able to open the console if there is one for XP?
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
374
Reaction score
146
First Language
English
Primarily Uses
RMXP
In XP, the wait command is handled this way:
Code:
  #--------------------------------------------------------------------------
  # * Wait
  #--------------------------------------------------------------------------
  def command_106
    # Set wait count
    @wait_count = @parameters[0] * 2
    # Continue
    return true
  end
So using the script call
Code:
@wait_count = YOUR_NUMBER_HERE
will be the VXA equivalent.

XP doesn't have a native console either. I use this script for that:
 

Hyperly

i like rocks
Veteran
Joined
Jun 25, 2016
Messages
72
Reaction score
11
First Language
English
Primarily Uses
RMXP
You have managed to save my life and mainly time in both threads, at first I thought wait_count was something completely different so I ignored it this looks so much easier than the other solutions I've seen thank you. Now I can make a light path that randomly lights up and also darkens as you step on it.
EDIT:
Oops one last thing I really should've mentioned or asked. Is there a way to control variables inside of a Move Route? If not I might have an alternative, just wondering.
 
Last edited:

Hyperly

i like rocks
Veteran
Joined
Jun 25, 2016
Messages
72
Reaction score
11
First Language
English
Primarily Uses
RMXP
Move routes have the option to use scripts in them, however the script does nothing when inside the move route, but when I put it outside it works perfectly. Do move routes handle scripts differently?
New EDIT:
The print statement runs like right as the game starts, instead of waiting a few frames. But if I did this outside of the Autonomous move route it works fine. Only problem is I need to do this inside of a Move Route because i'm relying on a Player Touch event and it won't automatically animate. For reasons related to a different thread I can't use Parallel Process on this event.
Ruby:
@wait_count = 20*2
print("Finished waiting")
EDIT2:
I actually had it as _count not _time sorry
 
Last edited:

Hyperly

i like rocks
Veteran
Joined
Jun 25, 2016
Messages
72
Reaction score
11
First Language
English
Primarily Uses
RMXP
I guess @wait_count is completely ignored inside RMXP Move Routes so I decided to do this
but it doesn't look how I hoped it would, so I'll just stick with what I can. For those coming from the other thread I've been trying to make the light tiles (they aren't actually tiles) light up randomly in the room and slowly flicker.
Ruby:
@move_frequency = rand(5) + 1
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
374
Reaction score
146
First Language
English
Primarily Uses
RMXP
Is there a way to control variables inside of a Move Route?
Code:
$game_variables[ID] = whatever_you_want
Obviously replacing the ID accordingly.
Move routes have the option to use scripts in them, however the script does nothing when inside the move route, but when I put it outside it works perfectly. Do move routes handle scripts differently?
Move route commands are handled in the Game_Character class (see Game_Character 2 script). Here's how the wait command in a move route works:
Code:
      # If waiting
      if command.code == 15
        # Set wait count
        @wait_count = command.parameters[0] * 2 - 1
        @move_route_index += 1
        return
      end
Game_Character does use @wait_count, but it also calls 'return' afterwards. Meanwhile a script call doesn't.
Code:
        when 45  # Script
          result = eval(command.parameters[0])
        end
        @move_route_index += 1
What you could do is edit the above to this
Code:
        when 45  # Script
          result = eval(command.parameters[0])
          if result == :return
            @move_route_index += 1
            return
          end
        end
        @move_route_index += 1
And add this snippet to your scripts list:
Code:
class Game_Character
  def wait(frames)
    @wait_count = frames
    :return
  end
end
Now you can do the following script call in the move route:
Code:
wait($game_variables[ID])
 

Hyperly

i like rocks
Veteran
Joined
Jun 25, 2016
Messages
72
Reaction score
11
First Language
English
Primarily Uses
RMXP
This overall solved everything and actually helped even more than I thought it could, you even showed me how to make a little script snippet that uses an already existing class which is something I probably would've asked about in the future. Thanks a lot.

wy0Jppt.gif
 

Latest Threads

Latest Posts

Latest Profile Posts

 …I think I might need to switch from standard ATK/DEF up/down buffs to parameter altering states. I just had an actor whose usual attack against an enemy does ~25 do a buffed attack against a debuffed enemy for ~600…
just saw that titan quest is free on steam until the 23rd
Zombie status is now complete. I didn't have to do much in the way of changing how healing is applied to undead targets, was just a simple 3 line code. I thought I had to overhaul Game_Action lol. Everything else was doable by events. So.. Zombie: You turn undead. Your element changes to darkness. You're weak to light, you're strong to physical attacks and healing hurts you and revival items will kill you.
My Overworld might be a mix of inspiration from 2D Final Fantasy games, Breath of Fire, Battlechasers: Nightwar, Super Mario World, and Pillars of Eternity. If I can make it more in-depth than just walking from point A to point B, that might do a lot for the gameplay experience. Hmm...

Forum statistics

Threads
115,225
Messages
1,088,210
Members
149,815
Latest member
MaeBski
Top