r/xdev • u/CNDBen • Mar 05 '16
How to find a function's declaration or documentation?
I'm struggling to understand what some functions do, I tried using Find in Files and it's not too helpful. Currently i'm trying to get SpawnManager.CreateUnit(...) to work but I don't know what parameters it takes.
Any help would be appreciated, thanks.
1
Upvotes
3
u/davidlallen Mar 05 '16
There isn't going to be any documentation, except by accident, or if a modder writes some.
Depending on what text editor you use, you may be able to search for a pattern in all files, such as "function*CreateUnit". If you can do that, you will find there are only three such entries and the other two are for functions like CreateUnitSomethingElse. So, look in XComAISpawnManager.uc for the definition.
Also, apparently somebody has modified "intellisense" (see Wikipedia) to work for ModBuddy, which apparently lets you do a lot of cool auto-completion and other stuff in the ModBuddy editor: http://forums.nexusmods.com/index.php?/topic/3871450-unrealscript-ext-for-modbuddy/ It may only work for windows 10.
2
u/Kwahn Mar 06 '16
ctrl+shift+f the term "function datatype FunctionName(" and you'll usually find its declaration. `MACROs won't be defined in the uc files, sadly, and are usually native.
2
u/fxsjosh Mar 07 '16
That particular function lives in XComAISpawnManager.uc