Jump to content
Sign in to follow this  
norrin

SQF revive script

Recommended Posts

The revive is not work with @Xenos "Domination".  banghead.gif

- not work with more as 10-15 Players.

- Lag by more Player joinings.

The old *.sqs vers. play better.   whistle.gif

Domination! One Team - Revive (2.22)

armaholic

I'm sorry to hear that m8.  Do you have a version of Domination with my revive that I can take a look at as it may be easily fixable.   If you do, can you please send it to norrin@iprimus.com.au as I may be able to help you fix it.

If not when I get a chance I'll try adding my revive to the latest vanilla version of the mission and send it to you for testing.  

The lag's not good but as most of the scripts are client sided so I've never known how many players it would take to slow things down significantly.  I have played revive missions with my clan with 12 players on a server, that's no racehorse mind you, with no noticable drop in fps and I have tested AI enabled missions with alot more units than that (all using the scripts) and they all seem to run pretty smoothly but as its impossible for me to properly stress test these scripts by myself I don't know their true limits and in the context of a mission like Domination with a lot of other stuff going on maybe you've found that limit.

If anybody sees this can they comment on their experience and server performance with player numbers or number of AI_units using the scripts?  

@Legislator - Will we never be rid of this infernal bug smile_o.gif  I was playing with my clan the other night (using an earlier version of the script) and was unit 8 in my group when all of a sudden about 30 minutes into the mission I become the group leader (I was still F8) in the group icons.  Silly thing was no one had died/revived or been in a vehicle up to this point so I'm starting to wonder whether it really just is one of the wierd and wonderful things about ArmA.

Share this post


Link to post
Share on other sites

I'm sorry to hear that m8. Do you have a version of Domination with my revive that I can take a look at as it may be easily fixable. If you do, can you please send it to norrin@iprimus.com.au as I may be able to help you fix it.

I completely deleted this version, because your revive script is causing a lot of trouble when a lot of players connect and disconnect. It ends in a "mega" lag. So I replaced it with an older sqs revive version which doesn't have that problems and works as expected.

If not when I get a chance I'll try adding my revive to the latest vanilla version of the mission and send it to you for testing.

The lag's not good but as most of the scripts are client sided so I've never known how many players it would take to slow things down significantly. I have played revive missions with my clan with 12 players on a server, that's no racehorse mind you, with no noticable drop in fps and I have tested AI enabled missions with alot more units than that (all using the scripts) and they all seem to run pretty smoothly but as its impossible for me to properly stress test these scripts by myself I don't know their true limits and in the context of a mission like Domination with a lot of other stuff going on maybe you've found that limit.

All I can tell you is that missions that use your revive scripts with let's say 10 - 15 players and no constant connects and disconnects of players are fine. And, Domination is optimized to not stress the server and the older sqs revive causes absolutely no troubles (or lags).

By looking at your scripts I guess it's just the way you handle things when a player connects. To much data needs to get processed everytime a new player joins. Every new client sends out publicVariable onConnected in revive_init which will activate the onConnect trigger on each client that is allready connected. Then all clients send out publicVariable connected which will activate the connected trigger... and so on. Now when a lot of clients connect after the game allready started it will cause trouble for the clients and the server. The clients and the server simply have problems then to synchronize the data that each client sends out (aka lag). Smaller missions with not much connects and disconnects may not have that troubles.

Greetings

Xeno

Share this post


Link to post
Share on other sites

Hi Xeno,

Thanks for the fast response and very useful info smile_o.gif

The guys over at the TOW tournament have told me that the waitUntil {player == player} command at the start of my init.sqf may be causing the problem you are describing as this condition is never satisfied on a dedicated server. Therefore when new players JIP the system can lag up completely. I'll try to find a work around for this, they have suggested something like this<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if ( (!isServer) && (player != player) ) then

{

waitUntil {player == player};

waitUntil {time > 10};

}; I'll look into it further though.

With the onConnect trigger my understanding was and I could well be wrong about this that each player only runs the code once when they join and then if another player jips only the joining player runs the scripts associated with the onConnect trigger. If this did not occur the players revive no etc would be reset everytime a new player joined the server.

