Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

5 Neutral

1 Follower

About Sokoloft

  • Rank

Profile Information

  • Gender

Contact Methods

  • Steam url id
  1. Based on that info, I re did the trigger on condition since I don't see getVariable in the script {_vehicle = _x; if (typeOf _vehicle in ["CLASSNAMEHERE"]) then { if ((_vehicle getVariable ["autounload",0]) == 0) then { _vehicle setVariable ["autounload", [_vehicle, this] spawn fnc_autounload_trg ,true]; };};} forEach thisList; this However I still get an error: Thanks :D
  2. So, this is the error that pops up in the black box, really don't know what I'm doing >_< Not sure what to do, let me know! Will check back tomorrow when I feel better.
  3. Hey @theend3r, I tried adding (systemchat "Debug 1";) after every line, however it will only do the last entry. Probably because it was past the ending }; idk tho, plus it only throws the error when the specific vehicle goes into the area. So if I execVM it just goes through, what should I do, this is what I've got: fnc_autounload_trg = { systemchat "Debug 1"; params ["_veh","_trigger"]; systemchat "Debug 2"; while { _veh inArea _trigger} do { systemchat "Debug 3"; if ((_veh animationPhase "ramp_rotate") == 0) then { systemchat "Debug 4"; if (speed _veh < 5) then { systemchat "Debug 5"; _veh animate ["ramp_rotate",1]; systemchat "Debug 6"; sleep 1; systemchat "Debug 7"; { _unit = _x; systemchat "Debug 8"; unassignVehicle _unit; systemchat "Debug 9"; doGetOut _unit; systemchat "Debug 10"; _unit action ["Eject",_veh]; systemchat "Debug 11"; sleep 0.5; systemchat "Debug 12"; } forEach crew _veh; systemchat "Debug 13"; }; }; if ((_veh animationPhase "ramp_rotate") == 1) then { systemchat "Debug 14"; if (speed _veh > 5) then { systemchat "Debug 15"; _veh animate ["ramp_rotate",0]; systemchat "Debug 16"; }; }; sleep 1; systemchat "Debug 17"; }; _veh setVariable ["autounload",nil,true]; systemchat "Debug 18"; }; systemchat "Debug END"; Let me know were I went wrong! Thanks!
  4. Hey das, I should of known that! I changed it however now I'm just getting more errors. Tried to fix it but yet again I don't know what I'm doing, maybe you can find were the error is, either that when @Tajin checks out the forum post he can look at it, but this is my fn_autounload_trg.sqf file: params ["_veh","_trigger"]; while { _veh inArea _trigger} do { if ((_veh animationPhase "ramp_rotate") == 0) then { if (speed _veh < 5) then { _veh animate ["ramp_rotate",1]; sleep 1; { _unit = _x; unassignVehicle _unit; doGetOut _unit; _unit action ["Eject",_veh]; sleep 0.5; } forEach crew _veh; }; }; if ((_veh animationPhase "ramp_rotate") == 1) then { if (speed _veh > 5) then { _veh animate ["ramp_rotate",0]; }; }; sleep 1; }; _veh setVariable ["autounload",nil,true]; Thanks again! Edit: Error generic error in expression?
  5. Hey man, been busy the past couple days and haven't had time to look at the post. I tried that condition field, but I still get the error on the script on this line, says it's missing a ) and I'm not sure were, maybe you do? if ((_veh animationPhase "ramp_rotate") = 0) then { Thanks again, hope to hear from you soon!
  6. Hey man, thanks for not forgetting about me! I tried fnc_autounload.sqf and I got a result, the AI disembarked, however they get slaughtered by both hostile MG's and the driver of the boat itself, because sometimes the boats get caught up on coastal defenses, and the AI have to navigate there way in, it thinks that it has come to it's final resting point. So possibly a longer sleep between speed checks? Maybe a 10 second sleep, and as well as changing the speed to open the door to maybe like 2-3 kmh. As well as a stop command for the driver, so he doesn't run over friendly's disembarking. As for the second method, I got the condition field entered and configured correctly. However when it goes to call it says there is an error on this line, missing )( someweres. if ((_veh animationPhase "ramp_rotate") = 0) then { Thanks so much again! Almost there for a pub release on my mission! Just need to configure ALiVE and other odds and ends like this! Hope to hear from you soon! Edit: Any surviving AI try to return to the boat, is it possible to have a command to tell the AI to advance at a certain bearing? Going to look into the command, just don't know were to implement it, probably towards the end once they disembark? Not sure
  7. Well, as for the first solution fnc_autounload I couldn't get to work, says there is an error between the following line and the ending line } forEach crew _vehicle; and }; As for the second solution I tried first, I couldn't get the code to go into the on condition field, it said "Type nothing, expected bool"?? So a true or false some weres? Not sure, thanks for the info! Hope to hear from you soon!
  8. Hey! I got all my fnc's running via that method, so I can view all of my mission related fnc's via the fnc viewer. However it's being a bit weird to my other fncs, but I'll ask theend3r about that. Now back to trying to get units to disembark automatically, I got your bit of code to open the door! However, it doesn't have them get out, and so far I've only tested it to were the player drives it into the zone, but it should be the same for AI as well if they're the driver. Going to see now, but any idea's? Thanks! PS: I also have multiple vehicles doing this, with a lot of AI getting out from them. Edit I let it go for a good maybe 20 minutes in the background, and the AI navigate the landing defences, and get to the point to were they open up the doors, however no one gets out :( How would we go about making it to were it's the vehicles model name? So if one spawns in via another script I have "VVS" It has the same things happen to it? Thanks so much man!
  9. Hey @Tajin thanks for the info, going to double and maybe even triple check that documentation during the course of the afternoon and when I can I'll start implementing it to my mission. Reading over it once indicates that this is the method that some of my other downloaded scripts like VVS or bons Inf recruit system use, and then is called via the #include option in my desc.ext if I make a cpp or hpp. Thanks again! Will post once I have any news!
  10. Hey there! Thanks for the response, now from reading what you guys said, I'm taking it doesn't matter if I have the code in the init.sqf or have it defined in the init.sqf as the following, just to keep my init clean: fnc_autounload = compileFinal preprocessFileLineNumbers "scripts\functions\fnc_autounload.sqf"; Even having the code @Tajin provided in the init.sqf still does the same thing, it doesn't throw any errors, do I just have it configured incorrectly? I have the following in my fnc_autounload.sqf fnc_autounload = { params ["_vehicle", "_trigger", "_spd","_roles"]; waitUntil {sleep 1; (speed _vehicle < _spd) && (_vehicle inArea _trigger)}; _vehicle animate ["ramp_rotate",1]; sleep 1; { if ((_x select 1) in _roles) then { _unit = _x select 0; unassignVehicle _unit; doGetOut _unit; _unit action ["Eject",_vehicle]; sleep 0.5; }; } forEach fullCrew _vehicle; waitUntil {sleep 1; (speed _vehicle > _spd)}; _vehicle animate ["ramp_rotate",0]; }; is it due to it being defined twice by the fnc_autounload = { ??? Not sure, might try that. Or should I have all of my functions in one .sqf and have each of them defined fnc_fncname = { then execVM the script in my init.sqf so there's 1 line instead of 4 via compileFinal??? Not sure, thanks so much guys! Slowly starting to understand this stuff :D
  11. What's the difference in the way I call it? I would imagine another way to do it would be to make a sqf and call it functions.sqf, with each function defined via fnc_name = { then execute it in my init.sqf via execVM??? Not sure, new to all of this so, let me know if it matters! Thanks again!
  12. I tried the above and still no success, any idea's? nul = [this, missionarea, 5, ["Cargo","Driver"]] spawn fnc_autounload; It isn't even triggering the the door's to open or anything, neither is it telling me if there is an error or not. Not sure if that's a good sign or not but I'm not sure were to go from here. Thanks for all the help! PS: I don't have it in my init.sqf, instead it is it's own .sqf, called in the init by the following line, does that matter or not? fnc_autounload = compileFinal preprocessFileLineNumbers "scripts\functions\fnc_autounload.sqf"; as well as it's still defining itself with fnc_autounload = { does that matter? Let me know! Thanks!
  13. Well it's a good thing to know I'm learning, had already added the _vehicle in front of the animate commands but copied it over again for good measure and still no luck. I'm calling it how @theend3r said, with nul = . However it does nothing, I have a trigger named missionarea, does it need to be a marker or anything different? Not even getting an error :/ I'm calling it via the following in my vehicles init nul = [this, missionarea, 5, ["cargo","gunner","turret","commander"]] spawn fnc_autounload; It just dawned on me that the array might not be configured correctly for my aplication, the boat has 36 passenger seats, and 1 driver seat, so I would imagine I would want ["passenger","driver","cargo"] , gonna go test. Is cargo passenger's because they aren't even getting out :( edit: loading up atm trying: nul = [this, missionarea, 5, ["cargo","driver","passenger"]] spawn fnc_autounload; edit2: Still no luck, any idea's?
  14. Thanks for the reponse! Trying this now, however I had to change spawn to call to be able to put it into the vehicles init. I loaded in and it says there is an error on line 9 missing ; line 9 = animate ["ramp_rotate",1]; to get that command working in game in my testing, I had to use it's defined name I gave it in the editor, so boat1 for example, so: boat1 animate ["ramp_rotate",1]; however, all the boats are defined via an array, in my init, since I have a script that spawns AI into them that way. init line is structured like this: vehicleArray = [boat1, boat2, boat3] how would I make it to were animate uses the vehicle array? is it a different command? I just want it to work at this point, not looking for anything fancy! xD So: vehicleArray animate ["ramp_rotate",1]; ??? Many Thanks! Edit Doing that actually would open all the boats doors >_> Which is not what I want, would it just be "this" instead? Edit2: Just ran the following through my dev console and it went through, gonna check: this animate ["ramp_rotate",1];
  15. Hey! I've been messing with the code that @theend3r gave me and I've come up with this: _handler = [] spawn { waitUntil {sleep 5; speed VARNAME isEqualTo 4}; {unassignVehicle _x} forEach crew this; VARNAME animate ["ramp_rotate",1]; waitUntil {sleep 5; speed VARNAME isEqualTo 5}; VARNAME animate ["ramp_rotate",0]; }; However, on the waituntil line it tells me that after speed "VARNAME"(Was "this") isn't the right variable. Bare with me, I have a vehicleArray = [bunch,of,Var,Names] defined in my init, how would I make it to were it does it to all of the vehicles in the vehicleArray? Tried replacing "VARNAME" with vehicleArray however it throws errors again. Would it be _x and were? Essentially what I want is a fnc that will disembark/open the door once any defined vehicle in the vehicleArray is below 4 kmh. (only in trigger zone) If it goes over 5 kmh(only in trigger zone), the door will close. However, I need this to only work in a specific area, so the fnc would be called by a trigger, and any vehicle defined in the vehicleArray that enters that trigger zone has that fnc applied to it? Still new to all of this, so how would I go about doing that? Thanks! As well as @Tajin I realized you can copy paste from the cfg viewer. Looking at the open door statement, is a long string with many different fnc being called. Not really sure what it all means and I don't think that I can make it applicable to my application. I was just wondering if there was any simple way of doing a player action to simplify things. Like a fnc_doplayerAction or something. Would be handy for simple workarounds like this! So instead of my animate commands, I could use the fnc instead, Ex: ["VARNAME/ARRAY", open_ramp] call fnc_doplayerAction ["VARNAME/ARRAY", close_ramp] call fnc_doplayerAction As well as when the player opens the door, the units auto disembark, therefore I wouldn't have to have the unassignVehicle command or doGetOut. Forgot to put doGetOut as well in the script. Is there a fnc out there that already does that? If so which one?? Thanks again!