Jump to content
Sign in to follow this  
[aps]gnat

Ingame read Addon and Config path detail

Recommended Posts

Prompted by Q wink_o.gif

1)

While ingame and in a script, is there a way to read the detail of an known addons config.

i.e. If addon XYZ_Heli is running, what is the driver model definition or what is the number of cargo positions or what is the path to the p3d

2)

While ingame and in a script, is there a way to read the detail of an known addons LOCATION.

i.e. Addons get saved many different places on a users computer, but can I in a script find the full (ArmA) path to say the p3d of known addon XYZ_Heli ?

The reason for asking. I'd like to make my ships allow various choppers to sit on the back of them while moving. The only real way to do it is to lock a p3d proxy of each on the back.

For known BIS addons, its easy. For community addons, the p3d is know, but the path to it can vary too much.

Share this post


Link to post
Share on other sites

would a simple way round it be have the addon/mod folder @Gnat and if anyone wants to use a helo with the ships it has to be in that folder?

Share this post


Link to post
Share on other sites
would a simple way round it be have the addon/mod folder @Gnat and if anyone wants to use a helo with the ships it has to be in that folder?

Sure Southy ..... but you know how many problems you get when people don't read the Readme's ... wink_o.gif

Plus its a lot restrictive for Online play and servers and custom missions. Be much better if the ship addon itself could find the nessisary info.

Share this post


Link to post
Share on other sites

you can read config like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">getText(configFile >> "CfgVehicles" >> "AddonClassname" >> "model")

This would give you the path of the model like it was defined in the config.

Share this post


Link to post
Share on other sites

Just a side note: Depending on the data type of the config entry you have to use different parse commands: getText / getNumber / getArray

Share this post


Link to post
Share on other sites
Quote[/b] ]For known BIS addons, its easy. For community addons, the p3d is know, but the path to it can vary too much.

As T_D said you can read configs easy enough. But once you have the path to the p3d. I’m not sure what you can do with it, when it comes to changing your ships p3d or config?

AFAIK You can't change a P3D's content using scripts, only turn stuff on and off. Which is probably a good thing from the aspect of a potential cheat?

Certain config values can be influenced using scripts during Arma's startup. Scope being one of them. But your limited to numeric values only AFAIK. If the engine expects a string (like the path to a p3d) it will read it as a string and will not execute a function.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×