Jump to content
Sign in to follow this  
norrin

SQF revive script

Recommended Posts

That's good to know as the first line of my onconnect script is <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if(local player) then and the fact that the player var was not initialising instantly may explain why the scripts were not always firing for players joining in progress in ver 1.05.

Share this post


Link to post
Share on other sites

@MCPXXL, here's a revised version of the AI_disabled scripts I posted a couple of days ago.  You can now specify two sides that prevent players from respawning at spawn points.

Here's the explanation of the new variables that have been added to the init.sqf taken from the readme file

"E. This next section allows you to specify the number of enemy teams ie. no_enemy_teams var (up to 2) in your mission and will affect the ability of players to respawn at the no_respawn_points specified in section C.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//No of Enemy sides (0, 1 or 2). Enemy sides can be "EAST","WEST","GUER" etc

no_enemy_sides = 2;

enemy_side_1 = "EAST";

enemy_side_2 = "GUER";

For the no_enemy_sides variable: a “0†signifies that you do not want to prevent players from spawning at any of the spawn points; a “1†that units from enemy_side_1 will prevent players from respawning at a spawn point if a side 1 unit is within 50 metres of the spawn point; and a “2†signifies that if units from either sides 1 or 2 are within a 50 meter radius of the spawn point it will prevent players from respawning there."

There's been changes to the init.sqf, respawn_at_base.sqf, trigger_mkr.sqf and revive_player.sqf but its probably safest to replace all the exist files with the ones in the zip just in case I've forgotten something.

Share this post


Link to post
Share on other sites

Hi Norrin

New Version is implemented

Here is a new wish

Would you be so kind and show the name of the Player in Camera View ?

And if all playes are dead could an option be fine to shorten the respawn timer for the Buttons.

When you heal a teammate showing the number of healings to next bonus would also be fine

Share this post


Link to post
Share on other sites

Got one prob this night while testing

Two soldiers ly to near on together to heal from another...nothing happends.

He was one JIP healer so i sayed this seems to be a JIP Bug.

But later on he could heal everyone from team so it should be not a JIP Bug.

Share this post


Link to post
Share on other sites
Got one prob this night while testing

Two soldiers ly to near on together to heal from another...nothing happends.

He was one JIP healer so i sayed this seems to be a JIP Bug.

But later on he could heal everyone from team so it should be not a JIP Bug.

I'm not 100% sure of what you're saying MCPXXL.  The script is currently designed to detect the animation of the nearest friendly unit next to the unconious player.  If the nearest friendly unit is unconcious or dead then its impossible to revive that player ie. if two unconcious units are lying across or right next to each other.  Is this what happened ? If it is I can probably fix it fairly easily.  I'll also start working on the other stuff you're after and get something posted in the next few days.

Share this post


Link to post
Share on other sites

Yes that was what i mean they were lying direct both on earth together in one place.

Sorry sometime my old school english is too bad to explain it correctly.

Share this post


Link to post
Share on other sites

Hey norrin,

so far the script look's pretty good. smile_o.gif

Some thing's i note:

1. onConnected.sqf you have this line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleText ["Joining Mission", "BLACK", 0.3];

Wouldn't it be better to use:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleText ["Joining Mission", "BLACK FADED", 0.3];

Becouse with your way you have a look at the mission for 1 sec. then it goes black with the other way you have a black screen from the first secound.

2. I really pay much attention to have a clean init.sqs/.sqf and description.ext

So may could you link the options:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">/*

INITIALISATION SCRIPT

******************************************************************************************

************************************

Start init.sqf

*/

//Init.sqf settings for revive_player scripts by norrin

//Configurable revive script options (Off = 0, On = 1)

mission_end_function = 0;

reward_function = 1;

team_kill_function = 1;

//list of playable units - change to reflect the names used in mission

player_units = ["alpha_1","alpha_2","alpha_3","alpha_4"];

// no of respawn points and spawn position names for respawn

no_respawn_points = 3;

Base_1 = "West_spawn_1";

Base_2 = "West_spawn_2";

Base_3 = "West_spawn_3";

