Page 1 of 1

Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 12:45 pm
by Deadlock989
I'm making a short teleportation cutscene. The outline of the sequence is:

1. Teleporter pad animates (several cutscene waypoints)
2. Character disappears
3. Transition to destination pad
4. Character appears

Because it's a cutscene (the best way to get timed events) the player is already detached from this character. But I can't find any satisfactory way of hiding a character from view except by moving them somewhere off-screen. My first choice was to teleport the character to a "limbo surface" (a single chunk of solid ground) and then retrieve them. But you can't teleport characters across surfaces, only players and vehicles (if the player is inhabiting a character it teleports with them but this is a cutscene and the player is detached). My next attempt was to make the character non-destructible and teleport them to the edge of the map, a million tiles away. This apparently works but just feels wrong on several levels.

Is it possible to create an empty character animation and set them to that? Can you define custom CharacterArmorAnimations and can you set them in runtime? Having trouble finding out.

What about destroying the character and then recreating it exactly?

Someone must have done this, surely. I've looked at a couple of teleporter mods but they don't go to these lengths (we only got this kind of cutscene sophistication relatively recently).

Re: Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 12:50 pm
by Klonan
You can make an invisible car, and set the character to be the driver of that car

Re: Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 12:54 pm
by Deadlock989
Klonan wrote: Tue Oct 27, 2020 12:50 pm You can make an invisible car, and set the character to be the driver of that car
Wow.

Vehicles can teleport cross surface. Could I use a vanilla car and move them to a limbo surface all in the same tick?

Re: Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 12:57 pm
by Klonan
Deadlock989 wrote: Tue Oct 27, 2020 12:54 pm Vehicles can teleport cross surface. Could I use a vanilla car and move them to a limbo surface all in the same tick?
Looks like it should work

Re: Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 2:00 pm
by Deadlock989
It sort of works but there are issues.

1. When putting the character in the car, the car makes its engine noises which play the next tick, even though the car is now on the limbo surface. I could set up a vehicle without sounds but then I may as well make an invisible one.

2. The character reference seems to be destroyed when it enters the vehicle and it becomes disassociated from the cutscene's player. When you eject the driver at the other end with set_driver(nil), I can't see any way to get the resulting character and re-associate it (short of scanning for characters in a radius but I have this set up so multiple players can use the pad at the same time). You end up in a weird state a bit like a god controller except you can't access any GUI, even your own inventory.

3. There's some random puff of smoke coming from somewhere when you eject the driver, not sure if it's the vehicle or what.

Going to bash my head on it a bit more later.

Re: Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 2:04 pm
by eradicator
You don't need to detach the character - at least not if you're doing it to prevent the cutscene from "returning" to the start at the end. My (unpublished) teleporter mod teleports the player to the target, starts the cutscene and then teleports it back to start the animation all in the same tick. Thus at the end of the cutscene the camera "returns" to the final destination instead of the point of origin.

Re: Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 2:06 pm
by Deadlock989
eradicator wrote: Tue Oct 27, 2020 2:04 pm You don't need to detach the character - at least not if you're doing it to prevent the cutscene from "returning" to the start at the end.
No, I'm doing it so that the character isn't on the pad when the cutscene transitions there.

Re: Hiding a character during cutscene?

Posted: Tue Oct 27, 2020 2:11 pm
by eradicator
Deadlock989 wrote: Tue Oct 27, 2020 2:06 pm
eradicator wrote: Tue Oct 27, 2020 2:04 pm You don't need to detach the character - at least not if you're doing it to prevent the cutscene from "returning" to the start at the end.
No, I'm doing it so that the character isn't on the pad when the cutscene transitions there.
In that case teleporting to the edge of the world sounds more reasonable then inventing an invisible car. I just teleport them half way through the cutscene so the player never sees themselfs dis/reappear.

Re: Hiding a character during cutscene?

Posted: Thu Oct 29, 2020 5:50 pm
by Klonan
Deadlock989 wrote: Tue Oct 27, 2020 2:00 pm 2. The character reference seems to be destroyed when it enters the vehicle and it becomes disassociated from the cutscene's player. When you eject the driver at the other end with set_driver(nil), I can't see any way to get the resulting character and re-associate it (short of scanning for characters in a radius but I have this set up so multiple players can use the pad at the same time). You end up in a weird state a bit like a god controller except you can't access any GUI, even your own inventory.
What reference do you mean?
The Lua reference is held intact when I test it

Re: Hiding a character during cutscene?

Posted: Thu Oct 29, 2020 6:37 pm
by Deadlock989
Klonan wrote: Thu Oct 29, 2020 5:50 pm What reference do you mean?
The Lua reference is held intact when I test it
It might be because I wasn't doing character.driving = false but instead I was doing car.set_driver(nil). That does eject the passenger but my cached reference to the character was lost. Or maybe it was something else.

Re: Hiding a character during cutscene?

Posted: Thu Oct 29, 2020 8:29 pm
by Deadlock989
Yep, got it working with a barebones car made of one transparent pixel and happy thoughts. Thanks.