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.

I got a request

Coren

Member

In my game you play different characters in different chapters, but 1 character can travel to the area another character was to get a special item. For example hero 2 goes to the starting area of hero 1 and gets a bonus. Now, since I have 8 hero's I have a slight problem. Since I have 8 different characters I need to make 8 conditional branches for every simple event to change to \Name[\n[1]], \Name[\n[2]] etc.

So I wondered if I anyone could make a script which would check which character is active and change the X in \n 
 

Japa

Member

Have a variable that is set to your hero's number whenever you change.
then use that variable as a precondition on the event pages.

That's what I have in my game, which has 6 hero's to chose from at he beginning.
 

Coren

Member

I know I can do that, but with 8 hero's and the fact that virtually every thing in a house (Plants, lamps etc) are talkable too makes it quite a lot of work to put a precondition to every event. Although if noone can/will do this I guess there is no other way :-/
 
You can do that by storing the players name in a variable in a call script command like:
$game_variables[id] = $game_party.actors[0].name

Just change the id with the variable you want to use without the zero's at the begining, for example if you want to use variable 1 it should look like:

$game_variables[1] = $game_party.actors[0].name

Then in a message just use the \v[1] command to display the name.
 

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