On the otherhand the connected script does run for every existing player when a new player joins the server but really only to create a new instance of the revive for the new player but this as you suggest may be part of the problem.

Share this post


Link to post
Share on other sites

I think i have a missunderstanging tho lot of timers for now.

Because with my old setting we got the respawn Buttons direktly when all people Die.

We wait for the last one so he could also respawn (if others do it to fast he couldn´t get the button).

Now with the new version and old settings it seems a little bit different.

My settings should be:

1.) 900 seconds when no one revieved me to get the button.

2.) all dead --> imediatly Resp Button for all , or better for all after x seconds to get the last died teammate also in the "lucky group" :-)

Share this post


Link to post
Share on other sites

norrin, the waitUntil {player != player} isn't responsible for that kind of lags... (it wasn't in my init.sqf, I started it as a separate script, so only the server was waiting for something that would never happen ;-)).

But I've found a big bug in your connected.sqf script which gets executed on all clients if a new client connects:

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

revive_isplayer_old = [];

{call compile format ["if (isplayer %1) then {_revive_isplayer = _revive_isplayer + [%1]}", _x]}forEach NORRN_player_units;

revive_isplayer_old = _revive_isplayer;

publicVariable "revive_isplayer_old";

It is not possible in ArmA to send arrays with publicVariable over the network the way you do it here. It simply doesn't work.

You have to create a string from that array with the str command and on the receiver side you have to compile it back to an array.

Another thing is, why do you call the following line on each client each time a new client connects ?

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

{call compile format ["if (isplayer %1 && %1 != player) then {[_x,1] exec ""revive_sqf\weapons_respawn.sqs""}", _x]} forEach NORRN_player_units;

A client should be responsible only for "his" weapons and don't care about the weapons of other players.

Maybe there are more such things, but I do not have the time to take a closer look sad_o.gif

Greetings

Xeno

Share this post


Link to post
Share on other sites

Norrin. Is there any way to have the night vision working while in halo ? Just would be great for night jumps.

I have updated the mission and have posed it for testing so far seems ok.

not tested it with lots of players yet but i am sure it will be ok. Especially looking forward to your next version. maybe Xeno will give you some more help.

Mort. yay.gif

RSS MISSION Ver4R2

Share this post


Link to post
Share on other sites
norrin, the waitUntil {player != player} isn't responsible for that kind of lags... (it wasn't in my init.sqf, I started it as a separate script, so only the server was waiting for something that would never happen ;-)).

But I've found a big bug in your connected.sqf script which gets executed on all clients if a new client connects:

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

revive_isplayer_old = [];

{call compile format ["if (isplayer  %1) then {_revive_isplayer = _revive_isplayer + [%1]}", _x]}forEach NORRN_player_units;

revive_isplayer_old = _revive_isplayer;

publicVariable "revive_isplayer_old";

It is not possible in ArmA to send arrays with publicVariable over the network the way you do it here. It simply doesn't work.

You have to create a string from that array with the str command and on the receiver side you have to compile it back to an array.

Another thing is, why do you call the following line on each client each time a new client connects ?

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

{call compile format ["if (isplayer %1 && %1 != player) then {[_x,1] exec ""revive_sqf\weapons_respawn.sqs""}", _x]} forEach NORRN_player_units;

A client should be responsible only for "his" weapons and don't care about the weapons of other players.

Maybe there are more such things, but I do not have the time to take a closer look sad_o.gif

Greetings

Xeno

Thanks again for your help Xeno smile_o.gif

I didn't know about sending PV arrays over the network so I'll look into how many other errors like that I've made, as you suggest there could be several.

Since your post yesterday I've been looking through the forums including this thread trying to find ways to improve the performance of these scripts.

As for multiple initialisations of some of the client sided scripts, you're quite right and I've been slowly hunting through the various files trying to find mistakes like this - if you'd seen some of the previous versions you'd be horrified by the redundancy that I've eliminated so far, but there is still some way to go.

