Home   Help Search Login Register  

Author Topic: HULK_REV *BETA* - Slot based, mission-persistant revive script  (Read 8192 times)

0 Members and 1 Guest are viewing this topic.

Made for ArmA 1.14 (1.09 and up should be ok)


Introduction

Being a revive script, this replaces respawning/no respawning - a middle ground.
The main idea is to limit respawning to ensure some way to lose a mission yet prevent players from
having to wait until the mission ends when not using respawn.
The way this is accomplished is by using respawn, but remove control from the player and wait until
an ai or other player uses an action on the helpless unit.

The main difference between this and other revive scripts is in persistancy. This is explained below.
If a unit dies, his status (position, equipment, revive status and penalty status) is
sent to the server for safekeeping.
Your status will also be saved at random intervals and after being revived.

This means that there is no point in rejoining the server unless there are other units available
who are still conscious.
Another benefit is that clients who crash can rejoin without losing too much progress.

Another important detail - you can't stand after being revived, so make sure you include
a medic in the mission.


Implemented Features

- Saving of status (automatic: on death/revive and at random intervals)
- Spectating in first person while unconscious at any distance
- Compatible with multiple sides (everyone can revive each other, but not spectate or see status)
- Automatic ending of mission once all connected units are down (Using End6 trigger)
- Optional AI support (AI units cannot move after being killed, user can initiate ai assistance)
- Sliding down steep slopes if unable to stand
- Heavy reliance on medics (units being heavily wounded and unable to stand after being revived)
- Carrying players (Buggy at the moment)
- Optional permadeath
- Penalties after being revived a few times (get to a hospital to remove the penalties)
- Compatible with hosted games and dedicated server
- Expandable, dialog-based action system (for reviving if there is no action, loading units into or
  out of vehicles, ect)


Deliberately omitted features

- Respawning (for difficulty and teamplay reasons)
- Limited healing for units (reserved for medics to promote teamplay)
- Map markers (Aiming for solution without map clutter, possibly separate map dialog)
- Third person spectating options (exploitable, especially in pvp)


Planned Features

- Sounds (while waiting for revive, when randomly fainting etc)
- Dialog for checking nearby downed units, reviving when lack of action etc
- Invulnerability while unconscious
- Chance of dropping pistol/rifle magazine on revive
- Probably forgot something here


In-depth instructions

After biting the dust, you have the ability to spectate other allied revivable units.
To do this, click the units name in the list on the right.
You will then watch the world from that units perspective, and the distance and general direction
to your body will be displayed on the bottom of the screen.
To request ai assistance, doubleclick the text in the bottom right corner.

When coming across another unit in need of help, you should see an action "Revive <name>".
Use the action to revive the unit - this might take some time.
In case of viewblocking smoke, this action might not appear (working on backup solution).

After being revived 3 times, you will start suffering from occasional fainting.
The duration of the blackouts and the respite between each will respectively increase and decrease
every time you are revived (the default values are not set in stone, they are probably
way too evil - want feedback on this).

If on foot you will drop to the ground, if in a vehicle your screen will simply go dark and you will
not be able to control the vehicle for the duration of the blackout (try not to drive/fly).
When you start passing out, start looking for a field hospital.
Upon finding one, an action will be added to it, reading "Restore revives" - Use that to stop passing
out and get a new grace period of 3 revives.


Installation

- This revive system is based on unit names, so you'll have to name all your revivable units.
- Copy the HULK_REV folder to the root folder of your mission.
- Add the following to your init.sqf or init.sqs file:
   
Code: [Select]
[[unitname,unitname],["unitname","unitname"]] execVM "HULK_REV\run.sqf";- Ensure that all the units you want to be able to be revived are added to the array,
  unlisted players will not be able to play.
- The following settings are required in the description.ext:
Code: [Select]
   respawn = "INSTANT";
   respawndelay = 1;
   disabledai = 0; //optional
   #include "HULK_REV\config.cpp"
