Home   Help Search Login Register  

Author Topic: "Resting & Healing" script (ACCEPTED)  (Read 2147 times)

0 Members and 1 Guest are viewing this topic.

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
"Resting & Healing" script (ACCEPTED)
« on: 11 Jul 2007, 15:45:32 »
This "Resting & Healing" script uses what I call an "exploding trigger" to allow the player to skiptime for a few hours and heal if there are no enemies within 200 meters.  Its very simple but I haven't seen the idea around and thought it would be useful.

While this tool might not be necessary in short "Black Ops" style missions, it could be useful for longer missions (including mine) where the player might want to wait for cover of darkness or recover from light wounds.  Fans of the Elder Scrolls & Baldurs Gate games will recognize this feature.  The script can be easily be tweaked for the amount of time or healing you want.  The settrigger command would need to be changed if the player was OPFOR instead of BLUEFOR etc.

Sample mission attached:
« Last Edit: 01 Oct 2007, 15:52:08 by LeeHunt »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: "Resting & Healing" script
« Reply #1 on: 11 Jul 2007, 22:43:23 »
Nice idea  :clap:, and now some comments.
You are currently using a trigger that checks for EAST presence, but EAST may not be the enemy, you may be friendly to EAST being independent or you may be EAST. So I suggest you to play with findNearestEnemy and, if any, check that distance to player's vehicle is greater than 200m.

Not sure why you need _player = _this select 0, may be you can use simply "player". And you may check also that player is stopped, so the player cannot activate this when flying a Su34 over mach 1  ;)

You may also create a smoother time transition this way:
Code: [Select]
hint "Resting and healing..."

_i = 0
#skip
SkipTime 0.04
_i = _i + 1
~0.05
?_i < 96: goto "skip"

player setdammage 0

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: "Resting & Healing" script
« Reply #2 on: 11 Jul 2007, 22:59:07 »
Very good suggestions as always Mandoble  :)

I will fix later this week and post an updated version.  The player _this select 0 was leftover from when the script had more script lines involving the player.  Can get rid of that as you mentioned.  I was not aware of the findNearestEnemy command, that's a good one and makes for a much smoother script as well.  And I did forget about the player flying mach 1 in a jet lol!!!!   Not wise for our electronic pilots to be napping at mach 1....

thanks again Mandoble!