Jump to content
Sign in to follow this  
1para{god-father}

Help on script after removal of processInitCommands

Recommended Posts

OK i have the script below , and as they have deleted the setVehicleInit & processInitCommands etc.. (DEV) what is the work around ?

_lead setVehicleInit _init;
processInitCommands;

I read this but

setVehicleInit = compileFinal "replacement code using new features";

so i tried this but it did not work?


_lead setVehicleInit = compileFinal _init;

Share this post


Link to post
Share on other sites
OK i have the script below , and as they have deleted the setVehicleInit & processInitCommands etc.. (DEV) what is the work around ?

_lead setVehicleInit _init;
processInitCommands;

I read this but

so i tried this but it did not work?


_lead setVehicleInit = compileFinal _init;

They've removed those commands? I hope that's only in the dev build and they're not going to take it out of the proper one too, unless there's a simple replacement.

Share this post


Link to post
Share on other sites
They've removed those commands? I hope that's only in the dev build and they're not going to take it out of the proper one too, unless there's a simple replacement.

It's dev only at the moment but once tests are proven successful it will be on both DEV and future builds of A3. It's for the greater good.

Now what use do you have of setVehicleInit that you need it so bad? Anything you use with setVehicleInit can easily be replaced with new and improved code.

Share this post


Link to post
Share on other sites
It's dev only at the moment but once tests are proven successful it will be on both DEV and future builds of A3. It's for the greater good.

Now what use do you have of setVehicleInit that you need it so bad? Anything you use with setVehicleInit can easily be replaced with new and improved code.

What is the new and improved code? I have already mentioned in the dev build thread that many scripts that dynamically spawn AI use setVehicleinit.. It is used in so many missions that i have downloaded, and made. In a vehicle respawn script, I use setVehicleinit to initialize scripts in the newly spawned vehicle. UPS/UPSMON uses setVehicleinit when creating clones, and processInitCommands in the INIT.sqf file. I understand it was removed because it can be used to hack. However, why remove these command and not replace them with secure analogous commands(Im sure their coming but why not remove?release the same day).

That's just one of the most utilized patrol scripts is completely broken.. someone posted that you will have to use event handlers to set a vehicles Init .. can someone explain how? How do we set the INIT of a dynamically spawned unit in game with out a setvehicleinit command?

Edited by Lordprimate

Share this post


Link to post
Share on other sites
It's dev only at the moment but once tests are proven successful it will be on both DEV and future builds of A3. It's for the greater good.

Now what use do you have of setVehicleInit that you need it so bad? Anything you use with setVehicleInit can easily be replaced with new and improved code.

Can you let us know how then please as like other post's lots & lots of scripts use it so i need to work out how to change as some are OLD scripts !

Thanks

Share this post


Link to post
Share on other sites
It's dev only at the moment but once tests are proven successful it will be on both DEV and future builds of A3. It's for the greater good.

Now what use do you have of setVehicleInit that you need it so bad? Anything you use with setVehicleInit can easily be replaced with new and improved code.

Well like I said hopefully there will be a replacement for it that is as easy to use. What I am using it for personally is to add actions to things spawned through a server side script, so the action is shown for all clients. Using setVehicleInit was the simplest way to get it working and the other ways I had tried had failed.

Share this post


Link to post
Share on other sites

This is going to break so many scripts... :\

If it is removed/changed due to hackers, is it worth it? You stopped people from using ONE command to hack, but in return you broke so much community content that the solution becomes the problem.

Share this post


Link to post
Share on other sites

Well, there is superior function already...

For security reasons, the command was disabled in Arma 3. Use BIS_fnc_MP for remote execution.

Share this post


Link to post
Share on other sites
Well, there is superior function already...

And that is also used to hack, easier in fact. So there's no justified reason for setVehicleInit's removal.

Share this post


Link to post
Share on other sites
They've removed those commands? I hope that's only in the dev build and they're not going to take it out of the proper one too, unless there's a simple replacement.

Yes, setVehicleInit, processInitCommands and clearVehicleInit have been removed from Arma 3 and will happen on stable build also, for security reasons.

