Closed sw5163 closed 3 months ago
Thanks, I haven't looked into programmatic "pre-caching" models from other factions. This could indeed work as on-demand "pre-caching".
Also do you have any idea why Misc_GetMouseOnTerrain() doesn't work? I assume you are using Camera_GetPivot() instead.
No idea. CheatCommands Mod currently uses a bit hacky approach to get the actual camera target position:
function Camera_GetTargetPositionCenter()
-- Camera_GetCurrentTargetPos / Camera_GetTargetPos / Camera_GetCurrentPos are weird; not screen-centered like in CoH2
local pos = Pos_OnTerrain(Camera_GetTargetPos())
local target = Pos_OnTerrain(Camera_GetCurrentTargetPos())
return Pos_GetOffsetPositionTowards(pos, target, (World_DistancePointToPoint(pos, target) / 2), true)
end
It's probably a dirty estimation but it has worked well enough so far 😅
No idea. CheatCommands Mod currently uses a bit hacky approach to get the actual camera target position:
From my test, Camera_GetPivot()
returns the screen center pos.
I wonder if there's a way to check the source code of Misc_GetMouseOnTerrain()
🤔
From my test,
Camera_GetPivot()
returns the screen center pos.
Thanks, I may have originally ignored Camera_GetPivot
due to its name. Having not read the SCARDOC I must have assumed it's related to getting one of the rotation axis.
I wonder if there's a way to check the source code of
Misc_GetMouseOnTerrain()
🤔
Searching across all of the game's SCAR/lua files for occurrences of Misc_GetMouseOnTerrain
indicates that it's related to internal testing / "cheat menu". Perhaps it requires -dev
mode or somthing similar 🤔
Searching across all of the game's SCAR/lua files for occurrences of
Misc_GetMouseOnTerrain
indicates that it's related to internal testing / "cheat menu". Perhaps it requires-dev
mode or somthing similar 🤔
I am in -dev
mode, it always return (0,0,0) both in COH3 and AOE4, seems broken. And I've just checked the cheatmenu.lua
, its source code not in there.
Looks like your camera target hack is the simplest way to get a spawn point until there's a way to fix Misc_GetMouseOnTerrain()
, thanks! 🙂
Hi Janne252, Much love your CheatCommands Mod!
Squad_Precache()
will solve the red box issue:Also do you have any idea why
Misc_GetMouseOnTerrain()
doesn't work? I assume you are usingCamera_GetPivot()
instead.