Trigger something on hit?

Any aspects of level design for the Source engine.

Trigger something on hit?

Postby crashz2 on Wed Jul 16, 2014 10:33 pm

Hey, I have a question, so I tried to create something like a hitmarker.
It should display something/ or play a sound when you dealt damage to a player.

I wanted this for a practise map I made.

Some things I tried:
A trigger_hurt with - value ( a healer) with a OnHurt Output. (Like when you lost health = you get healed = trigger).
But guess what? OnHurt triggers always, even with 0 damage set..

Next thing I tried was a logic_playerproxy, again I thought thats gonna be simple but no, either I don't know how to use it or it just doesn't work in CS:GO.

So in other words, is there anyway to detect that hit someone?(Without parenting a func_button on the player or something like this, cause this isnt accurate)


Thanks in advice, crashz
crashz2
Dumpling
Dumpling
 
Joined: Mon Jul 14, 2014 10:57 am

Re: Trigger something on hit?

Postby LordDz on Thu Jul 17, 2014 12:35 pm

I don't really think you can do it in hammer alone unless you want to do funky things like adding func_breakables to players and using the OnDamaged event.

I would probably use VScript for it.

Some examples to help ya:
https://developer.valvesoftware.com/wik ... t_Examples
https://developer.valvesoftware.com/wiki/L4D2_Vscripts
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: Trigger something on hit?

Postby crashz2 on Thu Jul 17, 2014 1:35 pm

LordDz wrote:I don't really think you can do it in hammer alone unless you want to do funky things like adding func_breakables to players and using the OnDamaged event.

I would probably use VScript for it.

Some examples to help ya:
https://developer.valvesoftware.com/wik ... t_Examples
https://developer.valvesoftware.com/wiki/L4D2_Vscripts


Hey thanks for answering!, hmm I thought that it isn't possible..
I looked into this https://developer.valvesoftware.com/wik ... _Functions and I can't really find something related to: taking damage, dealing damge, losing health. But maybe its possilbe with this getHealth command, but since I have no idea how to use Squirrel I can only hope to find someone who does.
crashz2
Dumpling
Dumpling
 
Joined: Mon Jul 14, 2014 10:57 am

Re: Trigger something on hit?

Postby LordDz on Thu Jul 17, 2014 2:16 pm

I don't really have that much experience with VScript, you would probably have a better time asking your question at
Allied Modders
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: Trigger something on hit?

Postby crashz2 on Thu Jul 17, 2014 2:39 pm

LordDz wrote:I don't really have that much experience with VScript, you would probably have a better time asking your question at
Allied Modders

Isn't that with plugins? If it isn't possible without plugins I'll just forget it..
crashz2
Dumpling
Dumpling
 
Joined: Mon Jul 14, 2014 10:57 am

Re: Trigger something on hit?

Postby YokaI on Sat Jul 19, 2014 9:06 am

crashz2 wrote: But maybe its possilbe with this getHealth command, but since I have no idea how to use Squirrel I can only hope to find someone who does.


You could basically have each player update their own vScript attached which compares their current health with the health they had last frame and, if the health is lower than it was last frame, you can display a message.

Alternatively, you could perhaps use Vscript to bind trigger to the player which will send a message when it is shot.

With a bit of reading you can quickly learn Squirrel, it's a very high level programming language. I'd suggest looking at the cp_dust script that comes with the installation of Valve Hammer.

Keep us updated on how this project goes. Cheering for you!
YokaI
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 03, 2004 12:38 am

Return to Hammer Editor Help

Who is online

Users browsing this forum: No registered users