Index

SetCModPlayerMenuName

SetCModPlayerMenuName(<-CModUID <-name <-section)

Description

Causes the unit to be added to the player build menu with the specified name. The CModUID (a unit template defined in a CPACK) references the unit definition. You can get the CMOD UID from within the CPACK manager. CMOD UIDs are unique and never change. Once added, the player can click on the button that contains the name and build the specified unit. The section is a number that specified which menu the name is added to. It can be 0,1,2,3,4. 0 means the Struct menu, 1 means the Weapons menu, 2 is the Air menu, 3 is the Special menu, and 4 is the Custom menu.

SetCModPlayerMenuName rebuilds the entire unit menu on the left. So it will be expensive in terms of CPU cycles. It is not intended that it be be called frequently (just when adding something to the menu).

Examples

SetCModPlayerMenuName(<-CModUID "TestUnit" 4)

Index