User Tools

Site Tools


cw4:cmod:docs:e560de12-b7fe-4a15-afe3-9b76ea1fe5f2

Index

City Warehouse

How to use

Simply connect it up to your network. Viola! You now have access to the city's energy and resource production.

If you want more details on what the city produces (and how much of it) then select the warehouse.

The “Energy per warehouse” is how much bonus energy production you get for each warehouse you are connected to. The “Bluite +”, “Redon +” and “Greenar +” values are how much the city produces per second of those resources. It is not per warehouse, these values are global. Lastly, the “Stores” will show you if the city has any stockpiles of resources (the production of the city is added to these each second). As long as there is at least 1 of a resource in stockpile, the warehouse can output that resource for you if you need it.

Description

A logistical complex dedicated to moving various goods and resources around the colony / city. Battlefield commanders can pull energy and resources from the local grid by connecting to these structures, and can get additional information about what resources are available. Protect these structures at all costs, as losing them is a significant blow to any battlefield operations.

For Map Makers

If you have city buildings (units that make use of the “CityWarehouseFiller” script), then you need at least 1 of these on the map for the player to be able to access that production.

Having multiple of these splits energy production between them, but otherwise just gives the player more network points to pull resources from. The max a single warehouse can output of a single resource is 30 per second (since 3 frames). So if your city is large enough to produce more than 30 per second of resource, then you should have multiple warehouses.

The script for this warehouse unit makes use of global variables. See the script for more details.

To avoid lag of multiple units processing each tick, the “CityWarehouseFiller” units only update their production on construction and subtract it again on Destroyed. This means that if you update unit instances, you can end up with broken production values. The units have a means to recalculate from scratch for these situations. To trigger this, refer to the console script below.

In the case that you make unit updates after already having placed down warehouses or “CityWarehouseFiller” units, then run-once the below console script to have the production properly recalculated on the next game tick.


CityProductionReset.4rpl
# CityProductionReset
 
# Run this script if you want the city production to be recalculated from scratch.
# Should be run if you have changes building values or done a “Update all unit instances” while editing the map after buildings are already placed.
 
0.0 ->*CITYBUILDUPBLUITE
0.0 ->*CITYBUILDUPREDON
0.0 ->*CITYBUILDUPGREENAR
 
0 ->*CITYLASTUPDATED
 
0 ->*CITYPRODENERGY
0 ->*CITYPRODBLUITE
0 ->*CITYPRODREDON
0 ->*CITYPRODGREENAR
 
$WAREHOUSE_GUID:“e560de12-b7fe-4a15-afe3-9b76ea1fe5f2”
GetUnitsByType(<-WAREHOUSE_GUID 1) ->warehouseList
GetListCount(<-warehouseList) ->*CITYWAREHOUSECOUNT
 
GetGameUpdateCount ->*CITYPRODRECALCNEEDED

Index

cw4/cmod/docs/e560de12-b7fe-4a15-afe3-9b76ea1fe5f2.txt · Last modified: 2021/03/20 06:43 by UberWaffe