Disabling Auto-Refuel and Auto-Repair (Lingor Island)

Deathcall

Well-Known Member
Hello everyone.

I used the search function but I couldn't find anyone bringing this up... Sorry if it has already been discussed.

Well, my question to you is rather plain. Is there a way to remove auto-refuel and auto-repair from Lingor Island?

I see people wanting to add these functions to other maps but I ask myself... Isn't this a zombie apocalypse survival game? Fuel is vital, acquiring it should be one of the main concerns of any survivor with a vehicle. It can't be good for the survival aspect of the game to have it so people can just drive up to a gas-pump and sit idling in the driver's seat while the vehicle magically refuels itself. Not to mention the fact that some hangars in Lingor not only refuel, but also automatically REPAIR.

Well, the point here is not to argue if these functions are good or bad, as I'm sure a lot of people like them and prefer they stay as it is. I respect everyone's opinion on the matter, but for my own server, I'd like it to be disabled.

I've been looking into the mission file, the server file, Lingor Mod files and DayZ mod files, but I'm simply not smart enough to figure out what actually makes it so these buildings work the way they do.

Does anyone have any clues about this? At least where specifically I should look?

Thanks in advance, I'll appreciate any advice you can give me.
 
Can anybody help with this?

I've been looking into the files and I'm pretty sure it's not the mission file or the server file that 'causes the auto-refuel and the auto-repair. It must be in the Lingor Mod files, but I look and look and can't find where to edit in order to remove it!
 
Well, I've progressed a little bit.

Initially I thought that I could somehow disable this mod-side, but that road proved fruitless. First I can't find the file that makes it so auto-refuel works, and second, I can't think of a way I'd be able to modify it and then not have everyone who joins my server have to download a new mod.

So I scratched that and went to the mission editor.

I guessed that it was the fuel pumps at the gas stations that have the mechanic, so I thought how I could get rid of them.

First, following my basic instincts, I blew them up. Sure enough ,once they blew up, no more auto-refuel.

Second, seeking a less dramatic solution, I used hideObject on them, even though they were invisible, they still kept refueling.

Third, looking for another solution, I used enablesimulation and set it to false. Sure enough they pumps are there, but they don't work anymore.

So for now, I can make it so every pump and auto-refuel, auto-repair building in the map doesn't work. It'll be a hellish work because I have to go building by building, looking at their IDs on the 2D map, but it might be worth it.

I'm uploading a file so you can see the results. Had to ZIP it because it won't let me upload an SQM for some reason.
 

Attachments

  • NoMoreGas.zip
    839 bytes · Views: 22
Yes and no.

I've found a way to disable gas stations and fuel depots, but I haven't tried it on a live server yet. The procedure is rather simple once you know what you are doing:

1) Open your editor and select the map you want to work with.
2) Find a fueling station to serve as test subject.
3) Create a game-logic and put it on-top of the object.
4) Put this on the logic's init:

Code:
{_x enableSimulation False} forEach ((getPos this) nearObjects ["Building",25])

Explanation

The way this command works, it'll disable simulation on every object of the given type on the given radius from the position of the game-logic you place. In my tests, this effectively stops the auto-refuel from happening.

The kind of object affected is set between inverted commas, on this example, it's "Building", while radius is the number after it, on this case, 25 meters. Building works well for gas pumps and fuel pumps (in Lingor, Gas Stations and those camo netted fuel tanks), if you want to disable a hangar, you'll need to switch it with "House". I wouldn't recommend using a huge radius, it might lag the server and affect unintended objects.

5) Save and restart.
6) Spawn yourself a vehicle and see if it works for you.

Notes

First and foremost, let me repeat myself: This is not live-tested. I've tested it on the editor, with the mods enabled, and it works, but sometimes even if things work off-line, they don't on-line.

Second, I've encountered weird problems when trying to create an easy to deploy script using the same command on game-logics. For some reason, the way I do scripts (which is far from being optimal since I'm a newby and my knowledge is extremely limited) creates problems and floods the .rpt logs with errors. I did not find a way to solve this so instead of using game-logics I'm using invisible objects to make it work as intended.

Example

This is meant for Lingor, since I haven't worked on Panthera yet.

1) Open your editor (3D is better for this) and create a mission, name it whatever you want.
2) Go to your mission folder and create a new .sqf file and name it whatever you want.
3) Paste the following in it and save it:

Code:
// BENIO GAS STATION
 
_vehicle_5 = objNull;
if (true) then
{
  _this = createVehicle ["ClutterCutter_small_2_EP1", [1250.0022, 5556.4038, 6.3631039], [], 0, "CAN_COLLIDE"];
  _vehicle_5 = _this;
  _this setVehicleInit "{_x enableSimulation False} forEach ((getPos this) nearObjects [""Building"",25])";
  _this setPos [1250.0022, 5556.4038, 6.3631039];
};
processInitCommands;

4) Create a new .sqf and name it "init".
5) Open this new file and paste the following, then save:

Code:
[] execVM "YourFileName.sqf";

6) Restart your mission on the editor and see if it works.

And that should be it. It works for me, should work for you. The code is SUPER rough, I'm sure someone who knows what he's doing can probably do this much better, but nobody seems to care about this particular subject, so I guess we'll stick with this until someone with actual scripting skills finds time to deal with it.

EDIT: Not sure if it obvious or not... test the script with the Benio Gas Station on Lingor, should be a bit east of the city if you follow the road, can't really miss it.
 
You can probably avoid using init commands if you tweak the code a little bit, I did some short attempts at that but I couldn't get it to work properly.

I still believe it's just something I'm doing wrong like the way I'm writing commands or the variables or something of the sort. In my opinion it's preferable to avoid the init commands because I've experienced problems with syncronization and latency on other scripts... I might be wrong though.

EDIT

Also, the "vehicle_5" part of the code is a left over from the copy-paste I did from the 3D mission file. It's probably not crucial for the functionality of the scritpt and could be changed to anything you wish as long as every reference to the term is changed accordingly across the entire script.
 
I tested it on my community's server today. It works properly, had to set some remoteexec exceptions though, because of the commands "enable" and "for".

Now to add some custom fuel tanks... I need some help with something though, will ask around in the Lingor support forums script forums.
 
Alright, guess it's working... for now.

In case anyone wants to try it out, here's the step by step.

1) Unpack your mission file.
2) Download this and this.
3) Paste the scripts on your mission folder.
4) Open your init.sqf
5) At the bottom add the following lines:
Code:
[] execVM "DRR.sqf";
[] execVM "AFD.sqf";
6) Re-pack your mission file.

NOTES

Remember there will be some remote execution restrictions coming from the DRR file, you'll have to add the proper exceptions or set "enable" and "for" so they only log actions (1).
 
The "DRR.sqf" script is way too rough and causes performance issues (minor lockups every 30 to 60 seconds server wide), had to disable it. I'm working on something lighter.

If I get anywhere, I'll post new results here.
 
Alright so I have rewritten the code to make it simpler, but it still requires a different call for each group of buildings... Can anyone help me out with this? Here's what I need...

These are the commands that mark each refueling and repairing spot in Lingor:

Code:
          [2985, 5054] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [1250, 5556] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [2864, 7102] nearObjects ["land_ibr_hangar",100];
          [2922, 6850] nearObjects ["land_ibr_hangar",50];
          [3103, 6560] nearObjects ["Land_fuelstation_army",25];
          [4415, 6799] nearObjects ["Land_fuelstation",25];
          [4163, 7526] nearObjects ["Land_fuelstation",25];
          [4654, 5542] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [5537, 5042] nearObjects ["Land_fuelstation_army",25];
          [6590, 5730] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [6760, 6194] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [6658, 6838] nearObjects ["Land_fuelstation_army",25];
          [8596, 7713] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [8329, 8298] nearObjects ["Land_fuelstation_army",25];
          [6963, 4754] nearObjects ["Land_fuelstation",25];
          [6621, 4617] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [1994, 4573] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [2863, 3535] nearObjects ["Land_fuelstation_army",25];
          [1326, 1454] nearObjects ["Land_fuelstation",25];
          [581, 1400] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [3306, 1631] nearObjects ["Land_fuelstation_army",25];
          [3892, 1416] nearObjects ["Land_fuelstation_army",25];
          [4122, 1366] nearObjects ["Land_fuelstation_army",25];
          [4469, 1568] nearObjects ["land_ibr_hangar",100];
          [4437, 1770] nearObjects ["land_ibr_hangar",150];
          [4156, 2019] nearObjects ["Land_ibr_FuelStation_Feed",25];
          [7409, 1809] nearObjects ["Land_fuelstation_army",25];
          [8369, 2606] nearObjects ["Land_ibr_FuelStation_Feed",25];