Anyway, after your comments I started rewriting the AI_disabled scripts so that only one instance of the script has to be run on the client's machine (not an instance on each client for each player connected) and this eliminates the need for almost all of the publicVariables when players connect (including the array you identified above).  The script has essentially the same features as before and its working but the revive addaction events still needs a bit of work.

@Morticus, once I get the new version of the script sorted I'll fix the NV prob. smile_o.gif

Share this post


Link to post
Share on other sites

Cool that would be great stuff.

Thanks I'll keep eye out for any other errors i encounter.

Mort

Share this post


Link to post
Share on other sites

WOW, 33 pages, and I got a bit lost...in my first endavor, I am trying to built a mission with vehicles, such as Tanks and choppers. The thing is, and I am sure this must have been addressed but I was lost through all the info, if all tanks and choppers are destroyed while the crew manages to escape, they are not considered as players from the script, and the mission ends as everybody is considered unconscious...multiplayer mission, that is.

Is there a way to work around this?

Share this post


Link to post
Share on other sites

Hi lion,

Long time no speak. How's the Hellenic mod going?  

There's a few options m8 regarding what happens when all players are unconscious.

You can set it up so that the mission ends if everyone is unconscious, or you can set a timer so that the players respawn at a marker after they've been unconscious for a certain time, or you can set up a dialog so that the unconscious players can choose from a number of different respawn points.

If you can hold off for a few more days please do as I've got a new version of the AI_disabled script in the works, almost completed just need to test it on a dedicated server, that hopefully fixes almost all the remaining bugs ie. performance, joining lag, unconscious invulnerability with mods and other scripts (yes even GPL2+ if anybody else reads this), follow the leader issues etc.

If you decide to use it and need a hand let me know what settings you want and send me the mission and I'll help you set it up.

Best wishes,

norrin

Share this post


Link to post
Share on other sites
Hi lion,

Long time no speak. How's the Hellenic mod going?  

There's a few options m8 regarding what happens when all players are unconscious.

You can set it up so that the mission ends if everyone is unconscious, or you can set a timer so that the players respawn at a marker after they've been unconscious for a certain time, or you can set up a dialog so that the unconscious players can choose from a number of different respawn points.

If you can hold off for a few more days please do as I've got a new version of the AI_disabled script in the works, almost completed just need to test it on a dedicated server, that hopefully fixes almost all the remaining bugs ie. performance, joining lag, unconscious invulnerability with mods and other scripts (yes even GPL2+ if anybody else reads this), follow the leader issues etc.

If you decide to use it and need a hand let me know what settings you want and send me the mission and I'll help you set it up.

Best wishes,

norrin

Hey norrin, the Mod is progressing, we are close to our second addon release, will keep you up to date.

Nice to know you 're still working on the script. just to let you know what issue I'm facing.

Following your instructions, I believe I need to give names to all my units and put then in the init for the script to work.

When I put a tank, an Abrams for instance, though this mission uses the Leopard 1A4 from our mod, I name this tank as "Tank1", so that it can be inserted in the init as mentioned before.

Problem is, there are 3 available slots in a tank, and you can choose between them at startup. Ingame, though, when the tank is about to blow up and you evac, the script acknowledges the destruction of the vehicle and does not care if ANY of the crew is alive, thus finishing the mission because all players are considered unconscious. Or I think it does anyway...

I do not know if vehicles are part of what you have in mind for the script, other than that it looks great, and I can't wait fort the improvements you mentioned...

Regards,

liongreek

Share this post


Link to post
Share on other sites

Bug report: AI Disabled 1.0k

There are still some error messages when I'm reviving and getting both killed (reviver + revived) during the reviving progress. The error message was shown to the killed "revived" only. I had no error message. That's why there's no picture this time wink_o.gif

Share this post


Link to post
Share on other sites

Ok last night we had some problems with an older version of AI Disabled. It's not one of my missions, but maybe you can use this message anyway, click me

And some problems with 1.0k sad_o.gif Again the NULL-Error, click me. This happened after I revived a player who crashed into the water.

