Home   Help Search Login Register  

Author Topic: Heal Action Script (ACCEPTED)  (Read 5006 times)

0 Members and 1 Guest are viewing this topic.

Offline norrin

  • Tutorial Writer
  • **
Heal Action Script (ACCEPTED)
« on: 29 Oct 2007, 10:05:32 »
Heal_action Script or Dr SNKMAN�s Incredible Snake Oil Elixir

Cures what ails ya!

Description
A script that allows players to heal themselves for a specified range of damage a settable number of times per respawn.

Features
1. Heal action only becomes available when the player's damage falls within a specified range.
2. Can set the number of times the heal action becomes available per respawn.
3.  The upper and lower bounds of the "self" heal range can be set by the mission maker.  Can mantain the importance of the Medics role by setting this to a fairly short range (ie. 0.1 - 0.5) therefore a medic is still critical to heal more severe damage.

To implement
1. Just copy across the code from the init.sqf file and copy the heal_sqf folder into your mission directory. 

2. Set the number of heals each player gets per spawn in the NORRN_no_of_heals variable of the init.sqf.

3. Set the upper and lower bounds of the heal range in the init.sqf ie. the amount of damage that you want players to be able to "self" heal.
eg.
Code: [Select]
NORRN_lower_bound_heal = 0.1;
NORRN_upper_bound_heal = 0.8;

4. Name all playable units in the editor eg. alpha_1

NB: If you are using the script for single player you do not need the description.ext file.

Test Mission
You're going to need two instances of ArmA running or two players to test this script.  Just shoot each other in the foot or leg (ie. do not kill the other player) and the heal option should become available in the action menu.

Limitations
A version of this script is already implemented in my revive_sqf scripts so please do not try to implement the stand alone Heal-action script with the revive scripts.  An older version of this script has been available on the BIS forums for some time see here: http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=d2ad4d0f08b92c5bd36759825ff1543a;act=ST;f=71;t=64470;hl=norrin

Tested
Ver 1.08 SP and MP with JIP.
« Last Edit: 18 Jan 2008, 20:27:24 by Loyalguard »

sinchi runa

  • Guest
Re: Heal Action Script
« Reply #1 on: 01 Nov 2007, 21:32:03 »
this script is awesome!!

thanks for making arma a little bit more fun.

 :good:

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: Heal Action Script
« Reply #2 on: 03 Nov 2007, 13:36:55 »
Can you make a single player version as well?

Offline norrin

  • Tutorial Writer
  • **
