Tankbuster 1733 Posted July 13, 2017 _smgrp1 = [_deliverypos, west, (configfile >> "CfgGroups" >> "West" >> "Guerilla" >> "Motorized_MTP" >> "IRG_Technicals")] call BIS_fnc_spawngroup; { if ((vehicle _x) isKindOf "LandVehicle") then { (vehicle _x) setfuel 0}; }; } foreach (units _smgrp1); I don't want the technicals to drive off, but they are spawning with fuel. Am I doing this right? Share this post Link to post Share on other sites
killzone_kid 1326 Posted July 13, 2017 Wow! Easy on those curly brackets! 1 Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 Is it my bracketting that making the script not work? I assumed it was the way I was iterating through the group and picking the vehicle out of that Share this post Link to post Share on other sites
das attorney 857 Posted July 13, 2017 They're ok, but pointless imo. Anyway, is this SP or MP??? Share this post Link to post Share on other sites
killzone_kid 1326 Posted July 13, 2017 13 minutes ago, Tankbuster said: Is it my bracketting that making the script not work? I assume you are not a huge fan of -showScriptErrors? Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 5 minutes ago, killzone_kid said: I assume you are not a huge fan of -showScriptErrors? You assume wrong. Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 17 minutes ago, das attorney said: They're ok, but pointless imo. Anyway, is this SP or MP??? This is serverside, MP. They are AI for players to interact with. Share this post Link to post Share on other sites
das attorney 857 Posted July 13, 2017 Use remoteExec - setFuel command needs to be executed where vehicle is local. Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 When they are spawned, they are local to the server, where the script is running. They never get grouped with a player - I should have said that earlier. Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 Oh, and there's no headless clients involved. Share this post Link to post Share on other sites
das attorney 857 Posted July 13, 2017 8 minutes ago, Tankbuster said: When they are spawned, they are local to the server, where the script is running. They never get grouped with a player - I should have said that earlier. edit nvm Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 It doesnt happen in that order. The players don't (well, they needn't) get in the vehicles for a number of minutes after the spawngroup and script runs. Players actually arrive in a helicopter with a slingloaded huron box underneath. Their task is to put the box on the ground near the ai group, so most times, they aren't going anywhere near them Share this post Link to post Share on other sites
killzone_kid 1326 Posted July 13, 2017 15 minutes ago, Tankbuster said: You assume wrong. Strange, your script gives me a bunch of errors, but I'm glad it doesn't do this for you. Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 I'm a huge fan of your work and am always grateful for your contributions (my mission is littered with your stuff), but while you're taking the time to post, would you be good enough to actually help rather than be an arse? 1 Share this post Link to post Share on other sites
killzone_kid 1326 Posted July 13, 2017 4 minutes ago, Tankbuster said: I'm a huge fan of your work and am always grateful for your contributions (my mission is littered with your stuff), but while you're taking the time to post, would you be good enough to actually help rather than be an arse? What the hell? Run your script yourself with -showScriptErrors, it fails with a bunch of errors, what else there to help with? Check your script and amend it until it doesn't produce an error and come back. There, helpful? Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 Perhaps the underlying question is; The group that is returned by fnc_spawngroup - given that the optional parameters the function can accept include stuff like ammo, position, skill and direction, but not fuel, whats the best way of picking out a spawned vehicle so I can do something like setfuel? Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 2 minutes ago, killzone_kid said: What the hell? Run your script yourself with -showScriptErrors, it fails with a bunch of errors, what else there to help with? Check your script and amend it until it doesn't produce an error and come back. There, helpful? I'm not at the mission development machine right now. I got the code from my repository. I have a server with a dozen megabytes of RPT, I can assure you I'm familiar with the little black box showing errors too. I've been doing this since 2005. Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted July 13, 2017 Since you didn't get KKs hint from his first answer I'll give you another: { if ((vehicle _x) isKindOf "LandVehicle") then { (vehicle _x) setfuel 0}; }; } foreach (units _smgrp1); Count the curly brackets. Does the amount of opening and closing brackets match? Spoiler It doesn't. Cheers 2 Share this post Link to post Share on other sites
das attorney 857 Posted July 13, 2017 Ha ha yeah, I was looking at (), not {} ! Share this post Link to post Share on other sites
pierremgi 4739 Posted July 13, 2017 Just remove the extra } in your condition and the code works. You can remove this condition as well. 1 Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 Oh cock. Why is there an extra curly close after setfuel? That extra bracket isn't in the code in the repo but is in the OP. I think it got added when I added tabs and indentation. It works now, thanks all. :) Line 40 in show diffs; https://app.assembla.com/spaces/coop40-authority-altis/subversion/commits/1556 Share this post Link to post Share on other sites
Tankbuster 1733 Posted July 13, 2017 Technicals not driven off. :) https://steamuserimages-a.akamaihd.net/ugc/844839455827441215/36B37C0B4EF842444964216CBF3EB2B19F808EC6/ Share this post Link to post Share on other sites