Help creating a simple output?

Grab your favourite IDE and tinker with the innards of game engines

Help creating a simple output?

Postby nanoxax on Sat Mar 10, 2012 1:03 am

What I want to do is create an output so that when an NPC sees a corpse/ragdoll they do whatever I set them to do in Hammer. I've already tried to implement my own output but I got nowhere. I can't figure out how to make anything trigger the output. Do I need to create a schedule for this or is there any easier route. I've been working a while on this and cannot find a solution. :(
nanoxax
Member
Member
 
Joined: Tue Oct 18, 2011 8:14 pm

Re: Help creating a simple output?

Postby zombie@computer on Sat Mar 10, 2012 6:54 pm

by default, npcs dont just register everything they can possibly see. You'll have to make a think function that checks every xxx seconds if a certain other object is in their field of view. In your case, this means running a piece of code that checks every corpse/ragdoll in the map whether or not it is in the npcs field of view, and if it is, fires an output. Im sure you can imagine why this code isnt there by default. You'll have to create it yourself.
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Help creating a simple output?

Postby LordDz on Sat Mar 10, 2012 11:39 pm

Can trigger_multiple detect ragdolls?
Cause in that case, parent a trigger on to the npc in front of him with a filter set to ragdolls and activate a relay when it is triggered.
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: Help creating a simple output?

Postby Gary on Sat Mar 10, 2012 11:50 pm

zombie@computer wrote:by default, npcs dont just register everything they can possibly see. You'll have to make a think function that checks every xxx seconds if a certain other object is in their field of view. In your case, this means running a piece of code that checks every corpse/ragdoll in the map whether or not it is in the npcs field of view, and if it is, fires an output. Im sure you can imagine why this code isnt there by default. You'll have to create it yourself.



Could look at the trigger_look code for reference maybe?
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Help creating a simple output?

Postby zombie@computer on Sun Mar 11, 2012 10:16 am

Thats where i'd start yeah.
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Return to Programming

Who is online

Users browsing this forum: No registered users