Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mushroom.Lord on Thu 23/01/2014 21:37:20

Title: Giving the option of which sprite to use for the main character. Possible?
Post by: Mushroom.Lord on Thu 23/01/2014 21:37:20
Hello,  hello~!
I won't bore you with small talk, for now.

Hopefully my topic question is clear. I'd like to know if it's possible to give the option to choose the look of the playable character, before the game begins. My idea is to give three sprite choices (for my idea, they will choose between different ethnicity's) , and depending on the choice of the sprite, I want a the family-characters connected with that choice to be affected as well.

But is this even possible? Will it take more than a beginner's knowledge to be able to pull this off?

If you've read this, thank you in advance. Hope to hear from you soon!
Title: Re: Giving the option of which sprite to use for the main character. Possible?
Post by: GlaDOSik on Thu 23/01/2014 21:50:28
Of course it is possible. Make an empty room with proper GUI and buttons. Make your views with different sprites. Than use code player.ChangeView(int view); for change the view as you want.
Title: Re: Giving the option of which sprite to use for the main character. Possible?
Post by: Adeel on Thu 23/01/2014 21:53:55
Yes, AGS is more than capable to perform such task. Search for 'ChangeView' in the manual, that pretty much answers your question :) .

Here's what I'd do:

1. Create three separate views containing the an outfit of the character respective in each.

2. Use a GUI or you may use a separate room (depending on your need) to display the option to choose the outfit.

3. Assign the player's selected 'outfit' view to the playable character.

And yes, based on the playable character's view, you can change the family characters view accordingly too. Use "Character.View" to change their views.

To answer your last question: Yes and No. If you don't have a programming background, then it may be difficult for you first. But in honesty, I feel that it'll not be difficult for you (if you already have some programming experience).

If you've other questions related to this problem, please feel free to ask. :)
Title: Re: Giving the option of which sprite to use for the main character. Possible?
Post by: Crimson Wizard on Thu 23/01/2014 22:02:42
I think it will be easier to create three separate characters with their corresponding views set up at design time (in editor), then use "Character.SetAsPlayer()" command after player selection.
Same for family members.
This way you will even be able to set up different interactions for player/family characters without checking which sprites they are "wearing".
Title: Re: Giving the option of which sprite to use for the main character. Possible?
Post by: Adeel on Thu 23/01/2014 22:05:54
Quote from: Crimson Wizard on Thu 23/01/2014 22:02:42
I think it will be easier to create three separate characters with their corresponding views set up at design time (in editor), then use "Character.SetAsPlayer()" command after player selection.

From a beginner's perspective, I agree with you. (nod) Its far easier to create three separate characters with their corresponding views and manage them than to mess with different views. :)
Title: Re: Giving the option of which sprite to use for the main character. Possible?
Post by: Khris on Fri 24/01/2014 01:42:07
Actually, I'd recommend using a single character and assigning them a view depending on the player's choice.
The reason is that in dialog scripts, one should use the actual character name instead of the player pointer, at least if one might end up wanting to add voices to the game.

In every other situation it's not much of a difference; should you want to check for the ethnicity during the game, it doesn't really matter whether you compare player to a character of player.View to a view.
Title: Re: Giving the option of which sprite to use for the main character. Possible?
Post by: Adeel on Fri 24/01/2014 09:28:55
By the way, WELCOME TO THE AGS FORUMS! ;-D Just noticed that this is your first post. :)