Change character look

Unstructured ideas, requests and suggestions for the development of the game.
User avatar
Antison
Posts: 5480
Joined: Mon Mar 28, 2011 11:33 pm
android_version: 14 - Android 14
Location: A home without a beagle is just a house

Re: Change character look

Post by Antison »

Lam al Adie wrote: Thu May 16, 2024 8:39 am
Nut wrote: Thu May 16, 2024 8:21 am Hi Odin,
to change an existing character into a new one - what should it do? Forget all quests, items, skills and xp, so that you can replay the game?
I think, he meant to change the sprite…

It would be nice to have that possibility and a load of additional sprites for the li'l guy, so you can change the look according to you gear/weapon preference.
Or to have that changed automatically, when yor switch from light to heavy armor or such.

On the other hand I appreciate your concentration on developing more content than on changes to the game engine.
https://www.andorstrail.com/viewtopic.p ... 7&start=40
Page 5
"A home without a beagle is just a house"
Lam al Adie
Posts: 221
Joined: Mon Jan 18, 2021 4:14 pm
android_version: 11 - Android 11
Location: gargoylecave

Re: Change character look

Post by Lam al Adie »

Yes, thanks, I have seen that post some days ago.
But the question here went beyond having more choices for a new character: it's about possibilities to change the look of your existing character during gameplay, with my addition of doing so automatically.

But as I said, if I were Dev, I probably would not put much effort into such a feature before we all have found Andor.
Lam 'al Adie (pd)
Lvl:68 XP: 5728519 AP: 12/3 HP: 204 AC: 228 AD: 43-55 BC: 164 DR: 7
Skills: WA: 1 Do: 4 CS: 2 IF: 4 Ev: 2 Reg: 1 WP:1S: 1 AP:S: 1 FS:WS: 2 S:WS: 1
ROLS: 1 GoLF: 1
Raphi
Posts: 78
Joined: Thu Sep 21, 2017 8:19 pm
android_version: 11 - Android 11
Contact:

Re: Change character look

Post by Raphi »

Theoretically this should be possible. When creating a new savegame, the WorldSetup.java calls the following function with "newHeroIcon" as an attribute.

src/.../AndorsTrail/WorldSetup.java/155

Code: Select all

world.model.player.initializeNewPlayer(world.dropLists, newHeroName, newHeroIcon);

The called function defines this newHeroIcon as an iconID:

src/.../AndorsTrail/model/actor/Player.java/105

Code: Select all

baseTraits.iconID = playerIcon;

If you would create a method in Player.java like

Code: Select all

private void updatePlayerIcon(int playerIcon) {
	baseTraits.iconID = playerIcon;
}
this should update the Player's character Icon. However, I do not know how AT saves these information into a savegame file, I guess my suggenstion would only change the icon during a running game but not save the change to the actual savegame file.
Lvl: 75, XP: 7837474, Gold: 92480, RoLS: 1
Hp: 253, AC: 309, AD: 26-41, BC: 163, DR: 8
Hat o protector
Knight's hauberk
JoF
LifeTaker
Blade o protector
Polished Ring o protector
RolS
Gloves o guardian
Boots o Globetrotter
Raphi
Posts: 78
Joined: Thu Sep 21, 2017 8:19 pm
android_version: 11 - Android 11
Contact:

Re: Change character look

Post by Raphi »

The question would be, where would you put the option to change your look ingame. I would either put a button over the character in the inventory:
Change_Icon_Location.jpg
or in the character's overview:
Change_Icon_Location_2.jpg
This button could then open a popup menu with all possible character sprites (excluding the ones that would be used ingabe for e.g. turning the player into a toad etc.)

Choosing a character sprite by clicking on it would then trigger the updatePlayerIcon method with the respective integer as an attribute.
You do not have the required permissions to view the files attached to this post.
Lvl: 75, XP: 7837474, Gold: 92480, RoLS: 1
Hp: 253, AC: 309, AD: 26-41, BC: 163, DR: 8
Hat o protector
Knight's hauberk
JoF
LifeTaker
Blade o protector
Polished Ring o protector
RolS
Gloves o guardian
Boots o Globetrotter
User avatar
Antison
Posts: 5480
Joined: Mon Mar 28, 2011 11:33 pm
android_version: 14 - Android 14
Location: A home without a beagle is just a house

Re: Change character look

Post by Antison »

Lam al Adie wrote: Thu May 16, 2024 10:27 am
Yes, thanks, I have seen that post some days ago.
But the question here went beyond having more choices for a new character: it's about possibilities to change the look of your existing character during gameplay, with my addition of doing so automatically.