Although, using these was always a bad choice.

See BIS fnc MP, that make full use of publicVariable commands, including the new publicVariableServer/publicVariableClient.

And that is also used to hack, easier in fact. So there's no justified reason for setVehicleInit's removal.

To avoid such abuse, compileFinal has been added, giving the ability to make compiled functions final.

Ofc, these are only the first steps to make MP more secure and next week Arma 3 Project Lead will explain these in more detail.

Edited by neokika

Share this post


Link to post
Share on other sites
Well, there is superior function already...

Didn't work for me and I know I'm not the only one, some people on here who have a lot of scripting knowledge can't get it working properly either.

Share this post


Link to post
Share on other sites

Can we at least get some sort of vote or discussion of the removal of setVehicleInit? Removing it due to security reasons is fine, but when it is replaced with another command which has the same vulnerabilities, it makes no sense.

Share this post


Link to post
Share on other sites
Didn't work for me and I know I'm not the only one, some people on here who have a lot of scripting knowledge can't get it working properly either.

there was a bug with it

Share this post


Link to post
Share on other sites
there was a bug with it

was? So is it fixed now and when did that happen? Is it only fixed in the dev build?

---------- Post added at 23:46 ---------- Previous post was at 23:27 ----------

Also, how are you supposed to use bis_fnc_mp to actually set the init of a spawned vehicle etc ?

Share this post


Link to post
Share on other sites
was? So is it fixed now and when did that happen? Is it only fixed in the dev build?

---------- Post added at 23:46 ---------- Previous post was at 23:27 ----------

Also, how are you supposed to use bis_fnc_mp to actually set the init of a spawned vehicle etc ?

02-04-2013

Prototype of fatigue post-processing effects added

Fixed: BIS_fnc_MP wasn't working correctly when server ID wasn't 0

Fixed: Server-only persistent functions were executed also on clients within MP framework

Fixed: http://feedback.arma3.com/view.php?id=5511

Fixed: http://feedback.arma3.com/view.php?id=5709

WIP: missing string clean-up

there

Share this post


Link to post
Share on other sites

Didn't know there was an issue with mp function, may explain why i couldn't get the damn thing working. Nice one Killzone_kid for pointing that out

Share this post


Link to post
Share on other sites
was? So is it fixed now and when did that happen? Is it only fixed in the dev build?

---------- Post added at 23:46 ---------- Previous post was at 23:27 ----------

Also, how are you supposed to use bis_fnc_mp to actually set the init of a spawned vehicle etc ?

Setting the init of a vehicle isn't quite what you would think, when using setVehicleInit all you were doing was telling the person that the vehicle was local to, to run some code. It's like for instance:

myvehicle setVehicleInit "this lock true";
processInitCommands;

It is basically just: myvehicle lock true

The difference is, the person that owns the vehicle (the one the vehicle is local to) runs the code manipulating the vehicle. So with that understanding doing something like that above would be something like this with BIS_fnc_MP

fnc_lockVehicle =
{
private["_vehicle","_state"];
_vehicle = _this select 0;
_state = _this select 1;

if(isNull _vehicle) exitWith {};

_vehicle lock _state;
};

[[myvehicle,true],"fnc_lockVehicle",myvehicle,false] spawn BIS_fnc_MP;

Or something similar once you read full documentation on BIS_fnc_MP and what is acceptable to pass to it as far as a function goes. As i've said, the removal of setVehicleInit is just going to lead people to make their scripts better, more update to date for the arma scripting age we use today. SetVehicleInit is so old and had flaws in it that were most noticeable in ARMA 2 (because it has more complete content).

BIS_fnc_MP is really no different then setVehicleInit just now you have to define the code in a function that you are making whatever it is run, of course there are other ways but just read the wiki, look around and you'll have your replacement.

Share this post


Link to post
Share on other sites

_netID = netID _objtoInit; 
_sCommand = format ["{(objectFromNetID '%1') allowDamage false;}", _netID]; 
[_sCommand,"BIS_fnc_spawn",true,true] spawn BIS_fnc_MP;  

