This tutorial goes out to everyone who has kept H2 modding alive for so long, and especially Ogrish!
Using a few values in the jpt and the matg, you can temporarily make players move more slowly, jump lower, jump higher, run faster, or even switch their controls around. SLC, too!
I found these values through raw experimentation, so I'm not sure what each one does or if they are all relevant.
In the jpt tag, look for two fields called Stun and Max Stun. Set these to somewhere between 0 and 1. I'm pretty sure Stun Time is meaningless here.
In the matg, look for the fields called Stun Penalty Movement, Stun Penalty Turning, and Stun Penalty Jumping. As you might assume, these values affect how fast you run, how fast you turn, and how high you jump, respectively. The Stun Penalty Min and Max times determine the lower and upper bound for how long the stun will last. If you set the values as I have done here, a player who is hit with the jpt above will be almost frozen for 3 seconds, unable to turn, jump or move much at all.
(For posterity, the actual values are 2.3, 1.9 and 1.8)
By experimenting with these values, you can achieve different effects. I think the values in the jpt are simply a scale multiplier for the values in the matg. If you make values in the matg negative, they will increase rather than decrease the player attribute. So a negative jump penalty will make a player jump higher, but only for 3 seconds or whatever you set the time value to.
If you want to have different time durations for different stun effects, you can make the duration very short, and attach the jpt to an effect which is part of a projectile. Then the projectile detonation time essentially controls the duration of the stun. You'll probably need to experiment with the duration of the effect so that it does not loop too fast and cause...
A weird artifact: If you set the Stun/Max Stun values to .9 or so, and put the jpt in a looping effect with a very short loop duration (for example, the sentinel charging effect), it causes the player's controls to reverse. Up becomes down, left becomes right, and forward becomes backward, for as long as the stun time lasts. I suspect this is because the stun effect is cumulative, so each repeat of the effect opposes your controls even more, until it wraps around in the opposite direction and can't go any farther. It always confuses people when it happens. Good for a laugh.
You could attach effects with different stun/boost properties to the jmads of the elite and chief so that they have different abilities for the same "power-ups." For example, attach a jump boosting jpt to the elite animation for overheating the plasma pistol, and set the pistol to overheat and expend all its energy on one shot. Then the power-up only works for the elite, can only be used once, and disappears when it is used and dropped.
I have a mod with some of these stun features built in. The frag grenade causes reversal of controls, and the dart from the corrupted mauler model causes stun. Feel free to experiment. Download here.
Stun, Freeze, Adrenaline, and Reversing Controls
- CaptainPoopface
- Posts: 714
- Joined: Sat Feb 16, 2008 5:47 am
- fuzzman
- Posts: 178
- Joined: Wed May 14, 2008 11:10 pm
Re: Stun, Freeze, Adrenaline, and Reversing Controls
Nice find! Tested this out, works perfectly!