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.

Character Sprite selection script.

I am trying to create a script where, when you create a new character, you can choose from different sprites for Actor001. I also want it so Actor001 can never be a member of a party, but IS the controlled character.

I am still in the process for working it out but if anyone can help it would be greatly appreciated.

So far I have changed refresh in Game_Party to this to omit the [0] actor
Code:
  

def refresh

    # Actor objects split from $game_actors right after loading game data

    # Avoid this problem by resetting the actors each time data is loaded.

    new_actors = []

    for i in [email=1...@actors.size]1...@actors.size[/email]

      if $data_actors[@actors[i].id] != nil

        new_actors.push($game_actors[@actors[i].id])

      end

    end

    @actors = new_actors

  end
 
So, you want 4 "actors" in the menu & battle, but a different sprite walking around on the map?

Why? (seriously. I saw this request on another forum, and for the life of me can't make sense of why someone would want the guy walking around on the map to NOT be in the party)

The solution was to look at it like this: You have 4 "actors" in the party. The sprite on the map does not need an "actor" object, it's not really a character, it's just a sprite that walks around & represents the party. (unless I'm understanding wrong)

Edit Game_Player.refresh to use your "character_name" instead of the character_name from the first actor in the party.
In your character selection, set $game_player.character_name.
 

Jason

Awesome Bro

Ah right, well that's the basis of it, your character that you move around as, is never actually in the party, and never participates in battles, so maybe that's some help, lol.
 
My issue is that I am new to this and I still couldn't understand how to implement it. now the whole $game_player.character_name thing is makin more sense. This scripting is very odd compared to anything I am used to.

Now I have no problems figuring stuff out from here.

the usual syntax for python, which I am used to is this.

from Module_Name import class as Name
import __init__ from Name

and for using the functions in the module
Name.function

TBH my brain just could not make the ties because RGSS is so much simpler than I had expected it to be, and none of the tutorials I have read actually do any sort of comparative.

Also I didnt notice your post since I had already been asleep and already posted this topic since I did not think I should ask for support in requests.

EDIT: I don't actually have a character creation screen made but I got this code to work somehow lol.

In case anyone else ever seeks this same solution I will post mine

First in game player, inside the class add:
Code:
attr_accessor :character_name
I put this on line 10, the first line inside the class for ease.

In Game_Player change refresh to this
Code:
  def refresh

    # Set character file name and hue

    @character_name = @character_name

    @character_hue = @character_hue

    # Initialize opacity level and blending method

    @opacity = 255

    @blend_type = 0

  end

 

then you simply have to add
Code:
$game_player.character_name = "001-Fighter01"
wherever you want to change the character graphic, replace "001-Fighter01" with any image file inside Graphics/Characters/ omitting the extension (eg. bmp, png, etc)

You could always also add an attr_accessor:character_hue to the class, and be able to change the hue with a slider or whatever strikes your fancy.
 

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