The Simple Questions Thread.

Any aspects of level design for the Source engine.

Re: The Simple Questions Thread.

Postby sloprano on Wed Oct 15, 2014 11:04 am

I don't know if this will work as you intended, but I think you can stop an npc from thinking and moving with some console commands:

Use "npc_select x" to first select the npc you want to manipulate, just replace "x" with your npc's name. With the npc seleceted, use "npc_freeze" to comepletely freeze it in place. When you want to make it start moving and attacking again, issue "npc_select x" and "npc_freeze" (this will unfreeze an frozen npc).

Note 1: "npc_select x" is issued before "npc_freeze" every time to be sure you've got the right npc.

Note 2: "npc_freeze" should un-freeze any frozen npcs, but I've experienced that this isn't always the case. If "npc_freeze" dosen't unfreeze your npc, try using "npc_reset" instead.

Note 3: While frozen, an npc will still try to speak idle sounds. Check the "Gag" flag to prevent it from making sounds until it's in combat.

Issuing the above commands through a point_clientcommand from Hammer should hopefully produce the results you are looking for.
sloprano
Member
Member
 
Joined: Tue Nov 09, 2004 5:46 pm
Location: Norway

Re: The Simple Questions Thread.

Postby LordDz on Wed Oct 15, 2014 11:19 am

Riomaki wrote:I'd like to have a npc_zombie_torso (or fast zombie torso) that surprises the player by coming to life and attacking them. The problem is, as far as I can tell, neither torso has animations for sitting still - all the idles have noise in them.

My first thought for an alternative was to have a prop version of the torso and then swap to the NPC version when the player wasn't looking - but is there a better way to do this with just the npc_zombie_torso itself? Maybe some wake state or flag I'm not thinking of? Maybe some built-in choreo scene?

https://developer.valvesoftware.com/wiki/Npc_zombie
Check the flags, "2 : Gag :No IDLE sounds until angry".

So just set it's Sleep State to "3: Waiting for input, ignore PVS", then trigger it to wake when the player comes close to it, add a "OnDamaged" output to the zombie itself and make that wake it too.
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: The Simple Questions Thread.

Postby Riomaki on Wed Oct 15, 2014 4:52 pm

Sloprano> I think your suggestion is interesting, but both of those commands are, according to the VDC, reliant on sv_cheats 1.

LordDz> Thanks, but that Sleep State just makes the zombie torso invisible until I Wake it. It would be useful for doing a switcharoo, but not if I wanted to have the NPC do everything.

I came up with an alternative last night that doesn't involve using a real zombie at all, but accomplishes the same ooga-booga moment. Basically, it's using the Ragdoll Boogie command on a prop_ragdoll corpse. I've done this trick before and I just didn't think about applying it here. It arguably works better because the player wouldn't expect this prop to move at all. :)
Riomaki
Regular
Regular
 
Joined: Sun Jul 14, 2013 12:28 am

Re: The Simple Questions Thread.

Postby joe_rogers_11155 on Wed Oct 15, 2014 7:47 pm

tell me more about this ragdoll boogie please. never heard of it.
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: The Simple Questions Thread.

Postby Riomaki on Wed Oct 15, 2014 9:11 pm

On a prop_ragdoll, you can send the input "StartRagdollBoogie." It causes the joints of the model to randomly jitter for a hardwired amount of time, about 4-5 seconds. It's most notable use in the game itself is for the corpse that gets electrocuted against the fence in Ravenholm.

It's generic enough that you can use it for things other than humans. I used it with a hanging Antlion Guard corpse in a recent map, and now I'm using it on one of the charred corpse models.

If you couple this with a moaning or screaming sound effect, it looks real enough to pass as death convulsions. I haven't seen this particular trick used very often, though.
Riomaki
Regular
Regular
 
Joined: Sun Jul 14, 2013 12:28 am

Re: The Simple Questions Thread.

Postby ErikKiller on Thu Oct 16, 2014 11:44 am

Riomaki wrote:On a prop_ragdoll, you can send the input "StartRagdollBoogie." It causes the joints of the model to randomly jitter for a hardwired amount of time, about 4-5 seconds. It's most notable use in the game itself is for the corpse that gets electrocuted against the fence in Ravenholm.

It's generic enough that you can use it for things other than humans. I used it with a hanging Antlion Guard corpse in a recent map, and now I'm using it on one of the charred corpse models.

If you couple this with a moaning or screaming sound effect, it looks real enough to pass as death convulsions. I haven't seen this particular trick used very often, though.