Base_4 = "";

//This variable can be changed if for example you only one sort of unit to be able to revive or

//you want to use these scripts for a different side

can_revive = "soldierWB";

can_be_revived = "soldierWB";

//No of Enemy sides (0, 1 or 2). Enemy sides can be "EAST","WEST","GUER" etc

no_enemy_sides = 2;

enemy_side_1 = "EAST";

enemy_side_2 = "GUER";

//Maximum number of revives per unit - adjust to whatever value you like

max_respawns = 2;

//Time until respawn button appears (0 = approx. 12 seconds)

respawn_button_timer = 0;

//Number fo the revives required for bonus

revives_required = 2;

//Number of teamkills before punishment

no_team_kills = 2;

//run script that creates all triggers required for the revive script

call{[] execVM "revive_sqf\trigger_mkr.sqf"};

sleep 0.5;

//Variables required for onConnect script and triggers

onConnect = true;

PublicVariable "onConnect";

no_base_1 = false;

no_base_2 = false;

no_base_3 = false;

no_base_4 = false;

no_base_1b = false;

no_base_2b = false;

no_base_3b = false;

no_base_4b = false;

to another script in the folder "revive.sqf" so that you have the option's script maybee called "revive_options.sqf inside of "revive.sqf" and call it somewhere in the revive script at the very first beginning.

So far really impressive work norrin. thumbs-up.gif

Share this post


Link to post
Share on other sites

@MCPXXL I gotta tell you your English is a hell of a lot better than my German. All I can remember from school is "Hier kommt der strassenbahn" - why that's stuck in my mind I can't tell you smile_o.gif

@SNKMAN Thanks for the suggestions m8 I'll look into setting something up like this over the next couple of days.

Share this post


Link to post
Share on other sites

I've hopefully implemented all of MCPXXL's latest ideas now. smile_o.gif

You can download the latest version of the AI_disabled revive script from: here (19th June 2007)

New features and changes:

• Fixed the unconscious on dead unit bug - you can now revive units even if they are directly on top of dead bodies or other unconscious units

• The mission maker can now set the amount of time before JIP players can access the respawn dialog when they first join the mission. This option can be toggled on or off in the init.sqf

• The respawn dialog now appears immediately if all players are unconscious

• The unconscious camera now shows the name of the player it is currently following

• If using the revive/reward function the player is prompted how many revives he needs to perform before he receives his/her next extra life.

• Fixed a couple more bugs with the camera

• Changes to the joining mission screen as suggested by SNKMAN and removed some of the unnecessary text from the init.sqf

• Also included waitUntil {player == player} at start of init.sqf as I have found that if my server is very over worked some joining players did not initialise the revive scripts and this code seems to have fixed the problem - I wonder whether the player is now defined immediately in 1.08 unless the server is really taxed.

NB: Please make sure you read the implementation notes and the initialisation script readme, which you can find in the zip file, before using these scripts.

Share this post


Link to post
Share on other sites

WOOOW !

I will inform you imediatly after testing

Share this post


Link to post
Share on other sites

@HulkingUnicorn

I've finally updated the AI_enabled version of the script with some but not all of the new options. You can get it from: here

There's a number of changes but the main ones are:

1. now all the triggers necessary to run these scripts are auto-created by the script so you'll need to delete onConnected and missionEnd triggers you've created in the editor if you're updating an old mission.

2. Any changes you need to make to the script are now made through the init.sqf. Make sure you read the initialisation script readme in the zip file so you now what the options are and how you to configure the new variables.

3. You can specify upto 4 respawn points for unconcious players, these only become available if there are no enemies (upto 2 enemy teams can be specified in the init.sqf) within a 50 meter radius.

4. The mission maker can now specify how long a unit must be unconcious before the respawn dialog becomes available (0 = approx 12 seconds).

5. The mission maker now has the option of allowing JIP players to spawn at the respawn points upon joining the game (the time before this option is enabled can also be set in the init.sqf)

6. The unconcious camera now tells the player who it is following

There's also quite a few improvements/fixes to the camera and other files.