- Open HULK_REV\settings.sqf and set the sides parameter to match the mission settings.
- If you have vehicles or custom objects that should offer healing services, you can add the
  following in its init line to allow players to restore their revive count with it:
   
Code: [Select]
object addAction ["Restore revives", "HULK_REV\revive.sqf","TRUEHEAL"];- Add a debriefing entry for End6 in the mission briefing (for when all are down)


Known bugs

- Losing control of yourself after being revived by ai if spectating the reviver (not verified).
- Excessive friendly fire might prevent actions from showing.
- AI are not limited to crawling after being revived.


Credits

- My fellow IAST members for testing and suggestions, especially Delta38 and Zee
- Mandoble for his mando_angles and mando_getpos
- General Barron for the setPitchBank function
- Norrin for inspiring me revive script and some code in the cannot stand script
- The community in general


Changelog

0.71 Initial public version
0.72
   - Made the option to carry a player stay even after being healed
   - Fixed: the player would stand after dying if the ACE mod was used
   - Made slight adjustments to the login system
   - Removed unused picture overlay
   - Added event system for custom code execution
   - Added an expandable actions system through dialog (see feature list)
   - Added setting for limiting who can revive
   - Put the configuration file in a separate folder for simpler updates
0.73
   - When looking for units to load into or unload from vehicles, script will consider ACE unconsciousness as well
   - Passing out from trauma should happen less frequently
   - Rewrote the prone script, you now have a limited capacity for moving upright (Fixes bug where
     you're locked in between animations)
   - Changed weapon selection function slightly
   - Improved handling of changing ai locality
   - Added an option for using this new ai support in settings.sqf
   - Some adjustments related to changes in ACE 1.03 (local ruckmags and weapon on back)
   - Fixed a bug where any ai could revive you even though only medics could revive
   - Added lobby setting for choosing who can revive in the example mission
0.73B
   - Fixed error in weapon selection function if the player lacked a primary weapon
0.74
   - Fixed bug preventing you from loading units into or out of unnamed vehicles
   - Fixed bug with reviving inside vehicles
   - Fixed bug which caused you to never faint from trauma
   - Added eventhandler to prevent repeated deaths when waiting for revive
   - Fixed bug that made a carried unit appear sitting after being dropped for other clients
   - Fixed bug that prevented units from reviving at field hospitals when "Only medics revive unassisted" was selected
   - Added "Carry" action to Utilities menu
   - Added "Restore revives at hospital" action to utilities menu.
   - Added ability to use the dragging included in ACE (Utilities>Carry>Drag)
   - Changed rucks and ruckmags dropping on the ground to being kept on the unit
   - Unconscious units loaded into vehicles no longer use the standard cargo animation
   - If ACEMOD is active their dragging method is used by default
   - Added setting for disabling revive altogether
   - Removed player name in front of most status messages

Notes to testers:

The script has been mostly tested in hosted games with limited players (less than 6).
I also haven't tested the AI support much, as that's a relatively new addition to the script.
So if any of you are able to test more large-scale and see how the server handles, that would be great (especially with AI).
« Last Edit: 26 Apr 2009, 18:53:04 by HulkingUnicorn »

Offline norrin

  • Tutorial Writer
  • **
Hiya Hulk,

I think the "after being revived, you are lying on a small ledge or object you may be constantly standing
  up and lying down" bug relates to your rPrn function as I ran into the same problem when players were revived on slopes that were greater than a certain angle.  To fix this I added the slope function from the Warfare game type and used this in combination with some anti-slope code (see my script for implementation), this essentially moves an unconscious unit to a slightly flatter area so this doesn't happen.  Not sure if you're interested but alef also added some code to the rPrn that negated the need for players to drop rocket launchers as it prevented players from using them (see latest AI_disabled revive).

Good luck mate,

norrin

Hi mate, it's been a while :)

You are dead on, I've reused that function with just a few modifications.
I made my own anti-slope function (take a look at fSlp.sqf and feel free to laugh) which deals well with normal slopes, but dying on top of very low objects (artillery cannons, small stairs into buildings) isn't caught by it (so you won't slide down the tiniest hills).

