Page 1 of 1

Local's Unit Names and SetTeamName()

Posted: Sat Apr 05, 2008 11:12 pm
by [RDH]Zerted
Does anyone know how to give names to units not on the normal teams?

Also, has anyone figured out how to properly use SetTeamName(). The little blurb about it in the scripting docs doesn't seem to be correct.

Re: Local's Unit Names and SetTeamName()

Posted: Sat Apr 05, 2008 11:24 pm
by woner11
Do you mean like killed republic rifleman instead of unit 468?

Re: Local's Unit Names and SetTeamName()

Posted: Sun Apr 06, 2008 12:03 am
by [RDH]Zerted
woner11 wrote:Do you mean like killed republic rifleman instead of unit 468?
Yes, but also more then that if possible. I'm creating a new era. I need to change the teams' names, the unit names, and the teams' icon.

I copied common.sides.imp into common.sides.yex. I figured SetTeamName(1, "yex") would set the game to use the localization strings in common.sides.yex, but it doesn't. I need help figuring out how to change the names shown on the team selection screen.

I'd assume getting the team selection screen working would get the unit's to use the correct units names (the names in common.sides.yex.firstnames/lastnames). I'd also assume the reverse is true.

I've deleted everything except for common.sides.*, game.infomsg.*, and ifs.sideselect.*. The team selection screen shows the title and auto-assign, but the team names are [NULL].

I'm not using SetupTeams. Everything is done manually through SetTeamName(), SetTeamIcon(), SetUnitCount(), SetReinforcementCount(), and AddUnitClass(). Any ideas?

These two topics seem related:
Localisations
Localizing Full Side Names

Re: Local's Unit Names and SetTeamName()

Posted: Sun Apr 06, 2008 12:30 am
by woner11
To get it to say killed republic rifleman instead of unit 432, you need to have every unit in its own side folder. That way in the edit localize it can have its own folder per unit and can be more specific. To change the team names you do that in the entity section of the edit localize tool.

Re: Local's Unit Names and SetTeamName()

Posted: Sun Apr 06, 2008 3:52 am
by [RDH]Zerted
I can't do anything that requires a map ID. It has to be able to work for any map.

Re: Local's Unit Names and SetTeamName()

Posted: Sun Apr 06, 2008 5:26 am
by MandeRek
Well Zerted we're talking about exactly the same thing ;)

I set up a 'team' in level.common.sides

No succes ingame, but maybe you should replace the original core.lvl with this one then, since it's a team. Setting it up in level.common.sides mean you can make a team name, and unit names like Unit453.. All 4 asset teams are in here, so i think it must be there.. We're talking about the same teams as well, so I'll see if my core.lvl makes differences if i add them to the game's files..

I'll get back with results soon

Edit/Results: Replacing the game's core.lvl with a core.lvl created in a random map results in a fatal error: the game wont even begin! We must find another way then...

Re: Local's Unit Names and SetTeamName()

Posted: Sun Apr 06, 2008 11:10 am
by Teancum
There has to be something else that's involved, as using SetTeamName() on anything other than the main four factions will default the group as locals, which is a per-map issue. SO, there has to be a script or something that causes it to point to common.sides instead of the level.locals or else ALL, IMP, REP and CIS are hard coded into the exe, like the color of the CPs.

Re: Local's Unit Names and SetTeamName()

Posted: Mon Apr 07, 2008 4:59 pm
by [RDH]Zerted
Yeah, I think it might be hard coded into the exe. Unless someone knows how to use ScriptCB_SetTeamNames(). I can't get it to do anything.

Anyone made any progress on SetTeamIcon()? I didn't expect to have problems with that, but I am.

I think this core.req is what you need to replace the retail core.lvl, but I wouldn't recommend using it. Make sure this core.lvl is never in a map's folder. If it is, the entire game will crash.
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"global"
}
REQN
{
"config"
"global"
}
REQN
{
"font"
"gamefont_large"
"gamefont_medium"
"gamefont_small"
"starwars_small"
"gamefont_tiny"
"gamefont_super_tiny"
}
REQN
{
"loc"
"english"
"spanish"
"italian"
"french"
"german"
"uk_english"
}
REQN
{
"texture"
"platform=pc"
"white"
"cube_normalizationmap"
"hemisphere_normalizationmap"
"specularspot"
"attenuation_volume"
"linear_ramp"
"specularcubemap"
"null_detailmap"
"default_spotlight"
}
REQN
{
"shader"
"platform=pc"
"normal_shader"
"interface_shader"
"particle_shader"
"terrain_shader"
"sprite_shader"
"skyfog_shader"
"foliage_shader"
"lightbeam_shader"
"scroll_shader"
"flare_shader"
"sample_shader"
"rain_shader"
"normalmapadder_shader"
"prereflection_shader"
"water_shader"
"stencilshadow_shader"
"shadowquad_shader"
"specular_shader"
"detail_shader"
"ocean_shader"
"refraction_shader"
"decal_shader"
"filtercopy_shader"
"shield_shader"
"bump_shader"
"zprepass_shader"
"hdr_shader"
"normal_terrain_shader"
"perpixeldiffuselighting_shader"
"pervertexdiffuselighting_shader"
"specularlighting_shader"
}
}

Re: Local's Unit Names and SetTeamName()

Posted: Mon Apr 07, 2008 5:05 pm
by Teancum
And folks, be sure to make a backup of your current core.lvl so you don't have to reinstall.

Re: Local's Unit Names and SetTeamName()

Posted: Mon Apr 07, 2008 5:09 pm
by woner11
So, we take this and copy it in our core.req and then munge. Take that core and move into the folder with the retail core.lvl and replace it (after backing it up of course)?

Re: Local's Unit Names and SetTeamName()

Posted: Mon Apr 07, 2008 5:13 pm
by Teancum
Yep, basically. You're gonna get sound issues though. That's one file we never actually got in the modtools (the "bnk" section). When I built it back in the day I was able to do one, but it was really unoptimized and it would overload ppl's sound cards (with a really loud buzzing sound -- doesn't hurt the card, it's just annoying).

Re: Local's Unit Names and SetTeamName()

Posted: Mon Apr 07, 2008 5:16 pm
by woner11
What does it do? Also should we then make a backup of the core.lvl in our custom map and then after doing everything with the new core.lvl override the new core lvl in our custom map with the back up?

Re: Local's Unit Names and SetTeamName()

Posted: Mon Apr 07, 2008 9:29 pm
by [RDH]Zerted
woner11 wrote:should we then make a backup of the core.lvl in our custom map and then after doing everything with the new core.lvl override the new core lvl in our custom map with the back up?
Yes, but it might be easier to just backup the core.req and munge the map a second time using the backedup version after working with the retail version one I posted.

All this stuff on the core.req is in another topic somewhere...