I haven't allowed the mission maker to specify how many revives a player can have before it is dead outright cause we both know what happened the last time we tried to do this with the AI_enabled script. crazy_o.gifbanghead.gifsmile_o.gif

Bugs: for some reason the playable AI doesn't always revive downed team mates - this has been a long term problem with this script.

Share this post


Link to post
Share on other sites

We could only do a short test but there were no errors found so far.

The only thing is that i do not get the 4th Resp Button, but i think it comes from my description because there are other resources defined for Action-Hud etc.

Share this post


Link to post
Share on other sites

Hey norrin,

Last few day's i played with your Revive Respawn and i really have to say AWESOME!! wink_o.gif

I have some thinks you may like to think about:

First i didn't understand what does the Markers do in the script but now i have to say it's an excellent idea. smile_o.gif

So here's what i was thinking about:

If you are dead and waiting to be revived you can push the buttons, which location you would like to restart.

May you can do something, that the buttons only appere if there are all units of the group are dead or if there is no one in range > 200 to the unit which should be revived.

Another thing:

In the init.sqf you have: respawn_button_timer = 12;

12 is this in secound's or what? i changed it to 60 but the buttons apperes directly after i was killed.

May you could also give some colors to the buttons blue or red or something grey look's a bit boring.

AWESOME Revive script! Keep it up norrin. thumbs-up.gif

Share this post


Link to post
Share on other sites

Firstly, thanks for all your help with testing guys, dare I say it but it sounds like we are very close to a finished product. I can think of one more thing I'd like to change and thats to change the way the respawn markers are coded as there's a bug there that no one has found yet. smile_o.gif

Another thing:

In the init.sqf you have: respawn_button_timer = 12;

12 is this in secound's or what? i changed it to 60 but the buttons apperes directly after i was killed.

@SNK, yep its 12 seconds. The respawn buttons are currently coded so that if all the players are unconcious the buttons automatically appear. Are you the only one on the server or are all the other players unconcious as well when this happens? I like your other ideas as well so I'll look into adding them to the options.

EDIT: Just thought about this more you can make the respawn buttons appear only when a player is dead by setting the respawn button timer to an enormous number like 100000 which should give 27 hours before it appears if the other players are still alive.

Share this post


Link to post
Share on other sites
@MCPXXL I gotta tell you your English is a hell of a lot better than my German.  All I can remember from school is "Hier kommt der strassenbahn"  - why that's stuck in my mind I can't tell you smile_o.gif

Thats not bad but the correct sentence reads as follows...

"Hier kommt die Straßenbahn."

Share this post


Link to post
Share on other sites
@MCPXXL I gotta tell you your English is a hell of a lot better than my German. All I can remember from school is "Hier kommt der strassenbahn" - why that's stuck in my mind I can't tell you smile_o.gif

Thats not bad but the correct sentence reads as follows...

"Hier kommt die Straßenbahn."

Ahh, that explains why I never did very well at school - see I told you my German was awful smile_o.gifsmile_o.gif

Share this post


Link to post
Share on other sites

OK, a dumb question, and forgive the ignorance...if you're using addon soldiers, does that mean that you have to put their class name to the can_revive/be revived class? Though it seemed to be working, I cannot revive my mates. I just stand over them, watch the whole madic scenne, but they remain dead.

It's probably something else I am doing wrong, but I am kinda wet behind the ears on this stuff so please bear with me...

Share this post


Link to post
Share on other sites
_Liongreek @ June 21 2007,13:39)]OK, a dumb question, and forgive the ignorance...if you're using addon soldiers, does that mean that you have to put their class name to the can_revive/be revived class? Though it seemed to be working, I cannot revive my mates. I just stand over them, watch the whole madic scenne, but they remain dead.

It's probably something else I am doing wrong, but I am kinda wet behind the ears on this stuff so please bear with me...

M8 send me a link to your mission or email it to me at norrin@iprimus.com.au and I'll take a look at it.

Share this post


Link to post
Share on other sites

Hopefully the penultimate beta release of the revive scripts are available from here. (22nd June 2007)