Ooooh so that's what you did, REALLY good to know!
Image
Image
First rodeo? Use the Source SDK Documentation for reference!
User avatar
ErikKiller
May Contain Skills
May Contain Skills
 
Joined: Sun Sep 09, 2007 4:05 pm
Location: Estonia

Re: The Simple Questions Thread.

Postby Riomaki on Thu Oct 16, 2014 3:11 pm

Yep. Also, since Forest Train, I've been shipping the .VMF files with the maps, so you can look at how they were built, if you can deal with my sloppy visgrouping. I try to group relevant entities near each other, at least. :)
Riomaki
Regular
Regular
 
Joined: Sun Jul 14, 2013 12:28 am

Re: The Simple Questions Thread.

Postby joe_rogers_11155 on Sun Oct 19, 2014 9:42 am

Thought I might ask here since I think the programmer's simple questions thread is too quiet.

I am trying to parent dynamic lights (dlights) to all kinds of things. Thanks to Gary's help, I have successfully parented a dlight to combine orbs fired from the ar2. I am now trying to parent a dlight to the rollermine...I got it to work, sort of. It lights up when the rollermine's sparks turn on, and the light goes out when the rollermine's sparks turn off. My problem is that when the rollermine successfully attacks something, the light goes out but its metal spikes remain stuck out. I wanted to try and just have it be lit up all the time instead, and that's my problem. The code I modified to make the lit-up spikes work is c_npc_rollermine.cpp on the client side. I think I would have to modify the server file npc_rollermine.cpp to attach a dlight but I run into an error (which you will think is a noob problem to have):

error C2065: 'index' : undeclared identifier

I'm guessing that the 'index' is available in client-side but not in server-side, but I honestly know so little about programming for Source that I don't know how to proceed yet. Can anyone give me a tip or pointer? Maybe an #include I am missing on the server side. Thanks.
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: The Simple Questions Thread.

Postby Ale on Sun Oct 19, 2014 1:51 pm

Not having touched hammer in years. How exactly would i go about making a roof turn invisible/toggle on/off by walking in and out of a trigger?
Image
User avatar
Ale
May Contain Skills
May Contain Skills
 
Joined: Fri Jul 29, 2005 9:03 am
Location: Earth

Re: The Simple Questions Thread.

Postby LordDz on Sun Oct 19, 2014 3:46 pm

Turn the roof into a func_brush, (or prop_dynamic if a prop), name it invisible_roof. (Select the brush, and do ctrl + T)
Set the brush/prop to start disabled.

Create a trigger_multiple and in its outputs:

OnStartTouch
invisible_roof enable

OnEndTouch
invisible_roof disable

Voilá! You're done.
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: The Simple Questions Thread.

Postby jgoodroad on Mon Oct 31, 2016 10:59 pm

I have a feeling the cause of this is really stupid and obvious:

Image

But I've spent far too long trying to figure it out. Any Ideas?
===[]"

Image
current projects: nmo_boardwalk, nmo_asylum
User avatar
jgoodroad
Senior Member
Senior Member
 
Joined: Thu Apr 09, 2009 4:44 am
Location: on a boat... unless it's a farm.

Re: The Simple Questions Thread.

Postby GreenPepper on Mon Nov 07, 2016 1:23 pm

Not sure if this relates to your problem or will be helpful or not, but a user on another forums seemed to have a similar issue:
http://plaguefest.com/threads/black-tex ... sue.17345/
GreenPepper
Member
Member
 
Joined: Sun Jun 30, 2013 2:40 am

Re: The Simple Questions Thread.

Postby boj on Tue Jan 10, 2017 1:27 am

This is probably impossible but is there a way to make a door not disappear when you're outside the map via noclip?

This is for Garrysmod in case you're wondering.
It's just that I have a secret button covered by a sliding panel, but it goes invisible if you go underground, revealing the secret.
User avatar
boj
Member
Member
 
Joined: Mon Dec 30, 2013 12:12 am

Re: The Simple Questions Thread.

Postby LordDz on Tue Jan 10, 2017 12:11 pm

trigger_teleports under the map that teleports the player back to the spawn so they can't go outside the map.

Just make a tiny brush (8x8 or so) at the center of the origin of the trigger_teleports and they won't leak.
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: The Simple Questions Thread.

Postby boj on Wed Jan 11, 2017 12:26 pm

I don't really want to restrict anyone's movement round the map, so I'll just go with hiding it with black squares underneath
User avatar
boj
Member
Member
 
Joined: Mon Dec 30, 2013 12:12 am
PreviousNext

Return to Hammer Editor Help

Who is online

Users browsing this forum: No registered users