And now the strangest thing ever ... during the game, we got a clone of one of our players! tounge2.gif We were 3 players. I don't know why and when this happended (maybe JIP?), but the player clone had the exact player name! It was treated like a civilian by the game (or maybe setcaptive?) Click me. The clone player could be observed in the camera, he fought along our side and respawned after a few seconds when he died. AI was disabled in the description.ext

Our players (and I too) don't like current anti-water code. There should be an option to get the respawn buttons as soon as you'll hit the water. There's nothing more annoying than swimming hours to the coast line sad_o.gif

Share this post


Link to post
Share on other sites

AI_Disabled Revive Update (version 1.1)

Following on from the comments of Xeno regarding the performance of these scripts in MP and the lag caused in long missions by multiple players leaving and joining the server I have completely rewritten these scripts from the ground up.

The latest version (1.1) is available here: http://home.iprimus.com.au/simonns....1.1.zip

The functionality of the previous versions has been maintained and in some instances improved.  I've tested it to the best of my ability and it seems to be working well but it now needs testing by the community.

Changes

*The big ones are hopefully a massive increase in optimisation (decrease in cpu load) and reduction in lag for JIP in long missions

*Only one instance of the script needs to be run on each client's PC (not one for each player as in previous versions).  This has allowed me to greatly reduce the number of public variables being defined when players join.  Importantly there will no longer be overlap between variables being publicly defined.  This also results in many less looping scripts on each client which should reduce cpu strain.

*Heaps of redundant code has been removed from the revive_player script and rest lengths have been increased in loops where possible.

*I've also removed 30 odd global variables by better coding using arrays and a number of looping scripts have also been removed as they have now been incorporated into the main revive_player script.

*The method for respawning and reviving units has been changed.  The respawn type is now "BASE" in the description.ext so the editor will need to define a Respawn_marker for their team as well as a Boot_Hill marker (preferably on the same island out of the action).

*The player being killed will not notice any change in the script however the other players will see a dead body for a few seconds before the unconscious player assumes the unconscious animation.

*These changes in revive method also have allowed me to permanently enable unconscious invincibility and this should no longer interfere with other scripts such as GPL2+.

*I've adapted some follow the leader code from a BIS post by ColonelSandersLite that appears to have fixed the follow-the-leader problem.

*The unconscious camera has now been enhanced and the unconscious player can now follow any friendly vehicle and switch between vehicles within the cam follow distance.

*Simplified the weapon respawn code as I discovered it was causing some null variable errors (maybe responsible for the latest one you've seen Legislator).

Other comments

Unfortunately, I won't be able to make all of these changes to the AI enabled scripts but I will certainly be bale to improve them immeasurably based on the latest version of the AI_disabled script

Anyway if you get a chance and you're interested please try this version and let me know what you think.

@liongreek - thanks for the explanation I understand the problem now.  With the revive scripts you'll need to create empty vehicles and the crew separately.  Then you'll need to name each crew member and include their name in the NORRN_player_units array.  Its best not to use the moveIN command with the crew members in their init lines in the editor because if some one joins in one of these slots after their vehicle has been destroyed it will cause an error.  You can run a script at start-up that will place the crew in their vehicles however (if you need help with this let me know).

@Legislator - thanks for the bug reports, I'm hoping many of these will be fixed with the completely revised version as in recoding I came across a few errors I hadn't seen before such as the null variable error in the weapon respawn script.  

I really like your idea for the respawn buttons for players killed in the water (been wondering how to deal with this) and will incorporate that option first chance I get.

Share this post


Link to post
Share on other sites

Norrin,

Your dedication to making gaming scripts is really appreciated by all of us that create missions.

Nice Work!

Vengeance(aka JAAF)

Share this post


Link to post
Share on other sites

Great work Man!

Lets test it live if it works with Grouplink2P....

pistols.gif

Question:

Quote[/b] ]*The method for respawning and reviving units has been changed. The respawn type is now "BASE" in the description.ext so the editor will need to define a Respawn_marker for their team as well as a Boot_Hill marker (preferably on the same island out of the action).

Does that mean, I need to place those 2 markers both away and somewhere on the map? Or do i need to place only Boot_Hill away but "BASE" in my Base?