But as I said, if I were Dev, I probably would not put much effort into such a feature before we all have found Andor.
You didn't read the post in that link that I made
Screenshot_20240516-070523.png
You do not have the required permissions to view the files attached to this post.
"A home without a beagle is just a house"
User avatar
Odin
Posts: 52
Joined: Mon Sep 25, 2017 4:26 pm
android_version: 14 - Android 14

Re: Change character look

Post by Odin »

Raphi wrote: Thu May 16, 2024 10:47 am The question would be, where would you put the option to change your look ingame. I would either put a button over the character in the inventory:


or in the character's overview:


This button could then open a popup menu with all possible character sprites (excluding the ones that would be used ingabe for e.g. turning the player into a toad etc.)

Choosing a character sprite by clicking on it would then trigger the updatePlayerIcon method with the respective integer as an attribute.
Either way would be a usefull option for older characters.
Odin
Lvl: 90
RoLS: 2 ElyR: 1 GoLF: 1 SRoV: 1 HoF: 1

Ivar
Lvl:29
RoLS: 1
Lam al Adie
Posts: 221
Joined: Mon Jan 18, 2021 4:14 pm
android_version: 11 - Android 11
Location: gargoylecave

Re: Change character look

Post by Lam al Adie »

Antison wrote: Thu May 16, 2024 11:03 am You didn't read the post in that link that I made

Screenshot_20240516-070523.png
I sure did, but did not understand it the way you seem to have intended.
Lam 'al Adie (pd)
Lvl:68 XP: 5728519 AP: 12/3 HP: 204 AC: 228 AD: 43-55 BC: 164 DR: 7
Skills: WA: 1 Do: 4 CS: 2 IF: 4 Ev: 2 Reg: 1 WP:1S: 1 AP:S: 1 FS:WS: 2 S:WS: 1
ROLS: 1 GoLF: 1
Raphi
Posts: 78
Joined: Thu Sep 21, 2017 8:19 pm
android_version: 11 - Android 11
Contact:

Re: Change character look

Post by Raphi »

Don't mind my posts, I'm just collecting ideas on how this could be done :roll:

Let's say we want to put it in the inventory tab. We would have to take a look at the following file:

AndorsTrail/res/layout/heroinfo_equipped.xml

On line 14-20, the Character's sprite is shown. If this could be used for an onClick function of some sort, this should be quite easy without huge changes.


This could be done very similar on how the worn items are clickable:

src/.../AndorsTrail/activity/fragment/HeroinfoActivity_Inventory.java:171

Code: Select all

imageView.setOnClickListener(new OnClickListener() {
	@Override
	public void onClick(View v) {
		if (player.inventory.isEmptySlot(inventorySlot)) return;
		imageView.setClickable(false); // Will be enabled again on update()
		showEquippedItemInfo(player.inventory.getItemTypeInWearSlot(inventorySlot), inventorySlot);
	}
});

This would look something like this:

Code: Select all

imageView.setOnClickListener(new OnClickListener() {
	@Override
	public void onClick(View v) {
		showCharacterIconSelection();
	}
});

Of course, what's missing still is the menu itself, where the player can choose the sprite. I have not yet figured out how to do that, unfortunately.

Code: Select all

private void showCharacterIconSelection() {
	// Show a new inflated window with either a vertical list or a grid containing all chooseable character sprites
	// Each element of the list/grid has to have an onClick function itself, which calls player.updatePlayerIcon(spriteID);
	// Problem: How to define which spriteID would be called for each button?
}
Edit: If I find the time for it, I will try implementing this function and, if it actually works, I can do a pull request for it on GitHub ;)
Lvl: 75, XP: 7837474, Gold: 92480, RoLS: 1
Hp: 253, AC: 309, AD: 26-41, BC: 163, DR: 8
Hat o protector
Knight's hauberk
JoF
LifeTaker
Blade o protector
Polished Ring o protector
RolS
Gloves o guardian
Boots o Globetrotter
Lam al Adie
Posts: 221
Joined: Mon Jan 18, 2021 4:14 pm
android_version: 11 - Android 11
Location: gargoylecave

Re: Change character look

Post by Lam al Adie »

:twisted: See me doing Ballmers developers-dance for you.
Lam 'al Adie (pd)
Lvl:68 XP: 5728519 AP: 12/3 HP: 204 AC: 228 AD: 43-55 BC: 164 DR: 7
Skills: WA: 1 Do: 4 CS: 2 IF: 4 Ev: 2 Reg: 1 WP:1S: 1 AP:S: 1 FS:WS: 2 S:WS: 1
ROLS: 1 GoLF: 1
Post Reply