Scripted sequences and trains Created 14 years ago2010-02-05 19:28:07 UTC by Notewell Notewell

Created 14 years ago2010-02-05 19:28:07 UTC by Notewell Notewell

Posted 14 years ago2010-02-05 19:30:36 UTC Post #278730
I have this train, and it works more or less perfectly the way I want it. The citizens on it, not so much. While it's moving, it looks like this:
User posted image
not the best lighting, but that can be fixed later.
Then, after the train stops and the citzens get triggered to play their 'get up' animations with a scripted sequence, they dissapear;
User posted image
They're teleported below the train, and shoved into the "holding train rail" animation, which the female models are missing.
User posted image
I've checked to make sure there is no "post action idle animation" and I've tried renaming the one, to make sure it's not just that the sequences share a name- the citizens have always been differently named.

What is wrong with this? :|
Notewell NotewellGIASFELFEBREHBER
Posted 14 years ago2010-02-05 21:48:32 UTC Post #278731
Strange. :P

Didn't Valve include their intro levels in the SDK, or am I imagining that? Can't check at the moment, but if it's there, have a look how they did it. If it's not there, decompile it. Scripted sequences on moving objects isn't something I think I've tried before, or can't remember doing, at least.
Strider StriderTuned to a dead channel.
Posted 14 years ago2010-02-06 22:49:29 UTC Post #278732
It's where I got the train, but I can't for the life of me figure out how the guys on the train worked, because they don't seem to have scripted sequences except in the fake one.
EDIT: Anyone know how to fix this?
Notewell NotewellGIASFELFEBREHBER
Posted 14 years ago2010-02-07 03:47:37 UTC Post #278754
I would like to know the answer to this one as well. I have had some problems parenting npc's to moving object-like a train-in my case a shuttle.

I have had luck parenting to an elevator, up and down but I always get a jerky movement from the npc when I try something like a train. Is the train simply moving too fast and the npc is literally compensating for the movement? I got frustrated with it and gave up.

I am sure there is a way...maybe I will decompile that...
Posted 14 years ago2010-02-07 09:44:28 UTC Post #278756
I just want to know why the hell they dissapear when they finish their sequences, I can't find anything that tells them to go down, back and into that animation.
Notewell NotewellGIASFELFEBREHBER
Posted 14 years ago2010-02-07 10:33:10 UTC Post #278758
Try putting an NPC clip under the floor and as for the females I don't think there's anything you can do as Valve only used males for the train and I recall wanting a metro to stand on a female on the floor but she was missing the animation.

Make sure teleport to script is ticked in flags. I haven't looked at the map in ages but they use the fake train for the gman transition and then you're teleported to the real train that moves along a path. I take it the scripts are parented to the train?

If all else try remaking this in a hollow box test map to see if they still fall through.
Habboi HabboiSticky White Love Glue
Posted 14 years ago2010-02-07 11:27:49 UTC Post #278759
Yeah, both the citizens and the sequences are parented to the train (somehow the valve map doesn't use scripted sequences on the real train, just the fake one which I copied)
I have them all with different animations, and that worked until I got the train turned into a train, now they teleport to where they are in pic 3, animations included. I'll see what I can do with NPC clip.
EDIT: Well, they... stay at the correct height now. Except for the old guy, who always seems to be teleported into the car behind the one with NPCs inside.
User posted image
They still move backwards and go into the standing animation, and I have no idea why.
EDIT2: Popped it into the vault, maybe one of you can pull it appart and tell what I'm doing wrong.
Notewell NotewellGIASFELFEBREHBER
Posted 14 years ago2010-02-07 13:54:12 UTC Post #278760
Right so I looked at the Valves VMF and it seems they've done a strange trick which I am still trying to dissect but it looks like they use a logic_relay called "relay_train_reached_station" that is triggered to unparent the NPC's when the train has reached its stop. I say unparent because they've left the parent box blank in the outputs.

They also use an ai_goal_actbusy that targets "citizen_train_*" and outputs

OnNPCstartedbusy, citizen 1 and 2 - clearcontext and then 0.10 seconds later they added pre_customs 1 so valve wiki says that they are used to:

http://developer.valvesoftware.com/wiki/Actbusy

So in other words I believe Valve use the act busy nodes to make them do the animation rather than using scripted sequences and I think once the train stops they unparent them by leaving the field blank so that they can walk away.

There's an example VMF in that link and there's a VIDEO tut here on YouTube:

http://www.youtube.com/watch?v=1q-KAnibcC4
Habboi HabboiSticky White Love Glue
Posted 14 years ago2010-02-07 19:25:13 UTC Post #278762
So... Unparent the sequences and citizens before I trigger the sequences to play? I guess I can try that- but it doesn't explain why all the citizens are put into that animation.
EDIT: Instead of using Setparent>[blank], I could use ClearParent, correct?

Seems to- Now they stay in their spots, however, they tend to sit in the trainidle animation for a second afterwards.
User posted image
User posted image
Well, it mostly fixes it, some of them still shift a little.
Notewell NotewellGIASFELFEBREHBER
Posted 14 years ago2010-02-07 21:51:52 UTC Post #278765
Well if you read I said they seem to use act busy entities instead of scripts to pose them. If you want to learn more you should look at the two links since that seems to be the proper way to do it.
Habboi HabboiSticky White Love Glue
Posted 14 years ago2010-02-07 22:56:13 UTC Post #278766
Yeah, I know, but I'm not sure if all the animations I want have actbusies with them. I could take a look and then try that, but I'm too tired tonight.
Notewell NotewellGIASFELFEBREHBER
Posted 14 years ago2010-02-08 04:10:08 UTC Post #278773
sure, you can use the setparent/clear parent to attach/detach them. Like I said, I have gotten it to work on an elevator moving up and down with no problem. It's only when I try to move something horizontally i get the little glitch action. I am going to try the actbusy myself cause the level it's in actually has it setup already. Will let you know if I have anymore luck with that.
You must be logged in to post a response.