^ doing this, will execute the _sCommand.

_sCommand, in this example, sets that vehicle's 'allowDamage' state to 'false', so that that vehicle has god mode across all clients.

Not the best example, but it's something.

ALTHOUGH

If you do it this way, it may not be 100% supported by BIS in the near future, because it's a pretty big hole (exactly the same hole as setvehicleInit) in that it runs ANY code that is passed via a variable, and not a compileFinal function.

What BIS needs to do

To fully fix any and all holes, is to implement another flag to 'function' variables, that being, an OWNERSHIP flag. If a function is compileFinal on a client, and sent over the network via publicVariable, that variable would have it's ownerID static. Then, an SQF method to 'get' the ownerID of the function (maybe overload the current ownerID function) and incorporate a flag within the mission's description.ext for the mission writer to set whether MP exec commands owned by clients can be ran, or not. Preferably not.....

Can also iterate on this, and have two .ext flags for 'allow client function execution on server' and 'allow client function execution on client'. Former is to control whether client compiled functions can be ran by the server, and the latter is to control whether client compiled functions can be ran by other clients. If that makes sense.

EDIT: Perhaps also enable it so that if a server broadcasts a compileFinal function, that isn't a BIS_fnc, that function overrides any client compiled function, and sets it's ownerID to that of the server.

And ID verification could be done by a method of public/private key checks.

Edited by Radioman

Share this post


Link to post
Share on other sites
Setting the init of a vehicle isn't quite what you would think, when using setVehicleInit all you were doing was telling the person that the vehicle was local to, to run some code. It's like for instance:

myvehicle setVehicleInit "this lock true";
processInitCommands;

It is basically just: myvehicle lock true

The difference is, the person that owns the vehicle (the one the vehicle is local to) runs the code manipulating the vehicle. So with that understanding doing something like that above would be something like this with BIS_fnc_MP

fnc_lockVehicle =
{
private["_vehicle","_state"];
_vehicle = _this select 0;
_state = _this select 1;

if(isNull _vehicle) exitWith {};

_vehicle lock _state;
};

[[myvehicle,true],"fnc_lockVehicle",myvehicle,false] spawn BIS_fnc_MP;

Or something similar once you read full documentation on BIS_fnc_MP and what is acceptable to pass to it as far as a function goes. As i've said, the removal of setVehicleInit is just going to lead people to make their scripts better, more update to date for the arma scripting age we use today. SetVehicleInit is so old and had flaws in it that were most noticeable in ARMA 2 (because it has more complete content).

BIS_fnc_MP is really no different then setVehicleInit just now you have to define the code in a function that you are making whatever it is run, of course there are other ways but just read the wiki, look around and you'll have your replacement.

Thanks for the explanation. When I tried just adding the action straight to the vehicle name (e.g. myvehicle addAction etc...) the action was only added for the server. So I used the SetVehicleInit so it would add it for all clients as well. Another thing I am using it for is to be able to set the group name when the script is run.

Share this post


Link to post
Share on other sites

Can't we just use and abuse addPublicVariableEventHandler?

For example if I need to make my base buildings invulnerable, could I do this:

"flagMakeBaseInvulnerable" addPublicVariableEventHandler

{

if (flagMakeBaseInvulnerable) then

{

_buildingArray = nearestObjects [_pos, ["building"], 100];

{

_x allowDamage false;

} forEach _buildingArray;

// unflagging to do it just once

flagMakeBaseInvulnerable = false;

};

};

Then when I init the server side of things, I just update flagMakeBaseInvulnerable to true and call publicVariable "flagMakeBaseInvulnerable".

I mean, this works when using say3D in MPMissions to make it so every players hear sound, why not there?

edit:

Hmmm, would that mean that my global server side flagMakeBaseInvulnerable would still be true, while it would be false on all clients? Mind boggling!!

Edited by Twix

Share this post


Link to post
Share on other sites

I've heard a few times that eventhandlers are resource intensive just as setVehicleInit can be, is this true?