I need to find a way to group all of these so I can use a single command to disable them.

The way I disable the stations is pretty rough, but it works, here's the code:

Code:
 {_x enableSimulation False} foreach [_Station];

Anyone able to help?
 
So I came up with this:

Code:
_AllFuel = ([2985, 5054] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // VIDORA GAS STATION
          ([1250, 5556] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // BENIO GAS STATION
          ([2864, 7102] nearObjects ["land_ibr_hangar",100]),                  // FOB EDDIE NORTH HANGARS
          ([2922, 6850] nearObjects ["land_ibr_hangar",50]),                  // FOB EDDIE CENTRAL HANGARS
          ([3103, 6560] nearObjects ["Land_fuelstation_army",25]),            // FOB EDDIE GAS PUMP
          ([4415, 6799] nearObjects ["Land_fuelstation",25]),                  // RESEARCH LAB 101 GAS PUMP
          ([4163, 7526] nearObjects ["Land_fuelstation",25]),                  // GAS PUMP AT 41-75
          ([4654, 5542] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // TUCOS GAS STATION
          ([5537, 5042] nearObjects ["Land_fuelstation_army",25]),            // CHECKPOINT OESTE GAS PUMP
          ([6590, 5730] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // MARUKO SOUTHERN GAS STATION
          ([6760, 6194] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // MARUKO NORTHERN GAS STATION
          ([6658, 6838] nearObjects ["Land_fuelstation_army",25]),            // MAF GAS PUMP
          ([8596, 7713] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // CONOTETA GAS STATION
          ([8329, 8298] nearObjects ["Land_fuelstation_army",25]),            // VILLA GOMEZ GAS PUMP
          ([6963, 4754] nearObjects ["Land_fuelstation",25]),                  // MANTERIA GAS PUMP
          ([6621, 4617] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // MANTERIA GAS STATION
          ([1994, 4573] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // MOTODROME GAS STATION
          ([2863, 3535] nearObjects ["Land_fuelstation_army",25]),            // LOS PELIGRON GAS PUMP
          ([1326, 1454] nearObjects ["Land_fuelstation",25]),                  // PINTOSA GAS PUMP
          ([581, 1400] nearObjects ["Land_ibr_FuelStation_Feed",25]),          // ZUELA GAS STATION
          ([3306, 1631] nearObjects ["Land_fuelstation_army",25]),            // RALON GAS PUMP
          ([3892, 1416] nearObjects ["Land_fuelstation_army",25]),            // CALAMAR GAS PUMP
          ([4122, 1366] nearObjects ["Land_fuelstation_army",25]),            // AES GAS PUMP
          ([4469, 1568] nearObjects ["land_ibr_hangar",100]),                  // AES SOUTHERN HANGARS
          ([4437, 1770] nearObjects ["land_ibr_hangar",150]),                  // AES NORTHERN HANGARS
          ([4156, 2019] nearObjects ["Land_ibr_FuelStation_Feed",25]),        // CALAMAR GAS STATION
          ([7409, 1809] nearObjects ["Land_fuelstation_army",25]),            // EL VILLON GAS PUMP
          ([8369, 2606] nearObjects ["Land_ibr_FuelStation_Feed",25]);        // PALIDA GAS STATION
 
          {_x enableSimulation False} foreach _AllFuel;

But it only works for the first item (Vidora Gas Station), not for the others...

I REALLY need some help here, I've been at this for days, can't figure out a way to make it work without doing a {_x enableSimulation False} for EACH item...
 
will the newest lingor map works on this scirpt? becoz i add
Code:
[] execVM "DRR.sqf";
[] execVM "AFD.sqf";
into my init file and put both of the file in the mission folder...but nth happens
 
The AFD file will only add new fuel tanks across the map, make it easier for players to find places to refill jerry cans. It should work if make the call for the script.

The DRR I'm not sure. Even after getting it working, I had to disable it because people hated having to actually work for fuel. It was making me lose players...

In any case, enableSimulation is a command that must be run locally. Try removing the if (isServer) then { from the top and the last }; on the bottom, that might be it.

EDIT: Sorry, I'm kinda rusty on this script since I haven't used it much.
 
Back
Top