Jump to content
Sign in to follow this  
despi

Best/working revive script for Zeus/dev branch

Recommended Posts

Any of you guys have a good working revive script for ZGM? I've tried =BTC= and A3 Wounding System but don't seem to get either of those to work properly with Zeus. BTC spawns people outside the map with the respawn menu toggled on, and A3 seemed to work earlier but the revive part has not worked since the last dev branch update.

Share this post


Link to post
Share on other sites

I've tried Farooq's Revive which does revive, but the player icons (red circle) don't show up to Zeus, so you have no idea where the units are.

Share this post


Link to post
Share on other sites

I don't understand why people use revive scripts in Zeus as there already is the very good respawn system, if Zeus is a little bit careful! I was on a server yesterday that had this system, I really disliked it! Zeus only put one respawn point and didn't care anymore afterwards...

Share this post


Link to post
Share on other sites

revive =/= respawn

I want my players to try to revive their comrades instead of just respawn if it's convenient.

That's the reason I'm currently implementing Farooq's Revive as well, but I actually haven't had the chance yet to test it on a living subject...

Share this post


Link to post
Share on other sites
I've tried Farooq's Revive which does revive, but the player icons (red circle) don't show up to Zeus, so you have no idea where the units are.

FRQ does seem to do the trick, thanks. Didn't get to test it from the Zeus' point of view but I think I can live with the idea of not seeing the players as long as I make the missions for friends only.

Share this post


Link to post
Share on other sites
FRQ does seem to do the trick, thanks. Didn't get to test it from the Zeus' point of view but I think I can live with the idea of not seeing the players as long as I make the missions for friends only.

No problem, I have no idea why it doesn't show the player idents though. I must research this further :confused:.

Share this post


Link to post
Share on other sites

Maybe

while {true} do {
{ 
       if (side _x == west) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       }; 
	if (side _x == east) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       }; 
	if (side _x == independent) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };
	if (side _x == civilian) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };		
   }foreach allUnits;

in your init.sqf will do the trick. "master" of course is the name of your Gamemaster-module. Not the name of it's owner, the name of the module itself.

That way not only the players will always be editable by Zeus, all other editor and script placed units should be editable, if I'm not mistaken.

If you want a certain side not to be controlled by Zeus, just remove them.

Edited by Pergor

Share this post


Link to post
Share on other sites
Maybe

while {true} do {
{ 
       if (side _x == west) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       }; 
	if (side _x == east) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       }; 
	if (side _x == independent) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };
	if (side _x == civilian) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };		
   }foreach allUnits;

in your init.sqf will do the trick. "master" of course is the name of your Gamemaster-module. Not the name of it's owner, the name of the module itself.

That way not only the players will always be editable by Zeus, all other editor and script placed units should be editable, if I'm not mistaken.

If you want a certain side not to be controlled by Zeus, just remove them.

That would have been awesome, but at least I didn't get it to work.

Share this post


Link to post
Share on other sites
That would have been awesome, but at least I didn't get it to work.

Make sure that you replace the "master" in this snippet with whatever name you assign to your Gamemaster-module. You have to give your Gamemaster-module a name of course.

Share this post


Link to post
Share on other sites
Make sure that you replace the "master" in this snippet with whatever name you assign to your Gamemaster-module. You have to give your Gamemaster-module a name of course.

Yeah I did, got no errors or anything. Just didn't notice any difference.

Can anyone confirm if this works with Farooq's revive or am I just hopeless? Does the order of the lines in the init.sqf make any difference perhaps?

Share this post


Link to post
Share on other sites

I tried something similar to Pergor's script and it still didn't work for me. That script only gets called at the start, right? So when people join after/respawn it doesn't run again, or am I wrong?

Share this post


Link to post
Share on other sites
I tried something similar to Pergor's script and it still didn't work for me. That script only gets called at the start, right? So when people join after/respawn it doesn't run again, or am I wrong?

Well for me it didn't even work with units placed in the editor that I didn't sync with the editable objects module. At least that should have worked I guess.

Share this post


Link to post
Share on other sites
I tried something similar to Pergor's script and it still didn't work for me. That script only gets called at the start, right? So when people join after/respawn it doesn't run again, or am I wrong?

No, it doesn't. It's a loop. Everytime something is being spawned, either bei script, by respawn or any other way, it will be added to the editable objects with that.

Well for me it didn't even work with units placed in the editor that I didn't sync with the editable objects module. At least that should have worked I guess.

Yes, it should have. It works perfectly fine on my end. So either you haven't assigned the right names in the gamemaster module (not the owner's name, not the "custom name displayed for other players"-field - No, it's the "Name" field at top of the Zeus - Game Master-module), the right name of your gamemaster unit or you haven't placed my snippet in your init.sqf or you have overlooked any errors in your init.sqf.