I added some sort of check for that as well, but haven't been successful yet.
I'll take a look at your script to see if there's something that's easily fitted it.

Thank you for the tip!

Offline bluevein

  • Members
  • *
Hi, great revive script, If you don't mind I would like to impliment this into the City Life RPG mod?

64 MP so testing for you will be great and I'll ask them all to bug report here.

If go's to plan should have it in mission by the 4th/5th just let me know, cheers mate

EDIT

Sorry for dum question i take it in the init

[[S1,S2,S3,S4],["S1","S2","S3","S4"]] execVM "HULK_REV\run.sqf";

[[CAN BE REVIVED],["CAN REVIVE"]]?? befor i type out 64 player names  :good:
« Last Edit: 02 Jan 2009, 02:14:24 by bluevein »

I don't mind that at all, glad you like it and the feedback will be useful :)

That init line might have been better explained in the readme, I guess. You list the same units, just one with quotes and one without.
You might be able to survive with the first array empty, but the second is definately required.
I'll probably get around to fixing it to just require the second at some point, but I'm a bit afraid of breaking it ;)

Edit:
To be completely sure:
[[CAN BE REVIVED AND REVIVE],["CAN BE REVIVED AND REVIVE"]]
« Last Edit: 03 Jan 2009, 01:26:19 by HulkingUnicorn »

Offline bluevein

  • Members
  • *
ok mate got that,

1st feed back then

What would be nice is to add maybe a list of names that can revive, like only the medics can revive people.

I'm adding it as it is, as the EMT/Medic will be able to heal them so they can walk and the hospitals will have the addaction to reset the revive limit.

Cheers  :good:
« Last Edit: 03 Jan 2009, 02:10:33 by bluevein »

Duly noted ;)
Customization options are likely to come later, as I want the default behavior to fit the basic ideas - simple setup and not leading to FUBAR without everyone dying (although you will get close without any medics anyway).
That said I think you'll find the script pretty harsh even with "all revive" - keep those field hospitals around :D

Offline bluevein

  • Members
  • *
Here is a list so far from players on server:

1) Sometimes when you join a game you will get stuck on "waiting for status" hulk rev version 0.71 initializing please wait, to fix click esc and respawn. 80% of the time it does this.

2) After you have been revived by a EMT, if you start to move you get alot of spam telling you to get to med tent. Spam stops once click Heal at EMT that revived you

3) Sometimes there will be no heal at EMT action, its to busy telling you, you are injured. This can be fixed by the EMT carrying you, then the heal at EMT option appears.

4) But  If you know what ur doing and have mastered what need to be done  it works fine. The biggest shitter on that list is the joining server then having to respawn, then needing to crawl to the med tent, or calling another EMT/Medic if ones on.

Hope this helps mate, I'm loving it and has given us the edge we have been lookg for, for ages   :cool2:

I'll need a couple more details on these to figure out the issues.
Quote
1) Sometimes when you join a game you will get stuck on "waiting for status" hulk rev version 0.71 initializing please wait, to fix click esc and respawn. 80% of the time it does this.
Is this for Join In Progress, at mission start or both? How many are trying to connect and roughly how often does this happen?
How long have you tried waiting before respawning?
Quote
2) After you have been revived by a EMT, if you start to move you get alot of spam telling you to get to med tent. Spam stops once click Heal at EMT that revived you
Is it the "You are seriously wounded and can't stand!" and "Go see a medic!" messages you are referring to or the "Passing out from trauma - get to a field hospital" text?
Also, are they crawling or trying to walk/run? Is the terrain flat or steep? Indoors or outdoors?
If possible could you post screenshots of this for both the victim and from a bystanders point of view?
The third one seems related to number two, I suppose that one will be taken care of together with the second.
Quote
The biggest shitter on that list is the joining server then having to respawn, then needing to crawl to the med tent, or calling another EMT/Medic if ones on.
I'm currently not saving "leg damage" in the persistant system, so anyone who joins after the first minute of the mission get his legs gimped - will start saving that to make joining less annoying (do note that joining into a soldier which has been hurt earlier will still have you join in an injured state).