Share this post


Link to post
Share on other sites
Can't we just use and abuse addPublicVariableEventHandler?

For example if I need to make my base buildings invulnerable, could I do this:

Then when I init the server side of things, I just update flagMakeBaseInvulnerable to true and call publicVariable "flagMakeBaseInvulnerable".

I mean, this works when using say3D in MPMissions to make it so every players hear sound, why not there?

edit:

Hmmm, would that mean that my global server side flagMakeBaseInvulnerable would still be true, while it would be false on all clients? Mind boggling!!

Where are you getting _pos from?

And, every time you run this, it'll run on all clients, vs just the one. The aforementioned method of mine supports JIP.

and yes, you need to manually reset the variable on whatever PC that ran the publicvariable. Because, when you publicVariable a variable, it's event handler doesn't run then too, as technically, nothing changed.

Share this post


Link to post
Share on other sites
Where are you getting _pos from?

And, every time you run this, it'll run on all clients, vs just the one. The aforementioned method of mine supports JIP.

and yes, you need to manually reset the variable on whatever PC that ran the publicvariable. Because, when you publicVariable a variable, it's event handler doesn't run then too, as technically, nothing changed.

The _pos is a mistake, can just use getMarkerPos "base" or whatever.

And it NEEDS to run on all clients, so that's not a problem right? Plus I'll just need this once, when they connect. Need to add something specific for JIP too I suppose, but I already have a section that runs once for JIP for markers so I can just add it there.

In theory however, that could work?

Though are eventhandlers that intensive? I mean..it's just a little variable update when you look at it...

Share this post


Link to post
Share on other sites
_netID = netID _objtoInit; 
_sCommand = format ["{(objectFromNetID '%1') allowDamage false;}", _netID]; 
[_sCommand,"BIS_fnc_spawn",true,true] spawn BIS_fnc_MP;  

^ doing this, will execute the _sCommand.

_sCommand, in this example, sets that vehicle's 'allowDamage' state to 'false', so that that vehicle has god mode across all clients.

Not the best example, but it's something.

ALTHOUGH

If you do it this way, it may not be 100% supported by BIS in the near future, because it's a pretty big hole (exactly the same hole as setvehicleInit) in that it runs ANY code that is passed via a variable, and not a compileFinal function.

What BIS needs to do

To fully fix any and all holes, is to implement another flag to 'function' variables, that being, an OWNERSHIP flag. If a function is compileFinal on a client, and sent over the network via publicVariable, that variable would have it's ownerID static. Then, an SQF method to 'get' the ownerID of the function (maybe overload the current ownerID function) and incorporate a flag within the mission's description.ext for the mission writer to set whether MP exec commands owned by clients can be ran, or not. Preferably not.....

Can also iterate on this, and have two .ext flags for 'allow client function execution on server' and 'allow client function execution on client'. Former is to control whether client compiled functions can be ran by the server, and the latter is to control whether client compiled functions can be ran by other clients. If that makes sense.

EDIT: Perhaps also enable it so that if a server broadcasts a compileFinal function, that isn't a BIS_fnc, that function overrides any client compiled function, and sets it's ownerID to that of the server.

And ID verification could be done by a method of public/private key checks.

Ok, so what I am gathering from what you are typing is there there is going to be an INCREASE in IO traffic.. Nice more IO events that servers and clients have to process.. sounds a lot like LAG to me.. Thumbs up!! I love LAG

Share this post


Link to post
Share on other sites

watching debate dispassionately from my eurofighter high above takistan... i've ported evolution into Arma3, and watched as weekly it is broken then fixed then broken then fixed... this is the nature of alpha. best bet it so just try to keep your mission working to an extent, while BIS continues to develop it's engine as it sees fit. evo relies on setvehicleinit for a lot of key stuff so i guess the number 2 downloaded MP mission for arma3 just hit a brick wall. I guess i'll have to spend a couple of days rebuilding the mission once the debate settles down... and someone works out how to get around it.

ah well, target locked, brimstone away... lol. time for some canyon racing.

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  

×