I've been playing around with the scripts a LOT lately
and came up with a neat idea. More than likely it's been suggested before but just in case it hasn't here goes. :beat:
One of the neat things that you can do with scripts is continuously record the value of some variable (say - health, ammo, velocity, player position etc) and with the appropriate delay set up a check for any change in that variable. Then all you have to do is code in a subroutine that only works when a specified change occurs.
For example - how about this (all coding in outline form only) -
#loop
<_CurrentHealth = players health>
~0.3
<if _CurrentHealth >= player's health then goto "loop"
; note - the short delay means that if the player is wounded in the interim then the "event handler", below, kicks in
<force the player prone>
<disable player controls>
<play sound "Splurcch">
<titlecut "BLACK OUT", 0.5 / titlecut "BLACK IN", 10>
<enable players controls>
goto "loop"
What this script will do is that any time a player character takes damage he will be forced prone and blacked out for about 10 seconds. You can tweak the script so that the damage taken by the player must be above a certain amount (say, _CurrentHealth - dammage player > 0.3) for the effect to kick in so that only "big" hits will incapacitate the player.
Once the player comes to he will be able to continue the fight. And of course the added sound effect can be anything that you want it to be (cries for help, mother, sickening squishy effects etc).
Or how about this. Same as above, but at the start of the script set a variable (say) _HasLimp to FALSE
Then , if the player takes a HIGH amount of damage (so that say _CurrentHealth - dammage player > 0.3) then the script will do all of the above PLUS -
_HasLimp = True
; the following will be added to the start of the loop, above
<getDir Player>
< if velocity player > 0 && _HasLimp = TRUE then change player direction (L or R) by a small amount>
What this will do is "pull" the character to one side every time he moves. To compensate the player will have to move slowly and keep changing direction to the opposite side of the pull. In other words - "limp"
Other ideas.
Now that the principle has been defined (set script to check for a change to a variable) the possibilities are endless. Try these -
You could set a script that checks the players ammo so that every time a bullet is fired (change in ammo held) your own sound effect is played on top of the existing sound. Might get messy or even add lag but if timed right you should be able to beef up the firing sound of any weapon.
You could set a script so that once a vehicle's speed goes above a certain point a warning tone sounds. Or play a warning sound only if an aircraft's velocity is above a certain limit DOWN, while the vehicle is below a certain height ("Pull up ! BEEP BEEP ! Pull up ! BEEP BEEP !").
You could check a vehicles damage and velocity, and if you try to drive a heavily damaged vehicle then it will either a) periodically fail to start, b) make a terrible noise, c) emit smoke, d) pull to one side (see "Limp", above"), e) stutter in speed, f) blow up (not literally - just make smoke and/or burst into flame and set damage to 1).
That's about it for now. This idea may be too generic to be of much use but I just thought that I should share it just in case it hadn't been done.
I was working on adding customised respawns and customised graphic damage to a scenario (random factor each tme player is hit - black out, limp, hands go shaky, character goes dizzy etc) and I realised that this concept can be generalised to change the in game effect of just about anything (within reason).
Comments, suggestions . . . ?
;D
:-X :-\