Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

"Support for multiple playable characters; just set up data and change the current character variable"

How, please? which object/script contains these? I would like to switch between two players at the start of a level, with the exact same data, just different sprites

Thanks so much in advance and great job creating all these fine assets. Keep up the good work :)


(1 edit)

Scripts-->Initialization-->init_characters, it's a tabbed script with init_character_maria as the only alternate tab at the moment. At the bottom you'll see the lines of code that initializes sprites. To fully add a new character, I guess what you should do is...

  • Make a new constant for the character's ID (must have a different value from char_MARIA)... you could use the existing constants char_LOUISE, char_PRINCE, char_FROG and char_SUNSHINE if you'd like to, of course.
  • Make a copy of init_character_maria (create a new tab and copypaste init_character_maria's code text into it) and use the search-replace feature to replace "char_MARIA" with the new character constant
  • Change the sprite assignments to the new character's sprites (they're at the bottom of the script).
  • Don't forget to call the script from init_characters, just how it calls init_character_maria.
  • To change the active character, just assign the character ID to the variable global.playerchar based on what the player selects - it's always assigned char_MARIA by default since the demo only has 1 character. You can make the menu any way you want~

I think that's all you need to do, hopefully I didn't forget anything :) Just hit me up with more comments if there's any problems~

(+1)

Thanks so much for the swift and indepth reply. Awesome! Will try all of it soon, thanks again!