Page 1 of 1
How to get cp spawn names
Posted: Tue Mar 27, 2018 8:32 am
by Anakin
Hey,
i need to get the cp spawn names. I know that there are ways via hexedit or looking into the source, but i need to get the names within lua code.
So is there any function that returns the the spawn path name of an cp? I already know the cp's name. Maybe there is a standard function that is always called to initialize the cp or something like that. So i can wrap that function and grep the name.
Re: How to get cp spawn names
Posted: Tue Mar 27, 2018 2:31 pm
by Marth8880
Nope, there are no Lua functions that return a CP's spawn path name. With that said though, at one point during MEU's development I had to get all the stock maps' CP spawn path names, which you can find here:
https://github.com/marth8880/MEUScripts ... tCPs&type=
Re: How to get cp spawn names
Posted: Wed Mar 28, 2018 6:50 am
by Anakin
Any idea on how to find the cp spawn names for custom maps? I know the cp names and i can get the object's pointer. Isn't there any function that manages the spawning, that can be wrapped?
Or we'd need to rewrite the ai hero support script, so it does no longer need the cps.
Re: How to get cp spawn names
Posted: Thu Mar 29, 2018 6:03 pm
by Marth8880
>Isn't there any function that manages the spawning, that can be wrapped?
No, not really. The AI Hero Support script uses the built-in 'SpawnCharacter' function, which spawns a specified unit (by its character index) at the specified spawn point (returned from 'GetPathPoint'), but that's the only spawning-related function that's exposed to Lua. See here:
https://github.com/marth8880/MEUScripts ... t.lua#L254
What exactly are you trying to do here specifically?
Re: How to get cp spawn names
Posted: Fri Mar 30, 2018 6:38 am
by Anakin
i want to write a user script that enables ai hero for every map and mod. I can insert/wrap everything i need, but the problem are the cp path names. Since in conquest mods there is the conqest:newCP function that needs to be called it's easy to catch the names of the cps here, but i still need the path names.
==EDIT==
what about this?
http://www.gametoast.com/viewtopic.php?p=126047#p126047
Is there a way to get ANY character from a specified team? We just let the hero spawn next to him. Best would be if we can catch a unit that recently spawned.
==EDIT==
or can we maybe use GetCommandPostCaputreRegion and then get the matrix from that region and spawn at that place? Or we take the matrix of the Command Post itself
Re: How to get cp spawn names
Posted: Wed May 23, 2018 7:38 pm
by ARCTroopaNate
Bit of a bump, but just wanted to thank you for posting those Marth. Been struggling with the zeroeditor runtime error but really just needed it to look these up, now I don't have to.