Go Back   Steam Users' Forums > Steam Tool Discussions > Source SDK General Discussion

Reply
 
Thread Tools Display Modes
Old 05-16-2012, 03:26 PM   #1
Animyr
 
Join Date: Sep 2008
Reputation: 14
Posts: 676
Making a dream sequence

I'm thinking of implementing some dream sequences into my HL2 mod campaign. I was wondering if anyone could tell me how to-

Slow player movement speed/simulate slow mo

Disable weapons and sprinting

Create a screen overlay that distorts vision, or perhaps adds a grainy/sepia tone. Something edgy.

Cause figures to fade away

Those are the basics. Does anyone know anything about these things?
Animyr is offline  
Reply With Quote
Old 05-16-2012, 03:39 PM   #2
WIllSmith190
 
Join Date: Apr 2010
Reputation: 2
Posts: 93
Well, I'd see this to be pretty simple with some C++. I won't post any code (because that's your job!) but I can give you a good structure:
  • Create an entity, something like trigger_dreamsequence. Give it the usual trigger functionality.
  • Also, add a field along the the lines of "Sequence". I'm assuming when it fades out, some video will play. I don't know what video format Source uses, I think its .BIK, or Bink Video, but I have no confirmation. But attach a video, and look at some other code to figure out how to play them.
  • When the player enters the trigger, lower the timescale, remove the weapons and ammo/sprinting (save them in a variable), and add a fading effect. Look at the code for the entity that fades to black (I don't remember its name...).
  • When the sequence is complete, fade back, restore the timescale, and the players inventory/sprinting.
Most of the code you need is already in the engine, you just need to find it.

Now, if your looking to do this in hammer, that might be a little tricky. C++ will keep it simple and contained.

P.S. For funky screen effects look into post-processing. (With a quick look on the wiki, I found this. If you know HLSL, you can write your own shader, or use one of Valve's. But there's code to apply them)
WIllSmith190 is offline   Reply With Quote
Old 05-16-2012, 07:02 PM   #3
Karlos_Modder
 
 
 
Join Date: May 2007
Reputation: 7
Posts: 748
All this can be done in hammer without coding..

1)For controlling the players movement - Player_speedmod
Set in incriments of 0.1 to 1. 0.1 meaning no movement, 1 full movement.
In the flag section you can suppress things like Hud, Sprint and weapons.

2) For a screen effect - env_screenoverlay
Select your custom animated texture. It will need the $Transparent "1" line in the vmt. Could also add a env_shake and tweak the shake value for big and slow.

3) For object fade, you can set each npc, prop to have its own fade distance from the player.
Or if its a npc aproching the player you can set the NPC's "Render FX" to "Fade Near". Which i think (havent tested) will fade the npc the closer it gets to the player.

Last edited by Karlos_Modder: 05-16-2012 at 07:04 PM.
Karlos_Modder is offline   Reply With Quote
Old 05-17-2012, 04:06 PM   #4
WIllSmith190
 
Join Date: Apr 2010
Reputation: 2
Posts: 93
Ok, that's fine. I didn't say it couldn't be done, I'm just saying it would be easier in the long run (if you knew C++, of course) to code it. He just didn't specify his technical background or expectations involving how it should be done.
WIllSmith190 is offline   Reply With Quote
Old 05-24-2012, 07:57 AM   #5
Animyr
 
Join Date: Sep 2008
Reputation: 14
Posts: 676
Belated response--I don't have any programming or coding experience. Sorry for not making that clear. I'm hardly unwilling to learn it if I need to make something work, but any explanations would have to start in the beginning, I'm afraid.

Quote:
Originally Posted by Karlos_Modder View Post
2) For a screen effect - env_screenoverlay
Select your custom animated texture. It will need the $Transparent "1" line in the vmt. Could also add a env_shake and tweak the shake value for big and slow.
I do know how overlays work, but how would I go about making a custom texture? Photoshop(which I don't have)? And when I do have it, where would I put it so I can call it up in hammer?

Also, I was wondering if I could put a corpse model (like the civilian with his face eaten off) on a npc_citizen to have them walking around/standing. Also, I'm thinking about putting some people underwater in the dream sequences. Any way I could rig it so they don't die (which I believe most npcs do when put underwater)?

Thanks. I'm getting pretty specific here so I understand if you can't help.
Animyr is offline   Reply With Quote
Old 06-06-2012, 06:12 PM   #6
Animyr
 
Join Date: Sep 2008
Reputation: 14
Posts: 676
Bump. It's been a while.
Animyr is offline   Reply With Quote
Old 06-07-2012, 03:00 AM   #7
CrAzYpotpie
 
Join Date: Sep 2010
Reputation: 35
Posts: 453
No offense, but most of your questions can be solved with a simple google search.
Just search how to make custom textures for source engine games, follow whatever the tutorial says and apply it to what you need.

As for changing the citizen model to the corpse one, it probably won't be possible unless you are willing to decompile the corpse model and decompile the citizen model, then put all the animations from the citizen into the corpse model by editing its associated .QC file. (Search up adding existing animations to models for source)

Easier for you, you could just modify the skin of the citizen to look as you see fit. (Search up how to edit skins, etc.)

As for NPC's dying underwater, almost positive this only applies to Headcrabs. Every other base Half-life 2 NPC seems to function as normal underwater.

I would've given you step by step, but the fact is your questions are pretty damn simple, a small amount of searching should provide you with all the info you will need regarding what you asked.

Also, since you seem to have no photo editing software (seeing as how you mention photoshop), I recommend downloading....
GIMP for photo editing/creation
and...
VTF Edit for easily converting image files into Source Compliant materials!

Last edited by CrAzYpotpie: 06-07-2012 at 03:06 AM.
CrAzYpotpie is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source SDK General Discussion


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.