Pappy60 10 Posted October 6, 2009 Sadly I have invested about 40 hrs (much time spent learning) into a mission that I planned to put on my dedicated server but what works in preview and SP does not seem to work in MP, primarily triggers with a fair amount of code in them. I am still trying to figure out how to force AI out of a vehicle on MP using trigger code, but now I am starting to think it has do be done with scripts instead of trigger code. So the question is, on MP is using scripts better than using trigger code ? I figured trigger code would be more universal..... Share this post Link to post Share on other sites
shuko 59 Posted October 6, 2009 There's no such thing as "more universal". Either it's run or not run (trigger is true/false). In both ways the code is local to the player so it doesn't matter if its in the onAct field or in a separate script file. Most likely your problem is that the Arma engine is a piece of crap and you have to find a workaround for a workaround to do something. Share this post Link to post Share on other sites
[GLT] Legislator 66 Posted October 6, 2009 Sadly I have invested about 40 hrs (much time spent learning) into a mission that I planned to put on my dedicated server but what works in preview and SP does not seem to work in MP, primarily triggers with a fair amount of code in them. I am still trying to figure out how to force AI out of a vehicle on MP using trigger code, but now I am starting to think it has do be done with scripts instead of trigger code. So the question is, on MP is using scripts better than using trigger code ? I figured trigger code would be more universal..... Wrong question I'd say ... you've experienced the simple effects of locality. In SP mode you're server + client. On the dedicated server, you're only the client. Scripting commands will behave differently, it doesn't matter if they're in a trigger or a separate script file. By default the triggers inside the editor are global, I guess, so they're executed on both server + client if you don't set any other condition. Play around with the isServer command. It'll divide serverside and clientside actions. Sometimes an action (f.e. spawning units) only should take place on the server. As for your problem, have you tried the action command? YourUnitName action ["eject",YourUnitName]; Using this will cause the named unit to eject from the vehicle instantly. It doesn't matter if it's a car, a tank, a plane, a ship or a chopper. Share this post Link to post Share on other sites
Pappy60 10 Posted October 6, 2009 I was thinking isServer can only be used in scripts, not in a trigger? I have not tried ejecting them...I will try that now and see what happens.... ---------- Post added at 01:25 PM ---------- Previous post was at 01:08 PM ---------- No Joy, the eject does not work either....the ai is glued inside the chopper until I get out....if I get out they will get out and go to their waypoints... Share this post Link to post Share on other sites
Pappy60 10 Posted October 6, 2009 okay I tried "AND isServer" in my trigger cond line, also tried "if (not IsServer) then {exit};" in my activation and still I cannot get the AI to leave my helo unless I get out. In my trigger activation I have tried (unit name is vector) : vector LeaveVehicle (thisList Select 0); vector unassignVehicle (thisList select 0); vector action ["eject", vector]; vector action ["GETOUT", vector]; Nothing seems to get the AI out unless I get out of the helo ? I have a load waypoint , then a getin waypoint then a getout waypoint and unload transport waypoint. The ai move fine to the getin waypoint (I assignascargo in a trigger for the getin waypoint) at the getout waypoint they stay in the helo unless I (am pilot) get out of the helo, then they get out and move to the waypoints.... this has to be something stupid but I have yet to figure it out..... one thing that may be affecting it is that the helo starts out as an empty vehicle and I am flying it without waypoints for me or the helo.... Share this post Link to post Share on other sites
Big_Daddy 10 Posted October 6, 2009 Do you know the AI's leader? {_x action ["eject", vehicle _x];unassignVehicle _x;} forEach (units _leader); Or getout, or, or Share this post Link to post Share on other sites
Pappy60 10 Posted October 6, 2009 Simply by naming the ai leader right? yes he has a name but so do the other units ....I don't have them grouped in as much as I have not init them as a group but they are attached to the leader so ...I will try this... ---------- Post added at 04:52 PM ---------- Previous post was at 04:37 PM ---------- WOOOHOOOO !!!!! That worked !!!!! Share this post Link to post Share on other sites
[GLT] Legislator 66 Posted October 7, 2009 okay I tried "AND isServer" in my trigger cond line, also tried "if (not IsServer) then {exit};" in my activation and still I cannot get the AI to leave my helo unless I get out. I've no way to test it right now (hardware issues) but have you tried !isServer in the condition line of the trigger? Be aware that this will exclude the clients from executing the action. I doubt it'll make sense when using the eject stuff because it's executed on server and client anyway in this case. Share this post Link to post Share on other sites
bhaz 0 Posted October 7, 2009 okay I tried "AND isServer" in my trigger cond line, also tried "if (not IsServer) then {exit};" in my activation and still I cannot get the AI to leave my helo unless I get out. If you're going to use isServer inside the editor, it's probably easier to put it in the on activation field. ie: instead of hint "zomg i'm a server"; you could have if (isServer) then {hint "zomg i'm a server";} Though, if the script is complex enough to need it, you might be better off making it outside the editor then calling it with :( exec (*.sqs) or :) execVM (*.sqf) Share this post Link to post Share on other sites