Jump to content
kalthramis

Manipulate preplaced objects?

Recommended Posts

It appears to work just fine like that. Thanks, JShock!!

Share this post


Link to post
Share on other sites

[color="#FF8040"][color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]![/b][/color][color="#191970"][b]isServer[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]exitWith[/b][/color][color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]

[color="#FF0000"]0[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]spawn[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
[color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]count[/b][/color] [color="#191970"][b]allCurators[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]>[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] 
[color="#8B3E2F"][b]{[/b][/color]
	[color="#191970"][b]sleep[/b][/color] [color="#FF0000"]30[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]zCurator [color="#191970"][b]addCuratorEditableObjects[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_x[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#191970"][b]vehicles[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]zCurator [color="#191970"][b]addCuratorEditableObjects[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_x[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]allMissionObjects[/b][/color] [color="#7A7A7A"]"Man"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]zCurator [color="#191970"][b]addCuratorEditableObjects[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_x[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#191970"][b]allUnits[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]  
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Isn't that actually better ? Also, I would like to know if zCurator always points to the Zeus Module placed on map.

Edited by R3vo

Share this post


Link to post
Share on other sites

Hi

Only recently started messing around with Zeus again and this looks very useful. I'm a coding idiot and don't seem to get any of the suggested methods to work?

For example R3vo's above - should that code be in the init.sqf for the mission?

Thanks for any step by step idiot guidance!

Share this post


Link to post
Share on other sites
Hi

Only recently started messing around with Zeus again and this looks very useful. I'm a coding idiot and don't seem to get any of the suggested methods to work?

For example R3vo's above - should that code be in the init.sqf for the mission?

Thanks for any step by step idiot guidance!

put it into an sqf file and put following line into the init.sqf

[] execVM "YOURSCRIPTNAME.sqf";

Share this post


Link to post
Share on other sites
Isn't that actually better?

Yea, I was trying to figure out why you would do condition checks for every side, if you were going to do the same thing for every side anyhow, but I was merely making the sleep work, not trying to understand others' logic :p.

Share this post


Link to post
Share on other sites
[color="#FF8040"][color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]![/b][/color][color="#191970"][b]isServer[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]exitWith[/b][/color][color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]

[color="#FF0000"]0[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]spawn[/b][/color]
[color="#8B3E2F"][b]{[/b][/color]
[color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]count[/b][/color] [color="#191970"][b]allCurators[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#8B3E2F"][b]>[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] 
[color="#8B3E2F"][b]{[/b][/color]
	[color="#191970"][b]sleep[/b][/color] [color="#FF0000"]30[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]zCurator [color="#191970"][b]addCuratorEditableObjects[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_x[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#191970"][b]vehicles[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]zCurator [color="#191970"][b]addCuratorEditableObjects[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_x[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]allMissionObjects[/b][/color] [color="#7A7A7A"]"Man"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#8B3E2F"][b]{[/b][/color]zCurator [color="#191970"][b]addCuratorEditableObjects[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#000000"]_x[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]forEach[/b][/color] [color="#191970"][b]allUnits[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]  
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Isn't that actually better ? Also, I would like to know if zCurator always points to the Zeus Module placed on map.

Do we need to change "zCurator" to our Zeus Module's name? Or does this refer to the Game Curator?...... I'm a little confused?

Share this post


Link to post
Share on other sites
Do we need to change "zCurator" to our Zeus Module's name? Or does this refer to the Game Curator?...... I'm a little confused?

Me too (but I am an idiot!) Been trying what was suggested - I'm just messing around with editor for single player.......

Share this post


Link to post
Share on other sites
Me too (but I am an idiot!) Been trying what was suggested - I'm just messing around with editor for single player.......

I changed my Zeus Game Master Module to "zCurator" and that seemed to work when i play locally but i need to get it to work on a server so I'm going to re-upload the mission to my test server and see if it now works.

Thing is.... the mission on the server spawns more AI enemies every time an objective is created, so i'm not sure if it will show them up in Zeus too but i guess that is why we test.........

Share this post


Link to post
Share on other sites

Well I didn't name my module zCurator the last time it used that script, and I'm pretty sure it worked.

Thing is.... the mission on the server spawns more AI enemies every time an objective is created, so i'm not sure if it will show them up in Zeus too but i guess that is why we test.........

That's actually the purpose of this script. It will add all newly spawned units to Zeus.

Share this post


Link to post
Share on other sites
Well I didn't name my module zCurator the last time it used that script, and I'm pretty sure it worked.

Are you using the "Zeus" Gamemaster or the "Gameplay Mode" Gamemaster? I'm just trying to confirm what zCurator is referring to......

That's actually the purpose of this script. It will add all newly spawned units to Zeus.

Then this should be exactly what i'm looking for :-D

Share this post


Link to post
Share on other sites

For those interested, here's the same code as above, but without the BBCode mess.

if (!isServer) exitWith{};

0 = [] spawn
{
  while {(count allCurators) > 0} do 
  {
	sleep 30;
	{zCurator addCuratorEditableObjects [[_x],true]} forEach vehicles;
	{zCurator addCuratorEditableObjects [[_x],true]} forEach (allMissionObjects "Man");
	{zCurator addCuratorEditableObjects [[_x],true]} forEach allUnits;
  };  
};

 

Share this post


Link to post
Share on other sites
On 3/29/2020 at 12:23 PM, KevinGelking said:

{zCurator addCuratorEditableObjects [[_x],true]} forEach vehicles;

🤦‍♂️

 

zCurator addCuratorEditableObjects [vehicles,true];

Your variant creates a seperate network message for each vehicle. Which will kill networking bandwidth and probably cause some desyncs.

The command already takes an array of objects. Just pass it an array of objects...

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

×