The editable objects module is not necessary with this, as long as the objects you want to become editable belong to one of the 4 sides (ammoboxes and empty vehicles don't count for example).

Make a clear try with an empty map: place a unit, give it the name "p1", place the Gameplay Modes/Gamemaster module, place the Zeus/Gamemaster module, add the name "master" to the top line ("Name") of the Zeus/Gamemaster module, add the name of the unit "p1" to the "Owner" field of the Zeus/Gamemaster module, sync those two modules, save the mission, create a init.sqf in the mission folder, put my snippet in there and try it out.

Share this post


Link to post
Share on other sites

Make a clear try with an empty map: place a unit, give it the name "p1", place the Gameplay Modes/Gamemaster module, place the Zeus/Gamemaster module, add the name "master" to the top line ("Name") of the Zeus/Gamemaster module, add the name of the unit "p1" to the "Owner" field of the Zeus/Gamemaster module, sync those two modules, save the mission, create a init.sqf in the mission folder, put my snippet in there and try it out.

I would love to say it worked but still no luck. Did exactly as you said. Empty map, one rifleman named p1 as player. Added Gameplay modes: Game master module (did nothing for this) and Zeus: Game master module which I named as a "master" to the top line and gave ownership to p1. And finally made the init.sqf with your while-loop. Then added one ai controlled unit and hit preview and he was not editable when switching to Zeus from the rifleman.

Please don't give up on me Pergor, getting this to work would be awesome not just only for me :D

Share this post


Link to post
Share on other sites
Please don't give up on me Pergor, getting this to work would be awesome not just only for me :D

How could I? Especially after I found out that the one option I neglected earlier was the one that was the reason why it didn't work for you: I've made a mistake myself. :D

while {true} do {
{ 
       if (side _x == west) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       }; 
	if (side _x == east) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       }; 
	if (side _x == independent) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };
	if (side _x == civilian) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };		
   }foreach allUnits;
};

I've forgotten to put the last brackets in. So the error was indeed on my end. ;)

Now it should work perfectly fine, I've checked it again.

I found one problem though: It's possible that this does not work on players in every case. If the players are part of the side "enemy" (if they're really blood thirsty) you have to add this:

		if (side _x == enemy) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };	

Additionally: Disabling the curatability (is that even a word? #edit: I found out, it is indeed a real word) is easily done by putting // in front of one of the lines, like:

		if (side _x == civilian) then  
       { 
			//master addCuratorEditableObjects [[_x],true];
       };	

That's especially important if you're running something like TPWCIV, that spawns quite a lot of civilians with 15 waypoints each.

Share this post


Link to post
Share on other sites

		if (side _x == enemy) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };	

That throws up an error. Undefined variable "enemy".

Share this post


Link to post
Share on other sites
That throws up an error. Undefined variable "enemy".

Yeah... I think it's no longer "enemy", but rather "sideEnemy":

		if (side _x == sideEnemy) then  
       { 
			master addCuratorEditableObjects [[_x],true];
       };

Edited by Pergor

Share this post


Link to post
Share on other sites

The other part of the script works perfectly, I had to place your lines below the call for Farooq's otherwise the revive wouldn't work.

I haven't tried the sideEnemy yet, I'll do that tomorrow. You are a lifesaver. One funny thing though, some of the NPC's have a yellow icon instead of red/green respective. Does that mean the NPC's are using the revive too? Their health/armor slider was all the way down.

Share this post


Link to post
Share on other sites
The other part of the script works perfectly, I had to place your lines below the call for Farooq's otherwise the revive wouldn't work.

That may be. I've put them in a "sides.sqf" and called it in the init.sqf via

execvm "sides.sqf";

I haven't tried the sideEnemy yet, I'll do that tomorrow. You are a lifesaver. One funny thing though, some of the NPC's have a yellow icon instead of red/green respective. Does that mean the NPC's are using the revive too? Their health/armor slider was all the way down.

I at least did not get an error with sideEnemy as an additional side. AI units respawn only if they're tagged as playable in the editor.

Share this post


Link to post
Share on other sites

Well done guys, got it to work as well. And don't beat yourself up Pergor for not noticing the typo in your code. Scanned it through myself for several times and didn't find anything. Thanks!

Edit: Well one more thing I noticed. Since the code is in a never ending loop, any idea why copy-pasting units in Zeus doesn't make them editable?

Edit: Creating new units with Zeus and copy-pasting them works just fine. But when you try to copy editor made units, they spawn as non-editable.

Edited by despi

Share this post


Link to post
Share on other sites
Edit: Creating new units with Zeus and copy-pasting them works just fine. But when you try to copy editor made units, they spawn as non-editable.

How quaint. I have no Idea. Actually I've only found out yesterday that copypasting in Zeus-view is possible. :p

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  

×