Shashman 0 Posted March 8, 2006 OK so here's my question : I am working on an MI-8 training map for my squad, which includes evacuating an under fire infantry section, transporting a general, and responding to various aircraft malfunctions (fuel leak, engine failure,etc) The 3 players (2 trainees and 1 instructor) are the ® Pilot from the pack (they are helmet and headgearless) What I want is that whilst the trainees are in a chopper, they can only communicate if they put on either headgear or helmet (we'll say helmet for simplicity's sake) I thought about <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">pilotname addAction ["Put on flight helmet", "\OWP_Crew\helmetin.sqs"] But I get <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">'_this playmove "OWPHelmetIn"|#|': Error playmove: Type Array, expected Object and <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">'_this SetObjectTexture [1,""]|#|': Error setobjecttexture: Type Array, expected Object When I try this. In the OWP_Crew readme it says that to make a unit put on the helmet you have to put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit_name exec "\OWP_Crew\helmetin.sqs" In their init box Something else I would like to do in the mission is to give the instructor the ability to inflict various malfunctions on the trainees aircraft to train them in responding to them. The way I have done this is by doing it with radio triggers, and it works fine, but it only works once. I.E once the malfunction has been inflicted, that malfunction disappears Here's an example of what I have in the On Activation box of one of the radio triggers: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[red1,0.9,["fuel"]] exec "\OWP_MI8\scripts\owp_movie_dammage.sqs" red1 being the name of the chopper affected, 0.9 being the degree of severity of the malfunction and ["fuel"] being the malfunction. Now what I wanted to do, was to, instead of using radio triggers, enable this action to be performed from the action menu of the instructor (named pilot1) and to add an action, you put PlayerName addAction ["description of action","actionscript.sqs"] Correct? Well the command to initiate the malfunction already has a name defined, and there are brackets all over the place so I gotta say, I'm lost Could anyone give me a hand on this? P.S. Mods, I wan't sure whether this belonged in mission editing or the actual OWP MI-8 thread, so I'll post it in both, because I'd really like a response to this EDIT; scratch the helmet question, I just read in the readme Quote[/b] ]-When (in MP) trying play animation with helmet put in\off, it may crash dedicated server. Share this post Link to post Share on other sites
Metal Heart 0 Posted March 8, 2006 Quote[/b] ]_this playmove "OWPHelmetIn"|#|': Error playmove: Type Array, expected Object '_this' variable passed to the script by 'action' is an array instead of just the object/unit so it doesn't work. I'd make a second script that that calls the helmet script with proper syntax. Something like this: Save this to mission directory as helmet.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit=_this select 0 _unit exec "\OWP_Crew\helmetin.sqs" And use unit_name addAction ["Put on flight helmet", "helmet.sqs"] Quote[/b] ]...radio triggers, and it works fine, but it only works once. Do you have them set 'repeadetly' instead of 'once'. Share this post Link to post Share on other sites
Shashman 0 Posted March 9, 2006 Thanks for the response I have found another way of creating the malfunctions (and repairing them) by naming a computer object computer1 and another one computer2, and in init.sqs putting <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">id019 = computer1 addaction ["-*-Mi-8 Malfunctions-*-",""] id001 = computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] id002 = computer1 addaction ["FUEL Mi-8MT UN","unfuelleak.sqs"] id003 = computer1 addaction ["ENGINES Mi-8MTV","mtvengines.sqs"] id004 = computer1 addaction ["FUEL Mi-8MTV","mtvfuelleak.sqs"] id005 = computer1 addaction ["ENGINES Mi-8T","tengines.sqs"] id006 = computer1 addaction ["FUEL Mi-8T","tfuelleak.sqs"] id007 = computer1 addaction ["ENGINES Mi-8TV","tvengines.sqs"] id008 = computer1 addaction ["FUEL Mi-8TV","tvfuelleak.sqs"] id018 = computer1 addaction ["REMOVE NVGs","nogoggles.sqs"] id020 = computer2 addaction ["-*-Mi-8 Repairs-*-",""] id009 = computer2 addaction ["ENGINES Mi-8MT UN","unrepair.sqs"] id010 = computer2 addaction ["REFUEL Mi-8MT UN","unrefuel.sqs"] id011 = computer2 addaction ["ENGINES Mi-8MTV","mtvrepair.sqs"] id012 = computer2 addaction ["REFUEL Mi-8MTV","mtvrefuel.sqs"] id013 = computer2 addaction ["ENGINES Mi-8T","trepair.sqs"] id014 = computer2 addaction ["REFUEL Mi-8MT","trefuel.sqs"] id015 = computer2 addaction ["ENGINES Mi-8TV","tvrepair.sqs"] id016 = computer2 addaction ["REFUEL Mi-8TV","tvrefuel.sqs"] id017 = computer2 addaction ["EQUIP NVGs","givegoggles.sqs"] Seems to work, although even though for each of those scripts I have put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?player == pilot1 : goto "start" #start The action is available for all group units to perform, not just pilot1 Thanks for the solution for the helmet issue, but I'll follow the readme and avoid playing with the helmet, as this is an MP mission Share this post Link to post Share on other sites
Metal Heart 0 Posted March 9, 2006 Never assume some-multiplayer-thing works until you have tested it with multiple players :P I'm quite sure that a script that is run from action menu executes only on the local player, not on all clients. If I want a script to be ran on all clients I use variables like runsmokescript=false -then in action that is supposed to trigger the script do runsmokescript=true; publicVariable runsmokescript; -then place trigger on map with condition runsmokescript and onactivation [] exec "smoke.sqs" If you wan't only certain unit to see some action, do in init.sqs for example: ?player==pilot1 : object addaction ["action","script.sqs"] ?player==pilot2 : object addaction ["action2","script2.sqs"] So pilot1 would only see 'action' and pilot2 only 'action2' edit... now that I thoght of it, maybe the addaction command is global. Share this post Link to post Share on other sites
Shashman 0 Posted March 10, 2006 Well, the actions work fine, everyone can see (and SUFFER their effects. Hehe flying @ 100km/h and 50m altitude then suffering both engines failing is quite the experience ), so addaction is definately global I'll insert <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?player==pilot1 : object addaction ["action","script.sqs"] for each action in the init.sqs Thanks Share this post Link to post Share on other sites
Metal Heart 0 Posted March 10, 2006 What I meant by addaction being global is... even if a script that adds action to objectX is run only on client1, client2 will see this action anyway when they approach objectX. Maybe you could use the radio menu then, I think only group leaders can execute Radio Alpha, Bravo etc, and you can change their text with 0 setRadioMsg "action1", 1 setRadioMsg "action2". It would be possible to do sub-menus too with a little scripting. If you use triggers with radio commands, they execute on all clients (at least, that's what I think). Or you could use a dialog... This way you could use single addaction on the chopper and each could be set to get a different dialog when they execute action. Or addaction to pilots them selves if they don't sit too close to each other so they won't see each others actions. The scripts might work with commands like setDammage (which is global) but if you have your chopper emitting smoke and making funny noises for example, I think the effects can be witnessed only by the client who triggers the script. But hey, if you already took all the locality stuff into consideration with the scripts, very, very good job then But always double check everything... it's so easy to get stuff wrong in MP with every other command being somewhat randomly global and local. Share this post Link to post Share on other sites
Shashman 0 Posted March 10, 2006 Yup, the actual effects of the actions are working for everyone (I witnessed one of the best autorotations performed by a pilot I've ever seen yesterday ). Granted many other parts of the mission aren't happening/happening as they should (I've actually spent 3 days working on this mission and it's just supposed to be a proficiency test mission with 2 objectives ) but that aspect of the mission can now be considered done n dusted. My eyes were popping out of my head last night when I made your suggested additions to the init.sqs so didn't get time to check if it worked, but it makes sense and should work. My first idea was to use the radio as mission control, but when you take a look at the commands available to the flight instructor : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _param1 = 5 ? Param1 <= 9 : _param1 = Param1 ? _param1 == 1 : skiptime 0 ? _param1 == 2 : skiptime 5.25 ? _param1 == 3 : skiptime 5.5 ? _param1 == 4 : skiptime 9 ? _param1 == 5 : skiptime 12 ? _param1 == 6 : skiptime 15 ? _param1 == 7 : skiptime 17.75 ? _param1 == 8 : skiptime 18.25 ? _param1 == 9 : skiptime 18.75 _param2 = 1 ? Param2 <= 9 : _param2 = Param2 ? _param2 == 1 : viewdistancesel = 900 ? _param2 == 2 : viewdistancesel = 1200 ? _param2 == 3 : viewdistancesel = 1500 ? _param2 == 4 : viewdistancesel = 1800 ? _param2 == 5 : viewdistancesel = 2000 ? _param2 == 6 : viewdistancesel = 2300 ? _param2 == 7 : viewdistancesel = 2600 ? _param2 == 8 : viewdistancesel = 3000 ? _param2 == 9 : viewdistancesel = 3500 ?player==pilot1 : computer1 addaction ["***Mi-8 Malfunctions***","""] ?player==pilot1 : computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] ?player==pilot1 : computer1 addaction ["FUEL Mi-8MT UN","unfuelleak.sqs"] ?player==pilot1 : computer1 addaction ["ENGINES Mi-8MTV","mtvengines.sqs"] ?player==pilot1 : computer1 addaction ["FUEL Mi-8MTV","mtvfuelleak.sqs"] ?player==pilot1 : computer1 addaction ["ENGINES Mi-8T","tengines.sqs"] ?player==pilot1 : computer1 addaction ["FUEL Mi-8T","tfuelleak.sqs"] ?player==pilot1 : computer1 addaction ["ENGINES Mi-8TV","tvengines.sqs"] ?player==pilot1 : computer1 addaction ["FUEL Mi-8TV","tvfuelleak.sqs"] ?player==pilot1 : computer1 addaction ["REMOVE NVGs","nogoggles.sqs"] ?player==pilot1 : computer1 addaction ["EQUIP NVGs","givegoggles.sqs"] ?player==pilot1 : computer2 addaction ["***Mi-8 Repairs***",""] ?player==pilot1 : computer2 addaction ["ENGINES Mi-8MT UN","unrepair.sqs"] ?player==pilot1 : computer2 addaction ["REFUEL Mi-8MT UN","unrefuel.sqs"] ?player==pilot1 : computer2 addaction ["ENGINES Mi-8MTV","mtvrepair.sqs"] ?player==pilot1 : computer2 addaction ["REFUEL Mi-8MTV","mtvrefuel.sqs"] ?player==pilot1 : computer2 addaction ["ENGINES Mi-8T","trepair.sqs"] ?player==pilot1 : computer2 addaction ["REFUEL Mi-8T","trefuel.sqs"] ?player==pilot1 : computer2 addaction ["ENGINES Mi-8TV","tvrepair.sqs"] ?player==pilot1 : computer2 addaction ["REFUEL Mi-8TV","tvrefuel.sqs"] id019 = computer1 addaction ["***Mi-8 Malfunctions***",""] id001 = computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] id002 = computer1 addaction ["FUEL Mi-8MT UN","unfuelleak.sqs"] id003 = computer1 addaction ["ENGINES Mi-8MTV","mtvengines.sqs"] id004 = computer1 addaction ["FUEL Mi-8MTV","mtvfuelleak.sqs"] id005 = computer1 addaction ["ENGINES Mi-8T","tengines.sqs"] id006 = computer1 addaction ["FUEL Mi-8T","tfuelleak.sqs"] id007 = computer1 addaction ["ENGINES Mi-8TV","tvengines.sqs"] id008 = computer1 addaction ["FUEL Mi-8TV","tvfuelleak.sqs"] id018 = computer1 addaction ["REMOVE NVGs","nogoggles.sqs"] id017 = computer1 addaction ["EQUIP NVGs","givegoggles.sqs"] id020 = computer2 addaction ["***Mi-8 Repairs***",""] id009 = computer2 addaction ["ENGINES Mi-8MT UN","unrepair.sqs"] id010 = computer2 addaction ["REFUEL Mi-8MT UN","unrefuel.sqs"] id011 = computer2 addaction ["ENGINES Mi-8MTV","mtvrepair.sqs"] id012 = computer2 addaction ["REFUEL Mi-8MTV","mtvrefuel.sqs"] id013 = computer2 addaction ["ENGINES Mi-8T","trepair.sqs"] id014 = computer2 addaction ["REFUEL Mi-8T","trefuel.sqs"] id015 = computer2 addaction ["ENGINES Mi-8TV","tvrepair.sqs"] id016 = computer2 addaction ["REFUEL Mi-8TV","tvrefuel.sqs"] Just a little too many for the poor lil radio to handle That and it's rather fiddly pressing a series of numbers to access the actions. Anyway, I'd like to keep it this way, that the pilot has to be near the computers to have access. I tested this mission with an actual helicopter pilot yesterday on a dedicated server, and as well as working relatively well, he said he loved the mission and that these flight instructor controlled malfunctions were really realistic, that it reminded him of the training simulators he's been in EDIT: it doesn't seem necessary having <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?player==pilot1 : computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] and <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">id001 = computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] Surely? Share this post Link to post Share on other sites
Metal Heart 0 Posted March 10, 2006 Yeah, you can cut the ?player checks from addactions because everyone will see the actions anyway. Also you have every addaction two times If the addaction command would be local, the correct syntax (if you need the ids) would be: ?player==pilot1 : id001 = computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] Share this post Link to post Share on other sites
Shashman 0 Posted March 10, 2006 If you look closely, you'll see that the 'duplicate' action is not actually a 'duplicate' <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">id001 = computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] Is accessed from one computer ( id019 = computer1 addaction ["***Mi-8 Malfunctions***",""] )and causes both chopper's engines to fail. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">id009 = computer2 addaction ["ENGINES Mi-8MT UN","unrepair.sqs"] Is accessed from another computer ( id020 = computer2 addaction ["***Mi-8 Repairs***",""] ) and repairs the chopper What do you mean by Quote[/b] ]Yeah, you can cut the ?player checks from addactions because everyone will see the actions anyway ??I thought this was a solution you gave to make the action only available to one player Also Quote[/b] ]If the addaction command would be local, the correct syntax (if you need the ids) would be:?player==pilot1 : id001 = computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] I don't actually need the ids, come to think of it... And by "local" you mean only available to pilot1? Share this post Link to post Share on other sites
Shashman 0 Posted March 10, 2006 On the subject of Mi-8 missions, I'm making another one, but I get this error I've tried <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">obj1&&obj2&&obj3 instead of and but I get the same error. This is what the trigger looks like Share this post Link to post Share on other sites
Metal Heart 0 Posted March 10, 2006 These both execute addaction command: ?player==pilot1 : computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] id001 = computer1 addaction ["ENGINES Mi-8MT UN","unengines.sqs"] So that's 2 times if client pilot1 is on the game. Like I said, I think the actions are always seen by all clients, no matter if only one runs the addaction command (who in this case would be the client that controls unit pilot1). But if it works, then the ?player thingy I suggested first is correct but I'm afraid it's not. And it won't surely work locally if you have this id001 = computer1... because it runs the addaction command on all clients. By local I mean the opposite of global, when some-mp-thing is local it effects only one client where as global effects all clients. For example, running script that fills ammo crate only on one client makes the ammo seen only on the client machine that ran the script, where as only one client running a script that creates some unit, say a tank, everyone sees it. Agghhh... head.. hurts... Share this post Link to post Share on other sites
Metal Heart 0 Posted March 10, 2006 Oh your passing an object (u prolly have object or variable named obj1, rename it) to something that expects a boolean (true or false variable). I think names obj1, obj2 etc are reserved for the mission objectives but can't remember or check right now. Share this post Link to post Share on other sites
Shashman 0 Posted March 10, 2006 ahhh thanks a million, seems to be working fine so far Share this post Link to post Share on other sites
Metal Heart 0 Posted March 10, 2006 No problem. Oh and by the way, I just tested this, the addaction command is local so the ?player==pilot1 thingy will work, just remove the extra addaction commands you had there. Share this post Link to post Share on other sites
Shashman 0 Posted March 10, 2006 So, to conclude; other than having the actions as radio commands, there's no way of hiding the actions from other players in MP? Share this post Link to post Share on other sites
Metal Heart 0 Posted March 10, 2006 No, exactly the opposite. When you do ?player==pilot1 : actid01 = computer addaction ["Run script","script.sqs"]; Only client that is pilot1 sees the action, I was right in the first place but then I read some old threads about the subject which had wrong information. Note that I might still be wrong as I tested it only with dedicated server by server-side addaction but I'm quite sure it works. Share this post Link to post Share on other sites