Adding a UI element in a map

This is for troubleshooting of problems with the FAF client and Forged Alliance game.

Moderator: PhilipJFry

Adding a UI element in a map

Postby EntropyWins » 14 Nov 2016, 11:40

Is it possible to add an UI element via the script of a map? For instance something like the Final Rush UI, see attachment.

As far as I can tell, this needs to be done via a UserSync "OnSync" hook (at hook/lua/ui/UserSync.lua). However such hooks don't seem to get invoked for maps (it does for mods). So is there a way to do this with just a map?
Attachments
finalrushui.PNG
finalrushui.PNG (125.86 KiB) Viewed 1252 times
EntropyWins
Avatar-of-War
 
Posts: 113
Joined: 02 Oct 2016, 20:26
Has liked: 18 times
Been liked: 4 times
FAF User Name: EntropyWins

Re: Adding a UI element in a map

Postby biass » 14 Nov 2016, 11:48

I suggest you go to the the scripts for "Wave of death" they have very basic UI elements built into the map already :)
Map thread: https://bit.ly/2PBsa5H

Petricpwnz wrote:biass on his campaign to cleanse and remake every single map of FAF because he is an untolerating reincarnation of mapping hitler
User avatar
biass
Contributor
 
Posts: 2239
Joined: 03 Dec 2015, 07:54
Has liked: 598 times
Been liked: 662 times
FAF User Name: biass

Re: Adding a UI element in a map

Postby speed2 » 14 Nov 2016, 12:14

Afaik this is currently not possible without a mod.
User avatar
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: Adding a UI element in a map

Postby EntropyWins » 14 Nov 2016, 12:22

biass wrote:I suggest you go to the the scripts for "Wave of death" they have very basic UI elements built into the map already :)


Can you be a bit more specific? I just fired up Wave of Death and did not see any such UI elements. Also quickly looked at the code and did not spot such elements, though then I probably would not, given it's 2kloc of procedural code partially written in French.
EntropyWins
Avatar-of-War
 
Posts: 113
Joined: 02 Oct 2016, 20:26
Has liked: 18 times
Been liked: 4 times
FAF User Name: EntropyWins

Re: Adding a UI element in a map

Postby biass » 14 Nov 2016, 12:25

:/ i think stuff comes up when a player dies or triggers a wave :/
Map thread: https://bit.ly/2PBsa5H

Petricpwnz wrote:biass on his campaign to cleanse and remake every single map of FAF because he is an untolerating reincarnation of mapping hitler
User avatar
biass
Contributor
 
Posts: 2239
Joined: 03 Dec 2015, 07:54
Has liked: 598 times
Been liked: 662 times
FAF User Name: biass

Re: Adding a UI element in a map

Postby EntropyWins » 14 Nov 2016, 12:25

speed2 wrote:Afaik this is currently not possible without a mod.


I'm going to sleep now and am hoping to return tomorrow and find you've pulled a solution out of your magic hat :)

Seriously though, is there really no way around this? I'm fine if the thing does not automatically update like normal things do and I need to poke it every second or so.
EntropyWins
Avatar-of-War
 
Posts: 113
Joined: 02 Oct 2016, 20:26
Has liked: 18 times
Been liked: 4 times
FAF User Name: EntropyWins

Re: Adding a UI element in a map

Postby EntropyWins » 14 Nov 2016, 12:27

biass wrote::/ i think stuff comes up when a player dies or triggers a wave :/


Thanks for suggesting to look there.

Ah yeah indeed. That's quite different though, as it's just a text message. I know how to do that, but that does not help me here.
EntropyWins
Avatar-of-War
 
Posts: 113
Joined: 02 Oct 2016, 20:26
Has liked: 18 times
Been liked: 4 times
FAF User Name: EntropyWins

Re: Adding a UI element in a map

Postby KeyBlue » 14 Nov 2016, 12:47

The solution to your problem is near!
I made it possible to add mods for your map that are automatically used when those maps are played.
These mods would be saved inside your map folder, so they basically become part of your map.
See: https://github.com/FAForever/fa/pull/1680
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Re: Adding a UI element in a map

Postby EntropyWins » 20 Nov 2016, 16:06

That's really awesome. Thanks a bunch! Eagerly awaiting for that capability to become available
EntropyWins
Avatar-of-War
 
Posts: 113
Joined: 02 Oct 2016, 20:26
Has liked: 18 times
Been liked: 4 times
FAF User Name: EntropyWins


Return to Tech Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest