How to get cp spawn names

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Master of the Force
User avatar
Posts: 4760
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod

How to get cp spawn names

Postby Anakin » Tue Mar 27, 2018 8:32 am

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.

Resistance Leader
User avatar
Posts: 5187
Joined: Tue Feb 09, 2010 8:43 pm
Location: Edinburgh, UK
Projects :: EVERYWHERE + Zero Munge + TCW
Games I'm Playing :: Hollow Knight
xbox live or psn: Marth8880

Re: How to get cp spawn names

Postby Marth8880 » Tue Mar 27, 2018 2:31 pm

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=

Master of the Force
User avatar
Posts: 4760
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod

Re: How to get cp spawn names

Postby Anakin » Wed Mar 28, 2018 6:50 am

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.

Resistance Leader
User avatar
Posts: 5187
Joined: Tue Feb 09, 2010 8:43 pm
Location: Edinburgh, UK
Projects :: EVERYWHERE + Zero Munge + TCW
Games I'm Playing :: Hollow Knight
xbox live or psn: Marth8880

Re: How to get cp spawn names

Postby Marth8880 » Thu Mar 29, 2018 6:03 pm

>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?

Master of the Force
User avatar
Posts: 4760
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod

Re: How to get cp spawn names

Postby Anakin » Fri Mar 30, 2018 6:38 am

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? 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

Jedi
User avatar
Posts: 1209
Joined: Mon Mar 21, 2011 8:12 pm
Location: STALKER!
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4

Re: How to get cp spawn names

Postby ARCTroopaNate » Wed May 23, 2018 7:38 pm

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.

Return to SWBF2 Modding

Who is online

Users browsing this forum: No registered users and 4 guests