This zip contains the files, instructions and test missions for the:

1. AI_enabled;

2. AI_disabled; and

3. the medic only AI_disabled scripts.

Changes

* Re-coded the way the respawn points work to remove the potential for bugs

* Added an option to switch off the automatic appearance of the respawn dialog if all player units are unconscious.

* Added nearest_teammate_dialog option which measures the distance between the unconscious unit and the nearest friendly unit. If the distance set by the mission maker is exceeded the respawn dialog automatically appears.

This zip contains the files for the AI_enabled and AI_disabled and the medic only AI_disabled scripts.

If there aren't any bugs found with the latest versions or major changes suggested I'll write up a post explaining all the features add a few pics maybe make another video and declare this as a release. Hopefully I can then start working on something else, any suggestions?

As always please make sure you read the implementation notes and the initialisation script readme for the appropriate script set, which you can find in the subfolders in the zip file, before using these scripts. The initialisation script readme explains the options that are available and how to set them up

PS: Damn I've just thought of a better way to setup the nearest team mate option, see how you go and let me know if you're unhappy with its current implementation.

@LionGreek I've had a look through the mission you sent me and unfortunately I don't have all the addons you've used (I am missing the Turkish army and something called grm_recce) so I haven't been able to set the mission up for you. I did disable these addons and added the scripts and everything seemed to be working well using the latest version of the AI_enabled script. If you can get me the other addons I'm still happy to set this up for you but you need to send me links to the addons and also look at the initialisation script readme that comes with the AI_enabled scripts and tell me what options you want to use.

Share this post


Link to post
Share on other sites

One thing is there to implement as option...

In our old respawn we had NO DEAD Marker but the wounded soldier shouts every x seconds random woundet sounds like "need medic" or "ouccccccccccch" or something else.

1.) So it would be fine to have an option to disable dead_marker.

2.) To get this shout sounds every x seconds.

It was really funny to search the "Lone Wolfes" that are away from the group playing Rambo... when they did not look at their position they had to wait.

Now we have the wait and then respawn , but i will set it to

10 or more minutes.

The shout sounds could be nubered so you could use a random number combining its varname.

helpsoundtimer= 30 (30 seconds between helpsounds)

helpsounds=20 (random sounds from "Help0" - "Help19) as sample.

Share this post


Link to post
Share on other sites

I reluctantly agree this is a good idea m8 - will I never be free of this script smile_o.gif.  

Its easy enough to make the unconcious markers optional but I'll need to do some research on the sound option.  You know you run the risk of the unconcious players all having thick Australian accents and saying things like "bugger me I'm hit." smile_o.gif

I 'spose I should set the follow cam as an option as well.  

One final thing with the distance to the nearest friendly/respawn dialog option would it be best if this worked on the principle of nearest friendly who can revive?

Share this post


Link to post
Share on other sites

I've been dearly and enthusiastically awaiting something like this, but could you tell me the specifics on how it works? Here's the picture I get:

Say... Two BLUFOR troopers are advancing up a street littered with corpses, smoking vehicle wrecks and such. Their mission is to create a distraction while their teammates flank from a back alley. The first squints through the smoke and identifies a soldier taking aim at him but has no time to raise his weapon aand is shot in the head and dies instantly. The second soldier is shredded by the hail of gunfire but sustained shots only on arms/legs/not-critical-areas. He hits the deck screaming for a medic, and lo and behold, cover fire erupts from downrange and surpresses the enemy position. A paramedic quickly rushes over to aid the wounded amn out in the middle of the street. He pulls the body over to within the cover of a dumpster and begins work. It is too late for the mans partner. After a while of bandaging etc. The soldier picks up his rifle and is combat-ready again.

/end anecdote

Either way, I don't think it would be very logical for a soldier to survive being blown up with an armor piercing RPG round while inside a vehicle, as i'm not sure that there would be much left to heal. I think it would be better served if it worked sortof like Battlefield 2. Headshots kill everytime while body/arm shots... It depends.

Awesome script BTW, I could never do anything like that. I look forward to trying it out upon purchase of my new computer.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×