User Tools

Site Tools


cw4:cpack:docs:f3d1b56c-fb68-49a9-909e-54931da7635d

Index
Custom CPACKs & Units
VPAC Wiki Page
VPAC CPACKs download location.

:TODO:
MAJOR UPDATE NEEDED - POWER SYSTEM
MAJOR UPDATE NEEDED - REBUILD.
MAJOR UP- Ok forget listing,
THIS PAGE NEEDS UPDATING! -Vertu

VPAC Main - Vertu

The VPAC Main provides the essentials and basics of Play As Creeper. Compared to standard PAC (VPAC Main's ancestor), everything here has been “completed”. Examples being the addition of the ability for Launchers to hold fire and the rebuild system including terraforming (ability to rebuild land from say, Shattered Land dissolved by Creep).

Units (CMODS) in this CPACK

Pre unit runtime scripts

POWER SYSTEM

This script runs while paused to manage how much power you have. It evaluates the current amount of power available to the player.
The power use of all VPAC units currently on map and the bonus available power from say, abducting ERNs with the NEXUS and destroying Power Suppressors, is calculated here as a sort of final destination. This is using a global list as an unfinished equation where each CPACK wanting to change the available power can insert their change into an index. This is really just having slots for a summation where each slot represents the desired power change by a specific CPACK and POWER SYSTEM just adds these desired changed together to produce the final “Available Power”. This ensures that each CPACK handles their own problems, their own gimmicks, and their own units, in their own way. Division of responsibility you can say.
The indexes used for the summation are [1000] - [1008]. 1006, 1007, & 1008 are currently not being used but are still within the array in the event a new source of power modifiers are introduced in a separate CPACK. This means you can create your own separate CPACK to “chip-in” to the power calculation quite easily.

POWER SYSTEM is also responsible for the power display which includes the power use of all VPAC units.
The display uses the ADA Message: “Display” (case sensitive) with a background image of 4 (not opaque).
The list of units is color coded to the build tabs they reside in and the order they are within those tabs, listed from left-right, top-bottom. This display is also dynamically generated where POWER SYSTEM will detect if other VPAC CPACKs are present. So if you only have VPAC Main, the display will only show the power costs of VPAC Main units. Every combination of CPACKs is accounted for, which also makes editing it a bit of a nightmare as it has not yet been generalized (and may never be).
The display also supports language toggles for French and Spanish though Role Play Controller handles this.

  • STARTING_POWER: (Float) How much power you start with. This is the baseline amount of power the player has. It will have all modifiers from the Global List added to it.
  • Power_Suppressor_Release_Power: (Float) How much power is gained from destroying a Power Suppressor.
  • Exponential_Suppressors_ENABLED: (0 or 1) A toggle for an exponential increase in gained power from destroying Power Suppressors.
  • Expon_Suppressor_Release_Factor: (Float) How much the destroyed quantity of Power Suppressors are raised by when Exponential_Suppressors_ENABLED is toggled on. I do not recommend changing this value from 1.2 as it means when 15 Power Suppressors are destroyed, the player will have 25 additional power. When more than 15 are destroyed, the exponential growth really kicks in. A factor of 1.2 ensures the growth is noticeable but not extreme. With this enabled, a maximum of 25 Power Suppressors is recommended. Any more and the exponential growth gets out of hand.

-End of latest edit-

Power Suppressor Context: The VPAC Vertu Expansion provides units called Power Suppressors which when destroyed give additional power. The ERNManger is what causes these units to increase available power.
ERNs can also be released by Power Suppressors if you enable them to (preferably individually). This gives some depth to replaying the map for an optimized run.

Rebuild

This script is responsible for rebuilding non-impervious ground units that where placed on the map. This script does not run while paused and because of that does not start until 1 frame has passed after the player has loaded the map for the first time. This means if you have a script add more ground units, this script will add those new units into its list for rebuilding. BUT ONLY BEFORE THE FIRST FRAME OF THE GAME! All new units placed into the map after that point will not be rebuilt for they do not exist in the list of rebuildable units, written after and only once from the first frame of the mission.

The script also REBUILDS SHATTERED LAND TERRAIN (when enabled, which it is by default).

This version of Rebuild is FAR more performance efficient than any other Rebuild script. It divides its task across 700 frames and in 4 sections to reduce how much action happens in a single frame when the script checks for things to rebuild. This makes the rebuild process COMPLETLY UNNOTICABLE IN PERFORMANCE IMPACT unlike all other forms of Rebuild.

There are quite a few other settings but I heavily disadvise playing with them. Only the toggle for rebuilding terrain should be messed with. HOWEVER! REMEMBER TO REMOVE THE TERRAFORMING OPTION IN THE EDITOR BEFORE ADDING TERPS TO YOUR MAP! THIS CAN NOT BE DONE VIA SCRIPTS! IT MUST BE DONE MANUALLY.

SafeSelect

Makes ALL units unselectable when loading the map outside of the editor, selectable when loading in the editor.
In versions prior to v2.7.5.0, only LAND units will be unselectable with certain built in exceptions.

PAC unit identifier

This script controls how much power the Crimsonator uses, originally intended to account for all units but I found it better to have that role be done within their respective CPACKs instead of just VPAC Main for sake of organization.

You can alter the Crimsonator's power cost in this script. Though VPAC is already very balanced in that regard so alterations are heavily unadvised.

Buff Vanilla Enemies

Runs while paused.
Added in v2.10.0.3
Increases the health of all pre-placed vanilla enemies like the Spore Launcher to 10, increases their heal rate to 0.002 per frame, and gives them a health bar.
This is so additional units such as these don't instantly die when something comes along that can damage them.

Post unit runtime scripts

Default objective

This global script is responsible for automatically creating the DESTROY RIFT LAB custom objective. Since there is only a single custom objective in CW4 this script has a on/off toggle in the event you don't want only the DESTROY RIFT LAB objective.
It will create, write, enable, make required, and completed when the Rift Lab is destroyed. No need to snoop around game settings in the editor.

This script can be disabled. By default it is not disabled.

Auto Enable Connected Totems

Fills all Totems connected to the Rift Lab with what ever ammo ware they need. Sadly due to how GetUnitConnectedToRiftLab works this can not be done at the start of the mission, only a single frame after. This means you won't need to provide resource pods to activate the connected Totems for when the player begins the map.
However: as of VPAC v2.7.5.0
These is a SPECIAL_ENABLE mode, set this variable to 1 to enable it.
Then, have a single Totem's UID be set for TOTEM_UID_TO_EXCLUDE. This totem is the same totem isolated in VPAC maps in the VPAC map making Doctrine of Vertu the map maker.
With both these variables set and ongoing, the Totems will have their shields on and full ammo on Gameload rather than a single frame latter from game-run-time.
————————————————————————————
This script can be toggled on or off. It is on by default.

AutoRemoveBuildPlans

This global script is very handy, it will remove all units from the build tab so you don't have to select every single unit in the editor under Game and disable “Can build” AFTER finishing the map and ready for finalization testing. This includes custom units but you will need to include them in the list of custom units within this script MANUALLY. It is simple to do just recreate what I, Vertu, have going on in there.
You can also see the used API here to figure out what's going on with it: SetCModPlayerMenuName

It operates by removing units from the build menu ONLY WHEN NOT LOADING THE MAP IN THE EDITOR! So you can place units to make the map with ease, never needing to remove or re-add them to the build menu. Once you load the map outside of the editor (a completely unique situation only occurring when making a map!) the units defined within the script will be removed from the build menu. Nice and simple.

AutoActivateShields

Shields, for what ever reason, disable their shield on Gameload, this script counteracts that so you can plan with more accuracy at the start of the mission.

Launcher Selector

Don't touch this script. It creates a MSGButton that allows the player to select all Launchers conveniently without having to hunt down a launcher to then press CTRL + A to select them all.

Patrol System

Only in v2.7.5.0 and onwards. This is the script responsible for controlling the ability to make waypoints for units to patrol. It comes with a display that walks you through using it.
Please don't touch it.



VPAC CPACKs download location.
VPAC Wiki Page
Custom CPACKs & Units
Index

cw4/cpack/docs/f3d1b56c-fb68-49a9-909e-54931da7635d.txt · Last modified: 2025/03/11 15:23 by Vertu