Home   Help Search Login Register  

Author Topic: Finding Buildings through config  (Read 1986 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Finding Buildings through config
« on: 19 Oct 2007, 17:59:34 »
Hi all

i'm about to make a more realistic refuel routine which will include real-world fuel capacities of all vehicels and also a realistic fuel flow while refueling, so refuel a SU34 will take much longer than a UAZ.

To make it work properly, i need to "deactivate" all preplaced Fuelstations so that auto-refuel is no longer available. For sure i could just watch the map and collect all buildings manually, but this has the downgrade as i have to do this for all available islands and redo everytime a new island is released.

So my question, is it possible to scan the island config for these buildings and collect them in an array? It wouldn't need much info, in fact it's position would be enough.

If this is possible, i can make it work on any island without knowing it (future releases).

Any help welcome (glances to Mandoble  :D )


Myke out

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Finding Buildings through config
« Reply #1 on: 19 Oct 2007, 18:37:47 »
You cannot do config searches for buildings placed on the map because well they are not added into the configs. :(

You could do like an intensive nearestobject search for fuel stations and then record them in an array of sorts. The problem being is you would have to do this for each new island. You could make a helper mission which would run/find the nearest fuel stations, plop them into a dialog for easy cuting and pasting into an array.


Planck tells me the fuel stations are one of the few map objects in the configs  :)

« Last Edit: 19 Oct 2007, 21:26:23 by hoz »
Xbox Rocks

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Finding Buildings through config
« Reply #2 on: 20 Oct 2007, 22:50:20 »
thx hoz

do you know how i could access to these? As i said, i just need the positions of them, collected in an array, thats all.


Myke out

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Finding Buildings through config
« Reply #3 on: 21 Oct 2007, 00:18:31 »
I started to work on something last night but I haven't had a chance to day. Hopefully I can post something later this evening.
Xbox Rocks

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Finding Buildings through config
« Reply #4 on: 21 Oct 2007, 01:28:17 »
No hurry, as long as someone is working on an answer, i'm happy. Doesn't matter if the script is finished tomorrow or in 2 weeks...as long it works.  :D

If it comes to config reading, i'm lost, so i'm happy someone took care.

Another throw in while i'm on it: i guess there is no way to adjust the fuel load (not cargo, what vehicles need to operate) by just using scripts (except maybe some fancy setfuel looped scripts) of any vehicles. Just to note: make an addon is not an option as i want to have it addonless.

Why i ask: i saw that if a vehicle carries external fuel pods (like UH-60FFAR and the AV8B Sidewinder) it is not implemented, means no matter if external fuel pods available or not, the fuel cargo (time to fly with) is completely equal. So i guess it's impossible to overwrite these fuel setting from the vehicles config to a custom setting only using scripts.

Myke out

P.S.
Shame on BIS they didn't made the fuel pods usable  :D

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Finding Buildings through config
« Reply #5 on: 21 Oct 2007, 02:08:52 »
Don't think you can script it in, just the same as you can't give soldiers more health, but you could have a script test fuel level every 15 seconds (say) and give a one-use instant refuel with the message "fuel pods utilised" or something. Alternatively, add a "use fuel pods" action for pilots that refuels you completely once, which would prevent the need for a script to monitor fuel levels. In either case, you'd need to have a variable set on the aircraft on every machine to prevent multiple people refuelling the same aircraft.
« Last Edit: 21 Oct 2007, 02:13:16 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Finding Buildings through config
« Reply #6 on: 21 Oct 2007, 02:22:46 »
Thx Spooner, already guessed that. I don't think i'll script something like "fuel pods activated" since i try to use real world data to refuel these vehicles, it would be too messy to check if fuel pods are attached, then adjust max fuel cargo and according to this do refuel amount of X...blah.

I think i'll just go with the internal tanks and ignore the presence of the fuel pods.


Myke out

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Finding Buildings through config
« Reply #7 on: 23 Oct 2007, 18:43:45 »
You cannot find the buildings via the configs unfortunately. I did come up with a little tool which helps you find and build arrays of particular objects. Hope to finish it tonight.
Xbox Rocks

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: Finding Buildings through config
« Reply #8 on: 23 Oct 2007, 18:49:25 »
The issue of fuel availability definitely seems like an issue that comes up in many missions-- hopefully Bohemia will consider a global fuel toggle in a patch or in Armed Assault II.  I would love to see the answer too.  Here is a long shot idea:

Did you try using the Editor Update addon to identify the name of the gas station?  Maybe you could try the trick of placing the gas station on the map on an otherwise empty mission, then go into mission.sqm and see what the object name is?  Would that help in tracking it down within the config?  

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Finding Buildings through config
« Reply #9 on: 23 Oct 2007, 20:18:58 »
There are about 4 fuelstations, they all inherit from class "FuelStation".

So doing a search for anything that has a base class of "FuelStation" will give you a list of them all.

There is however something else that you can refuel from that is not a fuel station.

I'm sure you have all seen the large fuel tanks on sara, you can refuel from these as well, the smaller tanks do not do this however.

Just to complete the list:

Strategic:

    FuelStation
        Land_benzina
        Land_benzina_schnell
        Land_fuelstation
        Land_fuelstation_army
    Land_Fuel_tank_big

And there you have it.

EDIT:
Incidentally, the "Land_benzina" class is no good anyway, although the class has been declared and the model file has been pointed to in the config .... the model does not actually exist anywhere in the game.


Planck
« Last Edit: 23 Oct 2007, 21:57:45 by Planck »
I know a little about a lot, and a lot about a little.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Finding Buildings through config
« Reply #10 on: 23 Oct 2007, 20:56:10 »
I can find the objects, as long as I have the names and you can even use the config, but the config doesn't tell you the position of those fuel depots, you just have to use the nearestobjects command. Which can be taxing on the game if you do broad searches.
Xbox Rocks

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Finding Buildings through config
« Reply #11 on: 24 Oct 2007, 04:05:26 »
Just to note, you can refuel at barrels as well.