• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[vJASS] GetLocalPlayer() and things that desync?

Status
Not open for further replies.
Level 10
Joined
Mar 31, 2009
Messages
732
Okay cool, looks like PlaySound is fine then.

On to my next issue.

I'm looking for a way to be able to set a definition contained in the war3mapSkin.txt file to a variable; so that I can change the interface definition at runtime.

Like, say I wanted to change the interface setting Icon - Idle Worker at runtime... after changing it in gameplay interface, it is defined in that file as:
[CustomSkin]
IdlePeon=ReplaceableTextures\CommandButtons\BTNCritterRabbit.blp

I've tried setting it to a user defined global string variable, like so:
IdlePeon=udg_testString
It just shows a green box instead. I'm GUESSING this is because it is looking for a file in the base directory called "udg_testString". Is there a way to make it reference the variable udg_testString instead, so that the icon can be changed at runtime?

Is there really no possible way to change the interface at runtime in Warcraft III?
 
Level 10
Joined
Mar 31, 2009
Messages
732
Okay. The map supports the race constant RACE_DEMON.

If the gameplay interface are left at their defaults, the game generates settings based on a players race setting.

Would I be able to assign a race of RACE_DEMON to a specific player either in the lobby or during initialization, before the interface is generated, and assign custom values to what is pulled if it finds RACE_DEMON?
 
Level 10
Joined
Mar 31, 2009
Messages
732
All I want is to have a way to have a 5th race available, with its own interface settings. I don't necessarily have to do the change at runtime, it can be done during initialization.
The lobby UI can't provide an option for RACE_DEMON, so I need to find what ways I have to assign that to a player. Perhaps just a specific player slot that is preassigned to RACE_DEMON.
Next I'd need to find a way to assign the interface settings to that race.


Edit: Okay there it is. Inside war3map.j, in the function InitCustomPlayerSlots, I can set the "race preferences" to RACE_DEMON for specific players. It annoyingly doesn't do anything unless I check both Use Custom Forces and Fixed Player Settings, which is a shame. Means I can't allow alliances to be setup in the lobby. Also means players can't select away from RACE_DEMON if they don't want it!
It displays in the lobby as "Random" but during the loading screen it changes to Unknown.
 
Last edited:
It's one of those things that are hardcoded to WC3 and you can not do anything about it. Great to hear that you have found a workaround, but it seems to have some flaws. I think you should scrap that idea of having 5 races. Not sure what you want to do, but I think you can build a great map with only 4 playable races, if you ask me.
 
Level 10
Joined
Mar 31, 2009
Messages
732
I've been trying to figure out how they did it in the campaign, on that human expansion level 5, where you have naga and human workers. If you build stuff with the human workers, the human soundset plays. If you build stuff with the naga workers, the naga soundset plays.

Turns out thats not quite true. CannotBuildThere/BuildingComplete/GoldMineLow/GoldMineDrained all fix to the human soundset even if a murgul reaver is the unit in question... which is a shame. It is a small oversight by blizzard but a damn shame for such an underused set of units in the game.

You only get 2 levels in the campaign where you can use the Murgul Reaver. Last night-elf and Human 5. On the last night-elf level, Naga is the primary race, and the gameplay interface is fixed to naga soundset. If you attempt to build something with the allies night-elf wisps in a bad spot, it plays the naga sounds. On human 5, the soundsets are left as defaults. Because you enter the game as RACE_HUMAN, they go to the human sounds. The naga units you have are not your allies units, they are yours. Some sounds tied to them play human sounds, some play naga sounds.

From what I can tell, an override in war3skins.txt always takes priority. If you set CantBuildSound (or whatever the name was), it will always play no matter what worker you used.
If that field is still on its default, then if the worker is an acolyte/peasant/peon/wisp, it will play the sound associated with that units respective race.
If the field is still on its default and you use another worker (murgul reaver), it will play the sound associated with the race you picked in the games lobby.

I want to find a way to bind the Mur'gul Reavers CannotBuildThere sound to the one in the gamefiles, and have it actually work. I don't want to use the gameplay interface and fix the sound for all players.

If I can find a way to make this work, I can branch it out to all other relevant UI parts. Gold low. Gold drained. Idle worker icon. UI 2D static frames. Not enough food. Not enough gold. Not enough lumber.

Ones that should easily be do-able with triggers are the other ones: Ally under attack, hero slain, allied hero fallen, allies town under attack, building complete, anything else I've forgotten.


Edit: Finally getting somewhere now.

If I open the war3map.j inside the map, and change that RACE_PREF_XXXX to RACE_PREF_DEMON, it will start off setting the player to a demon race.
Next, by opening the war3patch.mpq and editing UI\war3skins.txt, I can add "Demon" to the skins and set its fields there.
My next goal is to find a way to replace that file using a map. Perhaps overwriting UI\war3skins.txt as an import?
 
Last edited:
Status
Not open for further replies.
Top