Re: Heal Action Script
« Reply #3 on: 03 Nov 2007, 22:41:32 »
I have to admit I haven't tried it but it probably would work in SP as well.  There's definitely more code than is needed as it deals with the possibility of the player respawning (which isn't going to happen in SP) but I think you could just specify the number of times a player gets the heal action during his single life in the NORRN_no_of_heals variable.

I'll test it anyway - if it does work do you want me to leave it as is or make a cut down version for SP?

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: Heal Action Script
« Reply #4 on: 04 Nov 2007, 14:01:56 »
its ok Norrin, if you add a SP version that's cool, if not I understand.  We can submit the original as MP or something.

Offline norrin

  • Tutorial Writer
  • **
Re: Heal Action Script
« Reply #5 on: 28 Nov 2007, 05:24:45 »
Hi Lee,

Sorry its taken me so long but I've finally tested the heal script in SP and it works well so I'm reluctant to change it.  The only thing you don't need of course are the respawn settings in the description.ext.  Let me know if this OK and I'll post a new version with implementation instructions (readMe.txt) in the zip file.

norrin

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: Heal Action Script (READY)
« Reply #6 on: 15 Dec 2007, 17:25:41 »
hey Norrin, sorry been swamped i'll try this out. i'm gonna have some time sunday for testing

Offline Loyalguard

  • Former Staff
  • ****
Re: Heal Action Script (TESTING)
« Reply #7 on: 17 Jan 2008, 02:06:19 »
Norrin-

I am going to start testing this tomorrow.

EDIT:

I was able to test this for about an hour tonight.  It worked without problems and I specifically tested different heal ranges and number of heals allowed with positive results.  I tried it in 1.08 and 1.09 in both SP (using team switch) and MP (multiple clients), hosted and dedicated.  Use resulted in similar performance across both those versions and modes.
« Last Edit: 18 Jan 2008, 01:45:32 by Loyalguard »

Offline Loyalguard

  • Former Staff
  • ****
Re: Heal Action Script (ACCEPTED)
« Reply #8 on: 18 Jan 2008, 20:30:15 »
This resource has been accepted and submitted to the Editors Depot.

Offline lonck

  • Members
  • *
Re: Heal Action Script (ACCEPTED)
« Reply #9 on: 02 Feb 2008, 17:29:33 »
I'm having problems installing this script.  I placed both folders I found in the zip in the missions folder in arma/Missions.  When I use editor (I haven't tested it in regular SP missions) and dmg myself with granade launcher I don't see the healing option.  I don't undersstand the author when he/she says "copy across".   What do I have to copy and where am I pasting it?  I haven't patched the game yet so maybe that's the problem?
« Last Edit: 02 Feb 2008, 17:34:48 by lonck »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Heal Action Script (ACCEPTED)
« Reply #10 on: 02 Feb 2008, 21:28:28 »
copy across there means you should pick up the code present in init.sqf demo mission and copy to your init.sqf in your mission:
Code: [Select]
/*
  INITIALISATION SCRIPT

******************************************************************************************************************************
Start init.sqf
*/

waitUntil {player == player};

//Number of heals that each player gets during a mission
//The damage level range between which the heal action becomes available
//=========================================================================================================================
NORRN_no_of_heals = 1;
NORRN_lower_bound_heal = 0.1;
NORRN_upper_bound_heal = 0.8;

//run script that creates all triggers required for the revive script
[] execVM "heal_sqf\trigger_mkr.sqf";

sleep 0.5;

//Variables required for onConnect script and triggers
onConnect = true;
PublicVariable "onConnect";

Offline lonck

  • Members
  • *
Re: Heal Action Script (ACCEPTED)
« Reply #11 on: 02 Feb 2008, 23:38:58 »
I don't have a ini.sqf in my mission folder.  Neither in arma/Missions nor in C:\Documents and Settings\Compy\My Documents\ArmA\Saved\missions

Offline Loyalguard

  • Former Staff
  • ****
Re: Heal Action Script (ACCEPTED)
« Reply #12 on: 02 Feb 2008, 23:49:43 »
If you don't have an init.sqf file already it is very easy to create one.

1. Create a new text document using notepad

2. Put in your mission folder ( \Documents\arma other profiles\yourname\missions)

3. re-name it init.sqf

4. Copy the code and paste it in the init.sqf

5. Now when you preview the mission in the editor (and later if you save it as a SP or MP mission) this code will run when the mission starts.

Good luck!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Heal Action Script (ACCEPTED)
« Reply #13 on: 03 Feb 2008, 00:02:59 »
Lets be absolutely clear about this:

The Missions folder in Arma root is NOT the folder where you have your Mission Editor creations stored, the missions in there are generally in PBO format.

The Mission Editor missions are stored in:

C:\Documents and Settings\WhateverUserNameYouUse\My Documents\ArmA Other Profiles\YourUserName\missions

The folders in here contain the mission.sqm for your saved Mission Editor mission.

For example, if you have a mission saved called MyScoobyMission, it will be in a folder of the same name.

What you need to do is take a copy of the init.sqf in question and put it INSIDE the relevant mission folder you want it to work for.
Same probably goes for any other files needed to make this work.

Just placing this init.sqf inside C:\Documents and Settings\WhateverUserNameYouUse\My Documents\ArmA Other Profiles\YourUserName\missions ........will do nothing, it needs to be inside the relevant mission folder you want it to apply to.


Planck
I know a little about a lot, and a lot about a little.