Race index values are not all unique if you have race restrictions

Hi All,

I’m a bit confused about races being specific numbers now, since they’re no longer sourced from race.lua I’m not sure how to tell what race is what number for things like the speech logic.

For example, I’ve put together a Borg fleet command sound actor, but have no idea what to do next to assign it to the Borg fleet command because of the now not-entirely-hard-coded race number I mentioned before…

How are we to handle these sorts of things now?

Ok, well in the absence of any feedback I did some experimentation…

The race index number is directly related to cfg_race_index_sort in *\scripts\races{race}\props\default.lua, however

If you are restricting races between different game rules then you will have races which end up with the same race index number!

For example, here are the current options of our TNG era game rule (the races come up numbered 1 to 6 from top to bottom)

Here are the options for our TMP era game rule (1 to 4 for the races here, top to bottom)

And for our other two eras we currently only have the three races which appeared in the HW2 mod

Now, if we’re using the race index number for anything this straight off the bat means that iRace = 4 is used by two different races! And others will likely overlap as time goes on too. @BitVenom, is this a bug or am I still missing something?

Is this the relevant section you’re looking for?

-- Text for Actor folder names
NameAllPilot = "All_"
NameCapPilot = "Cap_"
NameFighterPilot = "Fighter_"
NameInfiltratorPilot = "Infiltrator_"
NameMarinePilot = "Marine_"
NameSupportPilot = "Support_"
NameFleetCommand = "Fleet"
NameMakaan = "Makaan"
NameEmperor = "Emperor"
NameSalCap = "SalCap_"

function raceHelper()
	if (currentRace == Vaygr) then
		return NameMakaan
	elseif (currentRace == Taiidan) then
		return NameEmperor
	else
		return NameFleetCommand
	end
end

from soundscripts > speechlogic > commands.lua

I found that part, but since the race index is not set in all circumstances any more I needed a bit more clarification… we use those race index numbers extensively in our scripting and Stargazer’s not been doing anything with it so I’m trying to update them… It’s not simple :confounded:

Ok, so I have gotten the Borg sounds going for the fleet command as they’re slot #6, but the Cardassians and Gorn (sharing race index slot 4) are both using whatever is the 4th entry in the “voiceoverActorTable” in the image in my original post.

@BitVenom, how would we be able to deal with these overlaps? This issue will no doubt come up again and again in lots of different areas :frowning:

I have same problem with Music.lua.

I use PlayerRace_DoesHaveTag, but if the index it’s not the same as the races default.lua, we are lost … x)

Only solution is to make one files for one gamerules ? I don’t want to lose my time to make this …

Actually i try to make something like this :

You can found the other part in the races/xxx/scripts/music_xxx.lua …
But the error “Cannot overwrite the function …” appeared … so i’m lost :°

  • Yeah, i’m always lost …

gonna bump this, as it’s pretty important… We really need to be able to match race # to sound # …somehow…
This isn’t a bug is it?

I feel like you guys should be using the “symbolic” name instead of the race id, but I’m not smart enough to say for certain, and I haven’t tested it myself.

Nathan? Is this an option?

If it’s a global then yeah, we could use anything in the race’s files, it would be fantastic if that was the case and the race index number would be superceded.

Trouble is I’m not knowledgeable enough to find out all the global variables you can query, need a dev (or someone who can actually script) to dig into this topic

Hope someone comes by soon with an answer…

Yeah … me too …

I need this answer to continue the bug fixing progression on the mod… (I don’t add any functionality with the next big update … it’s crazy x) )

@Bitvenom, if you’re not the man for this question could I trouble you to name-drop someone in here who could help please? :smile:

//edit
How about @thisquietreverie?

//edit
Just looking through the dev tracker, I can’t see any of the HW-active devs posting for a couple of weeks back. Is there some sort of holiday going on in the US? Where’s everyone gone? :cry:

Necroing my thread here because I saw that @bitvenom posted here three hours ago! :smiley:

Hoping for some attention :wink:

1 Like

Generally I’d suggest using one of the Race_XXX properties calls (propbably GetString, to map the actor name from the Race ID) - but I think you can’t use them at this level, right? In that case, that seems like an easy and quick fix on our end…

The plus of using a String race property is that you can have Races with lead actors that change by Game Rule!

Using Trek as an example, you could have one Game Rule for an early era, with the Race’s main voice being a notable figure from then - and another Rule for a later era, and again a proper character from that time - without really having to do anything yourself…

Lemme dig into this a bit. We are still VERY VERY busy as the patch is NOT ready. But I’ll add this to my list.

2 Likes

Thank you @BitVenom! :smile:

Just to be clear, I have everything for the race audio working for now except for any race that’s not in all eras.

Using STC as an example, slot 4 in the TNG game rule is the Cardassians and slot 4 in the TMP game rule is the Gorn. At the moment the game can’t differentiate between them for music and fleet command audio, so the Gorn just get the Cardassian sounds…

For the meantime we’re just adding “extra” races to TNG

The core problem is that you cannot use any Race_XXX functions in soundscripts\speechlogic\commands.lua, since it’s not a gamerule lua, UI lua or AI lua.

1 Like

So, it’s good idea to make some change for this script in next patch.

We don’t have any problem with this script, because we use other way to make speech for ship.

Oh, and, @BitVenom , can you add value (something like FEMusic) in the soundconfig.lua to change the folder of ship speech ? [Just, in one .big, to have key’s to make EN / FR speech of this ship …] And, other question, can you add more Theme in subtitle.lua, limit set to 32, but we need to use more of 32 speech icon for the Actor. So, the idea is to let modder chose this value, you can add this in the subtitle.lua ? (or just set this limit, defined in subtitle.h, to the max value possible : 255 ? or more … try and find this max value).

I really don’t know how you can tell that this info is in subtitle.h when nobody here has ever see the hw2 source code (as already said in the past, the subtitle.h file you referred before is from hw1 source code, not hw2 :wink: )

1 Like

Yes, but, i supposed is the same file, is not logical to change the name of this file, they have same function > define all about subtitle you see in the screen in the game <

And it’s the same as HW2, in the Classic version, the limit is 16, in the HWRM, GBX increased this limit to 32. This file is not really important for the game, so the change between version is really a minor change … We have a thing which works perfectly, thus we go not quite changed…