Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Give Prop Damage?
Shadowfied Offline
Senior Member

Posts: 261
Threads: 34
Joined: Jul 2010
Reputation: 5
#6
RE: Give Prop Damage?

(01-21-2012, 05:53 PM)Streetboat Wrote: Interesting idea, I hope it works out!

As it happens, I have a solution for ya, because I did something similar. Hint: use LocalVarInts. Every time the axe collides with the door, check for the LocalVarInt and set the health to a certain level, and at the same time, add 1 to the LocalVarInt. That way, every time the function is called, a different output will be made. For example:

void hurtdoor(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("hit") == 0)
{
SetPropHealth(80.0f);
AddLocalVarInt("hit", 1);
}
if(GetLocalVarInt("hit") == 1)
{
SetPropHealth(60.0f);
AddLocalVarInt("hit", 1);
}

...and so on. Hope that helps!
I think I know how you're thinking, but I need to see more of the script to understand it, I think.
Edit: Nevermind I'm just stupid. I pasted your script and fixed the names but it didn't work on the door or the barrel.
Edit2: Oh wait I'm even more stupid. Hold on..
Edit3: Ok I got it working the way you were thinking (I guess) and made it all the way down to 0, which should take 4 hits but it breaks instantly (the barrel right now), probably cause there are a lot of tiny collisions. I would need to make it so that it only counts when it collides with a pretty big amount of force..


(01-21-2012, 05:59 PM)Your Computer Wrote: Try
PHP Code: (Select All)
if (GetPropHealth("prop_name") > 0)
    
SetPropHealth("prop_name"GetPropHealth("prop_name")-10); 
Did not work, at least not with the way I inserted it. Besides, I don't understand that at all, and I hate using scripts which I don't understand how to make, or how they work. I appreciate the tip, though.


Current - Castle Darkuan
Other - F*cked Map
(This post was last modified: 01-21-2012, 06:14 PM by Shadowfied.)
01-21-2012, 06:04 PM
Find


Messages In This Thread
Give Prop Damage? - by Shadowfied - 01-21-2012, 05:33 PM
RE: Give Prop Damage? - by flamez3 - 01-21-2012, 05:40 PM
RE: Give Prop Damage? - by Shadowfied - 01-21-2012, 05:42 PM
RE: Give Prop Damage? - by Streetboat - 01-21-2012, 05:53 PM
RE: Give Prop Damage? - by Shadowfied - 01-21-2012, 06:04 PM
RE: Give Prop Damage? - by Your Computer - 01-21-2012, 06:17 PM
RE: Give Prop Damage? - by Your Computer - 01-21-2012, 05:59 PM
RE: Give Prop Damage? - by Streetboat - 01-21-2012, 07:11 PM
RE: Give Prop Damage? - by Shadowfied - 01-21-2012, 07:15 PM



Users browsing this thread: 1 Guest(s)