User Tools

Site Tools


4rpl:commands:setcelloccupiedcount

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
4rpl:commands:setcelloccupiedcount [2023/09/16 14:49] – Gameload mention Vertu4rpl:commands:setcelloccupiedcount [2023/10/27 11:41] (current) – [Description] Elaborated why :Awake and :Gameload are not best places for this API. Vertu
Line 14: Line 14:
  
 The effect of SetCellOccupiedCount does not persist between save and loads, as all units rebuild their cell occupied counts whenever the game is loaded and units are rebuilt from the save file.\\ The effect of SetCellOccupiedCount does not persist between save and loads, as all units rebuild their cell occupied counts whenever the game is loaded and units are rebuilt from the save file.\\
-:WARNING: This also applies to using this API in :Gameloaded and :Awake (when game is also loaded). This API will not function as desired should it be called in :Gameloaded or :Awake (:Awake will work fine when placing units, just not when units are loaded in).+:WARNING: This also applies to using this API in :Gameloaded and :Awake (when game is also loaded). This API will not function as desired should it be called in :Gameloaded or :Awake (:Awake will work fine when placing units, just not when units are loaded in). This is due to the game rebuilding cell occupy counts latter than :Awake and :Gameloaded, causing the effects of this API used in such functions to be overwritten.
  
 If you're trying to make a custom unit occupy cells in a custom shape rather than the default box shape, refer to [[cw4:4rpl_tools#custom_celloccupiedcount_shape|Custom CellOccupiedCount shape]] for a copy-paste ready script that simplifies creating one and handles all of the difficult parts of using SetCellOccupiedCount, including handling unit movement. If you're trying to make a custom unit occupy cells in a custom shape rather than the default box shape, refer to [[cw4:4rpl_tools#custom_celloccupiedcount_shape|Custom CellOccupiedCount shape]] for a copy-paste ready script that simplifies creating one and handles all of the difficult parts of using SetCellOccupiedCount, including handling unit movement.
4rpl/commands/setcelloccupiedcount.txt · Last modified: 2023/10/27 11:41 by Vertu