Best Reagards, Christian

Share this post


Link to post
Share on other sites

Good kill norrin! I 'll test the new goodie as well as yr advice and report back

keep it up dude! notworthy.gif

Share this post


Link to post
Share on other sites
Question:
Quote[/b] ]*The method for respawning and reviving units has been changed.  The respawn type is now "BASE" in the description.ext so the editor will need to define a Respawn_marker for their team as well as a Boot_Hill marker (preferably on the same island out of the action).

Does that mean, I need to place those 2 markers both away and somewhere on the map? Or do i need to place only Boot_Hill away but "BASE" in my Base?

Thanks for the support guys smile_o.gif

As always make sure you send me any bug reports (and there could be a few seeing the code has been revised so much but I hope not) or ideas for new features.

If this version of the script works out OK I've got an idea I want to put you guys.  Would you like a version of the script where the players can only be revived by medics and they are still badly damaged when they are revived.  The just revived player would then need to get to a hospital or ambulance to be fully healed.  This would require a small addon, very kindly made by Dren. What do you think?  

@Christian - "Base" is the respawn type as defined in the description.ext file.  The marker you'll need to put on the map is the standard Respawn marker (ie. respawn_west if your playable troops are BLufor, respawn_east if you playable troops are OPFOR etc.) and yes best to place this marker away from the action where no one can see whats going on.  I really hope it works OK with GPL2+ now smile_o.gif

Share this post


Link to post
Share on other sites

hi norrin,

was playing some missions today that had older versions of your script. I've noticed some things:

1. Once i could not get revived and they had to shot me and revive me again

2. Another occassion they could not shot me and i had to reconnect

3. SOme other times i woudl revive someone but after the animation it would not be revived. Another player could revive him though

4. Sometimes a JIP player would register on the server as error. When u follow with the cam it looks like he is sliding prone...

any idea if these bugs are from the script or from the implementation of the script?

Share this post


Link to post
Share on other sites
hi norrin,

was playing some missions today that had older versions of your script. I've noticed some things:

1. Once i could not get revived and they had to shot me and revive me again

2. Another occassion they could not shot me and i had to reconnect

3. SOme other times i woudl revive someone but after the animation it would not be revived. Another player could revive him though

4. Sometimes a JIP player would register on the server as error. When u follow with the cam it looks like he is sliding prone...

any idea if these bugs are from the script or from the implementation of the script?

The question is how much older m8? smile_o.gif

I think its probably the older versions of the script as what you're describing are all issues that have cropped up in the past.

I know the thought of updating all the missions in the data base is quite daunting, but maybe any missions you find issues with you should flag and then when I get a chance I could update them with the new version of the script which I'm hoping will fix many if not all of these problems.

Share this post


Link to post
Share on other sites

it is quite daunting...:) and requires hours of testing...

another one..which i don't know if u have come accross...

if you die and you don't spectate but stay in your body then u can get revived but sometimes if u are specating revive might not work. Have you come accross of that?

sorry but only the last couple of weeks got back to gaming and my team mates have been playing for weeks as you know maps with your script...so they just gave me their feedback....:)

Share this post


Link to post
Share on other sites
it is quite daunting...:) and requires hours of testing...

another one..which i don't know if u have come accross...

if you die and you don't spectate but stay in your body then u can get revived but sometimes if u are specating revive might not work. Have you come accross of that?

sorry but only the last couple of weeks got back to gaming and my team mates have been playing for weeks as you know maps with your script...so they just gave me their feedback....:)

Yeah I have but in much earlier versions of the script. Its a problem with the camera not returning to the unconscious players view upon it being destroyed (ie. when a player is revived) and you get trapped in another player's view unable to move. It should have been fixed a few versions ago so please let me know if its occurring in a recent version of the script.

Share this post


Link to post
Share on other sites

New version sounds great!

With the amount of updates to the script you put forward, I have to wonder if you ever have time to play arma yourself!

Share this post


Link to post
Share on other sites

ok that's good....i'm playing the maps with the old version from timeghost.de....so they must been using a quite old one...

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  

×