I'm working on a couple improvements to the script denying you to walk before healing, but I'll see if I can sneak in a little change for the "login" system in the same release.

Offline ModestNovice

  • Members
  • *
Thanks man. I'll try and get some screens. For me, it was Join In Progress. I joined as an EMT. And spawned in a random place (im assuming from someone who was previously playing and died then quit.). Then it said I had 3 revives left. Then kept spamming message 'You are seriously injured'... etc etc. By hitting Esc >> Respawn, this was fixed. I belive somewhat of it is caused by the players dieing, and joining another slot. But a few of the players mite have had the message spamming at mission start. I cant verify that though as I joined in progress both times I tested.

I will get more to you tomorrow with some screens.
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: HULK_REV *BETA* - Slot based, mission-persistant revive script
« Reply #10 on: 04 Jan 2009, 13:28:03 »
Impressive script. Are there some testing missions out there?   :clap: :good:

Re: HULK_REV *BETA* - Slot based, mission-persistant revive script
« Reply #11 on: 04 Jan 2009, 22:48:24 »
Well, I don't have any presentable missions lying around, but if my example mission doesn't cut it for testing purposes, you could very easily implement it in existing missions   :whistle:

Edit 18.01.2009:
New version available from first post!
Quote
0.72
   - Made the option to carry a player stay even after being healed
   - Fixed: the player would stand after dying if the ACE mod was used
   - Made slight adjustments to the login system
   - Removed unused picture overlay
   - Added event system for custom code execution
   - Added an expandable actions system through dialog (see feature list)
   - Added setting for limiting who can revive
   - Put the configuration file in a separate folder for simpler updates
« Last Edit: 22 Feb 2009, 00:44:35 by HulkingUnicorn »

Offline sharkattack

  • Former Staff
  • ****
Re: HULK_REV *BETA* - Slot based, mission-persistant revive script
« Reply #12 on: 25 Jan 2009, 15:58:20 »
very cool script ..

new features are awsome    :good:
"HOLY SARDINE" - see Shark-Attack meet his match

Re: HULK_REV *BETA* - Slot based, mission-persistant revive script
« Reply #13 on: 21 Feb 2009, 21:34:17 »
Finally, a new version! (see first post)

One of the most important improvements (imo) is the new prone script, as you won't have to fear dying on top of ammo crates and similar objects anymore.
You basically have a few seconds of movement before being dropped on the ground, the available pain tolerance and recovery rate is subject to change.

Quote
0.73
   - When looking for units to load into or unload from vehicles, script will consider
     ACE unconsciousness as well
   - Passing out from trauma should happen less frequently
   - Rewrote the prone script, you now have a limited capacity for moving upright (Fixes bug where
     you're locked in between animations)
   - Changed weapon selection function slightly
   - Improved handling of changing ai locality
   - Added an option for using this new ai support in settings.sqf
   - Some adjustments related to changes in ACE 1.03 (local ruckmags and weapon on back)
   - Fixed a bug where any ai could revive you even though only medics could revive
   - Added lobby setting for choosing who can revive in the example mission
Note to those not using ACE: No problem! Despite the ACE stuff in the changes, vanilla ArmA is supported out of the box  ;)
« Last Edit: 22 Feb 2009, 00:46:03 by HulkingUnicorn »

Re: HULK_REV *BETA* - Slot based, mission-persistant revive script
« Reply #14 on: 01 Mar 2009, 16:10:28 »
A small update this time, discovered and fixed a bug where you'd get a nasty error if not carrying a primary weapon on revive/joining.
Quote
0.73B
   - Fixed error in weapon selection function if the player lacked a primary weapon
Download from the first post, as usual.