fail2ban
Member-
Content Count
6 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout fail2ban
-
Rank
Rookie
-
Using call compile in event handlers in multiplayer - security question
fail2ban replied to fail2ban's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thx for pointing me in the right direction. -
Using call compile in event handlers in multiplayer - security question
fail2ban posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi there, I am playing around with event handlers atm and trying to figure out whats the best approach. I don't want to have too much code on the client side and therefor maximum control on the server. That's why I came up with the idea to execute the code directly in the event handler by compiling a string and it works flawlessly (call compile "string"). Anyway, regarding to Killzone Kids post on http://killzonekid.com/arma-scripting-tutorials-constructing-secure-callback/ this should not be done: "One thing you definitely don’t want is to allow passing of a code over network and then letting all client machines to execute this code." Ok, understood. But what if the server and the client share a secret. E. g. on player joining the dedicated / server will create a secret and send it to the client. The server and client will both store the secret and on call of an event handler the shared secret will be sent (server->client or client-> server) and then compared with the stored one. If the secret is not recognized, nothing will happen. Otherwise the code will be executed. The unique id can be generated by creating a WeaponHolderSimulated (compare http://killzonekid.com/arma-scripting-tutorials-kk_fnc_assocarrayxxxx/ : _ref = str ("WeaponHolderSimulated" createVehicleLocal [0,0,0]); ). What do you think about this idea? I am far away from hacking, so I don't know what is possible and what is not. I was just wondering if this little method mentioned above will help to secure the sending and execution of code in an event handler or if you think I should keep my hands off and better do the coding the "traditional" way by executing functions / scripts inside the event handlers, dealing with whatever needs to be dealed with (the initial approach was to have as much code on the server side as possible and less code on the client side). Apologies if this has been asked before, it is sometimes not so easy to find some good results by searching. Cheers fail2ban -
Direction of unit during animation
fail2ban replied to fail2ban's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thx for the reply. Your tip works great with the player unit, but not the other way round. It won't change the direction of the AI unit. Let me say you spawn two units, neither of it is the player, the units will not take care whatever you have put in setDir. ---------- Post added at 17:38 ---------- Previous post was at 17:22 ---------- I've got your example working, but instead of setDir I am using setFormDir. This will allow both units to look at each other and also rotate the body in the right direction. Strange thing: it works only for animations that can be played with playMove, while switchMove animations do not seem to take care about the direction. I can still do the absolute positions mentioned above for the switchMove units, but if I'll find a more generic approach, that'll be great. -
Direction of unit during animation
fail2ban posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi there, I am kinda lost atm. I have read a lot of posts about animations and directions, but nothing seem to do the trick. I am using animations on units and it looks like the animations have a default direction. No matter in which direction I place a unit, it will turn into the preset direction of the animation. I have tried doWatch, lookAt and setFormDir. While doWatch and lookAt makes the unit look at a certain point, it won't move their bodies in the right direction. I have even tried to attach the unit to an empty helipad and turn the helipad. That works by the way, but once a unit is attached to an object, the animations won't be as smooth as normal. I am running out of ideas. Any suggestions will be great. Thx in advance. ---------- Post added at 16:29 ---------- Previous post was at 15:48 ---------- Never mind, I think I have finally got a solution. I have tried to point the units to an opposite unit by doing something like unitA doWatch unitB; It looks like both units are too close together (1m) and therefor the enigne does not do the right move. If I use a position with higher numbers instead like unitA doWatch [9000,9000]; it works. Still strange and a lot of trial and error to get it right. If one of you knows a better solution, I'll be happy to hear it. -
Replace building - finding the correct position
fail2ban replied to fail2ban's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thank you, but using modelToWorld brings up this [6855.48,4518.35,1.36] which is X- and Y-wise the same as the ASL / ATL functions Guess I have used it the way you meant f2b_2 = nearestObject [player, "Land_MBG_Police_Station"]; _test = f2b_2 modelToWorld [0,0,0]; _test call DT_fnc_log; Or did I do it wrong? -
Replace building - finding the correct position
fail2ban posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi there, it's my first post, so first of all "Hello" to everyone. I am trying to replace buildings on a Lingor map. Actually I need to replace the Land_MBG_Police_Station by itself, because in my version I cannot open the doors anymore (if I spawn one by using createVehicle instead the building performs like intended). Therefor I am trying to retrieve the objects position, hide the original object and put a new object on the exact same place. Hiding the object is not a problem, but getting the correct position for the new one. f2b_test={ private ["_test","_testPos","_testPosASL"]; _test = nearestObject [player, "Land_MBG_Police_Station"]; _test call DT_fnc_log; _testPos = getPos _test; _testPos call DT_fnc_log; _testPosASL = getPosASL _test; _testPos = ASLToATL _testPosASL; _testPos call DT_fnc_log; _testPos = getPosATL _test; _testPos call DT_fnc_log; _testPos = visiblePosition _test; _testPos call DT_fnc_log; }; [] spawn f2b_test; The result of the function above is the following 14:07:40 - 28b26400# 267252: mbg_police_station.p3d // _test - object 14:07:40 - [6853.38,4518.18,-0.239998] // getPos 14:07:40 - [6855.48,4518.35,0] // getPosASL to ATL 14:07:40 - [6855.48,4518.35,0] // getPosATL 14:07:40 - [6853.38,4518.18,-0.239998] // visiblePosition As you can see X and Y coords of the returned position array are different for the getPos / visiblePosition compared to the ASL / ATL functions. This is the first thing I do not understand. How can it be different? But now matter what, all of the methods above won't let me spawn the same building in the same position if I do something like f2b_test={ private ["_test","_testPos","_testDir"]; _test = nearestObject [player, "Land_MBG_Police_Station"]; _testPos = getPos _test; _testDir = getDir _test; _test hideObject true; sleep 2; // see if it is gone f2b_1 = createVehicle ["Land_MBG_Police_Station", _testPos, [], 0, "CAN_COLLIDE"]; f2b_1 setDir _testDir; f2b_1 setPos _testPos; }; [] spawn f2b_test; I have tried it with all methods mentioned above, but the newly spawned building has always have a slight offset to the original position. Is there anything I am missing. Does an object have an offset relative to its map coords somewhere I am not aware of and that I need to add or substract? Thx very much in advance