What's the least worst way to have essentially a two-headed char?

Started by FortressCaulfield, Tue 29/10/2024 14:08:22

Previous topic - Next topic

FortressCaulfield

Looking to have essentially a two-headed char. They move as a unit, but each has their own talk animations, idle animations and talk text color. My ideas for how to handle this:

1. Have just one char showing both heads, with multiple views. Make a function for the 2nd head talking that swaps to that view, changes the speech color, calls CharB.Say and then changes back. Put something in rep-exec for the 2 rooms the char can go into that changes the idle to the other view whenever the char is doing their idle.

2. Have two chars and glue them together somehow. Maybe a check in rep-exec that if char A is moving, set char B's position. Might result in stuttering though. Maybe doable with dynamic sprites but my understanding of those is poor. If the gluing can be done easily, this seems to be the most organic.

3. Number 2 but with cheating. Whenever they need to move, set char B invis or offscreen then reposition when movement ends, with char A's movement view showing both of them together.
"I can hear you! My ears do more than excrete toxic mucus, you know!"

-Hall of Heroes Docent, Accrual Twist of Fate

RootBound

Pretty sure you can do option #2 and use FOLLOW_EXACTLY as the distance parameter in Character.FollowCharacter. I don't think there should be stuttering.

https://adventuregamestudio.github.io/ags-manual/Character.html#characterfollowcharacter

EDIT: you should also set the game variable game.following_room_timer to 0, I think. Although that will make ALL following characters in the game change rooms at the exact same time as whoever they are following.

https://adventuregamestudio.github.io/ags-manual/Gamevariables.html#game-variables
They/them. Here are some of my games:

Crimson Wizard

Quote from: RootBound on Tue 29/10/2024 15:06:25EDIT: you should also set the game variable game.following_room_timer to 0

I believe that characters following with FOLLOW_EXACTLY must ignore following_room_timer and teleport instantly, otherwise that would defeat the purpose of this option.

On another hand, my understanding is that FollowCharacter only updates position, but not things like loop and frame. Therefore, one will have to still update these things in rep-exec. It's better to use "late_repeatedly_execute_always", as it's run just after characters update.

SMF spam blocked by CleanTalk