General > User modifications

UFO scripting: guide to changing scriptable parameters

(1/4) > >>

H-Hour:
A lot of things in UFO:AI can be easily scripted using simple text files. This topic will tell you where to make changes for different parameters. Only post in this thread to request where to find a parameter you want to change. All other posts will be removed.

What are script files and how do I change them?
UFO:AI's script files can be found in the /base/ufos/ folder under your installation directory. This is where the game's executable and data is stored.

If you don't have a /base/ufos/ folder, you probably have several .pk3 files in /base/. You will need to unpack 0ufos.pk3 to view and modify the UFO files.

Note: On Windows systems, save games and other data is often stored in a different directory, also under a /base/ folder. This is not the directory you want to look in.

How can I change a weapon's damage, accuracy, etc.?
You will find all of the weapons stored in /base/ufos/weapon_*.ufo files. Our wiki contains descriptions of weapon script parameters.

How can I reduce/increase the frequency of UFOs?
You will find a campaign scripting parameter called uforeductionrate in /base/ufos/campaign.ufo. Our wiki contains further details on how this parameter is used.

Note: This feature is only available in version 2.5 and above. It was added to 2.5's development version on 17 June 2012.

How can I reduce/increase the speed of research?
Research is controlled in two places. If you would like to adjust the research time required for a single item, you should look at /base/ufos/research.ufo, find the appropriate research item and change the time) parameter. Our wiki contains further details on research definitions.

If you would like to speed up or slow down all research, you should look at /base/ufos/campaign.ufo and change the researchrate parameter. Our wiki contains further details on how this parameter is used.

Note: The research speed parameter in campaign.ufo is only available in version 2.5 and above. It was added to 2.5's development version on 17 June 2012.

How can I make my new recruits have better stats?
You will find character templates stored in /base/ufos/team_templates.ufo. Our wiki contains further details on how to set their stats.

How can I change the price and stats of my aircraft?
You will find aircraft defined in /base/ufos/aircraftmanagement.ufo. Our wiki contains further details on how to set their price and stats.

How can I change the cost of my base buildings and installations?
You will find base buildings and external installations defined in /base/ufos/basemanagement.ufo. Our wiki contains further details on how to change the costs.

How can I change the layout of my first base?
The base template is defined in /base/ufos/basemanagement.ufo. Our wiki contains further details on base building parameters.

How can I make a certain map stop appearing in my campaign?
The maps are defined in /base/ufos/maps.ufo. To prevent a map from appearing in the campaign, add a campaign parameter set to false. Our wiki contains further details on map parameters.

Warning: Map usage in the campaign is determined based on a set of culture, terrain and population parameters for every spot on the globe. If you remove the only map available in that combination, you are likely to get the backup ufo_crash map which already appears frequently in the campaign.

How can I change the frequency that alien weapons appear?
The percentage chance that weapons will appear in a mission are defined in /base/ufos/equipment_missions.ufo.

NicSO:
Is it possible to change % of appearances of alien weapons?

In 2.5 I encountered plasma pistol only in first few missions and never again + kerrblade never occured.

ShipIt:

--- Quote from: NicSO on February 11, 2014, 03:09:06 pm ---Is it possible to change % of appearances of alien weapons?

--- End quote ---

/base/ufos/equipment_missions.ufo is the place to go.


--- Quote from: NicSO on February 11, 2014, 03:09:06 pm ---In 2.5 I encountered plasma pistol only in first few missions and never again + kerrblade never occured.

--- End quote ---

Yep. Thats a problem we met recently.
1st -there was a problem hidden within the auto-equip code (see bugreport). Thanks to DarkRain the fix is already in place.
2nd - The related script files were changed when H-Hour made a huge weapon rebalancing before 2.5 branched. Apparently this needs some further adjustments. For the Kerrblade I made a quick-fix, that should also already work in 2.5.

xray:
I was looking into the ui/*.ufo scripts, more specifically the scripts controlling the management of soldier equipment. I wanted to create a way to add the selected equipment to all soldiers in the soldierslist panel. However I seem to get stuck since I cannot figure out how to iterate the nodes in the panel. Is there a way to iterate a set of nodes? Are there any examples of this type of behaviour?

I appreciate any help/hints.

geever:

--- Quote from: xray on May 09, 2014, 02:11:20 pm ---I was looking into the ui/*.ufo scripts, more specifically the scripts controlling the management of soldier equipment. I wanted to create a way to add the selected equipment to all soldiers in the soldierslist panel. However I seem to get stuck since I cannot figure out how to iterate the nodes in the panel. Is there a way to iterate a set of nodes? Are there any examples of this type of behaviour?

I appreciate any help/hints.

--- End quote ---

Unfortunately currently there is no way to iterate trough nodes of a panel from the UI scripts. In some cases you could do a counting loop 0..n and assemble node ids from it using the <injection> method but I think it would not work for the soldierlist as it is uses the UCN numbers (IIRC) which are not continuous.

For such functionality you need to write a C callback now. :(

I would be happy to see such a foreach loop possibility in the UI Engine though. If you could implement it, I would be happy to add it to the codebase!

-geever

Navigation

[0] Message Index

[#] Next page

Go to full version