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

Another comic with Backstage Malak...
If you want to ask him anything, you can ask on my DeviantArt page! I'm not sure if you're allowed to do it here.
Forum tip of the day ...
If you get a temporary suspension for being a jerk to people who are trying to help you, and arguing with mods and admins, don't go making new accounts. Chances are, if you p**s us off enough to suspend you for a week, we're not going to hesitate giving you a permanent ban when you give us a reason.
E_6fAErVkAQILXu.png
I'm so close to releasing my game on steam! :blush::blush::blush:
Us:
"This game is awesome! I wish there are more games like this in the future."
Also us:
"I hate how games stopped being original and start copying other successful games."
Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the Modern British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.

Forum statistics

Threads
115,287
Messages
1,088,661
Members
149,915
Latest member
kunoleo
Top