Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[resolved] Help with using Interpeter commands

I can't seem to get an interpeter command to work. How does one call them? Can you do it from the script window from an event or do you need to write an entire script? I specificlly need to be able to change the graphics of an event using only RGSS. I found some bits of code

move_route = RPG::MoveRoute.new
move_route.list.push (RPG::MoveCommand.new (1, [1]))
$game_player.force_move_route (move_route)

It looked promising but I didn't know enough to make this work. Thanks in advance to anyone who takes the time to help.
 

Zeriab

Sponsor

If you want to change the graphics of an event in RGSS then you shouldn't try to give the event a new move route. That would be very tedious and also dangerous in that you would remove any existing move route.

Instead I would suggest changing the character name directly. You can by default not change the character name directly from outside the events. This little snippet will help on that problem: (Paste anywhere above main and below Game_Character in its own section)
[rgss]class Game_Event < Game_Character
  attr_writer :character_name
end
[/rgss]

Here is an example of a script call where I change the graphic of event 2: (Nothing happens if there is no event with ID 2 in the map.)
[rgss]e = $game_map.events[2]
unless e.nil?
  e.character_name = "019-Thief04"
end
[/rgss]

*hugs*
- Zeriab
 
Thank you Zeriab! This is exactly what I need for a script that randomly populates maps. Is there a way to change the graphics using the name of the event instead of the number of the event?
 
Thank you Zeriab! This is exactly what I need for a script that randomly populates maps. Is there a way to change the graphics using the name of the event instead of the number of the event?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top