chris330 0 Posted February 9, 2006 Dear All, Did a quick search on this one and it came up with this topic which unfortunately has no replies: Topic I'm trying to do some learning about two main principles. The first being the concept of a drop and what it actually is? Plus how do I use one properly. There seemed to be a hell of alot of parameters passed into that array you will see in that topic, so it looks quite complex. The second thing is, why has this author and the author of the GetBankPitch script used the drop command as part of a preprocessed file (or .sqf file if you prefer). It would appear there is some saving in CPU power to be had by utilising a function file instead of a script. I am trying to manufacture a script that can acquire a vehicle's bank and pitch constantly during its operation so I would have to avoid anything that was CPU consumptive due to the fact that the script will be running constantly as long as the vehicle is alive. Will I have to incorporate a .sqf file into my script? I would appreciate any information anyone can supply. OFPEC is down unfortunately so I can't get any help from there. Also the only topic my search showed up is the one listed above which goes back to 2002 Thanks in advance to anyone who should stop by and help Share this post Link to post Share on other sites
vektorboson 8 Posted February 9, 2006 Well, preprocessFile is only necessary if you use C/C++ like comments, these are: /* Â multiline comments */ // comment till end of line And you can use C-like Macros and includes; if you don't use any of these, you can just use loadfile. Well, why did the author of GetBank and Pitch use drop? Because the spawning position of the particles is transformed with the spatial orientation of the model. There is no way but this to retrieve the orientation of an object (well it's possible in OFP:E and therefore probably in ArmAss). Share this post Link to post Share on other sites
UNN 0 Posted February 9, 2006 The advantage of using a function is, the commands get executed instantly. In the case of the drop command and get pitch e.t.c The idea is, you drop a particle from one point then grab it's position, you then drop another particle from another point and get that position. You then get the height above sea level of both particles and do a bit of trig to work out the angle between them. The problem with the drop command as I see it is, you cant directly reference the dropped particle, all you can do is attach a script to it, which is then called once dropped. I assume this could result in a delay, between dropping the particle and getting it's position. There is also the problem of multiplayer, drop commands are local to just the client. I must admit I've never used the drop command method, partly because of the problems above. Quote[/b] ]Because the spawning position of the particles is transformed with the spatial orientation of the model. There is no way but this to retrieve the orientation of an object (well it's possible in OFP:E and therefore probably in ArmAss). You can get exact positional info on anything you can attach a cargo proxie to (as seen in the demo I posted). I prefer this method over the drop command, for obtaining pitch and bank. Because there is less scripting involved and it returns instant results. It also works on all clients in MP. Cargo logics do sometimes require more setting up and extra scripts to maintain them, but they have less script commands where it counts, in your loop. If it's just the pitch you want then you can also use the SetCamRelPos method. Or if the crew of the vehicle will allow for it, you can use the pilot\vehicle axis method. Your spoilt for choice really, you have four different methods of getting the pitch and three for getting pitch and bank, each with their own pro's and con's. But as vektorboson said, you may have to wait for Armed Assault to get something as easy as just calling a single command like GetPitch.. There is a tutorial we did for MCar that might help explain the caro proxy method: MCAR-GameLogics.zip Share this post Link to post Share on other sites
chris330 0 Posted February 9, 2006 I'm downloading it now. Thanks alot, that sounds like a much better plan, especially as it's compatable with multiplayer. The down sides you mentioned to the drop method are enough to put me right off using it. **I'll check back in when I've had a chance to pick through your work. Sounds like a far better solution Share this post Link to post Share on other sites
UNN 0 Posted February 10, 2006 I can't say for sure if cargo proxies are the best method as it depends on what your trying to do. They have thier own problems and when they go wrong OFP just crashes out. If you use cargo proxies and game logics with aircraft, they will be ejected along with any other AI when the damage reaches 50%. So you have to detect this using hit event e.t.c Easy enough, when it does hit the required damage you just kill the logics and move them back into position. But having dead logics in an aircraft can cause other problems, so be prepared for more scripting, just to look after them. Some of the problems associated with game logics and aircraft are covered here: http://www.flashpoint1985.com/cgi-bin....t=48300 One advantage of the drop command is it does not require as much maintenance. But in order to transfer info from the drop script to vehicle scripts, you need to setup unique global variables. Share this post Link to post Share on other sites
chris330 0 Posted February 10, 2006 One question then, I guess from your earlier post there would be drawbacks to using the drop command method in multiplayer. Could I get around this using some means of broadcasting their positions to client machines so scripts running locally on their machines would still operate correctly? Or would the time delay caused by the communication between server and client(s) mean that this would not be a reliable enough method of positional detection (and therefore accurate data) for the client machines? Share this post Link to post Share on other sites
UNN 0 Posted February 10, 2006 Cant really help you much on the drop command and I'm not the best person to talk to regarding MP. Broadcasting valiables in a loop thats running at say 0.001 seconds is probably not a good idea. To get pitch and bank you would have to broadcast nine variables (3 x XYZ positions) for every vehicle you had in game. Maybe you can have the script running on all clients and the server, all the time? Like I said, I'm not the best person to ask. Perhaps someone can point you in the direction of a MP addon that uses the drop command? Share this post Link to post Share on other sites
chris330 0 Posted February 14, 2006 Cant really help you much on the drop command and I'm not the best person to talk to regarding MP.Broadcasting valiables in a loop thats running at say 0.001 seconds is probably not a good idea. To get pitch and bank you would have to broadcast nine variables (3 x XYZ positions) for every vehicle you had in game. Maybe you can have the script running on all clients and the server, all the time? Like I said, I'm not the best person to ask. Perhaps someone can point you in the direction of a MP addon that uses the drop command? Thanks for the reply, sorry I never got back to you sooner. I have figured out most of the things I need to here and if you head over to the Reverse Engineer topic in one of the scripting forums (can't remember which) you'll see the link to the finished document. Quite amazing what you can get done when you're off work recovering from an op! I'm sure if I can't get the info I need regarding stuff about how this command behaves in multiplayer I could do some testing myself as I have a life long pal who lives right near me who loves Flashpoint and we can test MP stuff that way. Only main issues to sort out are those considering whether or not drops are local only to the server or not? I know game logics are, so that would have to be fixed (Dschulle uses them to get sea level data). I've credited yourself (UNN) and Rock in the credits part of the document Share this post Link to post Share on other sites
General Barron 0 Posted February 15, 2006 Quote[/b] ]Only main issues to sort out are those considering whether or not drops are local only to the server or not? Drops are local only to the computer the command is executed on. If you execute it on the server, it will be local to the server. If you execute it on a certain player's comp, it will be local to him. In most cases, you want the drops to be seen by all players, so you want to execute them every computer. (you aren't using drop for looks, so obviously this won't apply) It would help to know what you are trying to do, if you want more MP advice. You may only need to know the vehicle's pitch/bank on the server. Or you may need to know it on a certain client. Or you may need to know it on both. It all depends on what you are trying to do. Quote[/b] ]I know game logics are, so that would have to be fixed (Dschulle uses them to get sea level data). Game logics are just like any other unit: they are local to the computer that controls them (either by commanding it or by driving it). However, players can never control logics, so they are always local to the server. AFAIK you can always 'getpos' a remote object, so it shouldn't even matter where the logic is local to. Share this post Link to post Share on other sites
chris330 0 Posted February 15, 2006 Thanks for getting back to me. From what you have posted it would appear things might actually be a bit easier than i had first suspected. What I want is to have pitch and bank data retrieved locally by the clients aswell as the server to avoid any latency issues causing weird non-synchronized behaviour of scripts relating to specific vehicles in a multiplayer situation. When I can get chance to delve a bit deeper into it I'll post again in this thread, as I've got a couple of other things on the go at the moment. Thanks for replying to me Share this post Link to post Share on other sites