Changing the HUD with Interface Designer. Is it possible?

Give your feedback about the Interface Designer in this section

Moderator: NADEO

User avatar
Dommy
Translator
Translator
Posts: 1901
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: Changing the HUD with Interface Designer. Is it possible

Post by Dommy »

If you create custom solo script, sure :mrgreen:
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
User avatar
Mandark
Posts: 1297
Joined: 15 Jul 2010, 17:58
Location: Romania

Re: Changing the HUD with Interface Designer. Is it possible

Post by Mandark »

Isn't there any way to modify the already existing solo script like I did with time attack mode? :D
But anyway, I dont think its worth going through making a custom solo mode all over again just for a green hud^^

Thanks a lot for helping me with editing the TA mode again btw :thx:
Specs
Motherboard: Asus ROG Maximus VII Formula
CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 CPUs), ~4.0GHz
GPU: Nvidia GeForce GTX 980 Ti
RAM: 16GB
Operating System: Windows 10 Pro
User avatar
Dommy
Translator
Translator
Posts: 1901
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: Changing the HUD with Interface Designer. Is it possible

Post by Dommy »

There is no script for campaign solo mode, although it's possible to remake it using scripts. So it's a long way and for example my Turbo title pack is fully controlled by script, even opponent selection is custom. That allows me to put tons of custom HUD on the screen (look here).
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
User avatar
Mandark
Posts: 1297
Joined: 15 Jul 2010, 17:58
Location: Romania

Re: Changing the HUD with Interface Designer. Is it possible

Post by Mandark »

That's a shame, I wish that in the future, Nadeo will make it possible to change the whole UI of the game (all of the menus + HUD) easily with interface editor :D
Specs
Motherboard: Asus ROG Maximus VII Formula
CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 CPUs), ~4.0GHz
GPU: Nvidia GeForce GTX 980 Ti
RAM: 16GB
Operating System: Windows 10 Pro
User avatar
adamkooo2
Posts: 1371
Joined: 13 Jun 2014, 08:43
Location: Slovakia
Contact:

Re: Changing the HUD with Interface Designer. Is it possible

Post by adamkooo2 »

domino54 wrote:Interface Designer is completely other world than ingame HUD. :mrgreen:

You need to do a custom mode (can be modified time attack) with your own HUD as an interface layer (best attached to global UI). There is source of scriped version of the default speed and distance meter in UI library used in all scripted TrackMania modes by Nadeo (I cut it to the most important things):

Code: Select all

Text SpeedAndDistance() {
	return """
<manialink version="1" name="Lib_UI:SpeedAndDistance">
<frame posn="158 -79.5 5" id="Frame_Global">
	<format textemboss="1" />
	<label posn="-6 0" sizen="30 6" halign="right" valign="bottom" style="TextRaceChrono" textsize="2" text="0" id="Label_Distance" />
	<label posn="0 0" sizen="8 6" halign="right" valign="bottom" textsize="1" textemboss="0" text="m" />
	<label posn="0 -10" sizen="30 6" halign="right" valign="bottom" style="TextRaceChrono" textsize="8" text="0" id="Label_Speed" />
</frame>
<script><!--
#Include "TextLib" as TL
#Include "MathLib" as ML

main() {
	declare Frame_Global	<=> (Page.GetFirstChild("Frame_Global")		as CMlFrame);
	declare Label_Distance	<=> (Page.GetFirstChild("Label_Distance")	as CMlLabel);
	declare Label_Speed		<=> (Page.GetFirstChild("Label_Speed")		as CMlLabel);
	
	while (True) {
		yield;
		
		Frame_Global.Visible = (InputPlayer != Null && InputPlayer.IsSpawned);
		if (!Frame_Global.Visible) continue;

		Label_Distance.Value = TL::ToText(ML::FloorInteger(InputPlayer.Distance));
		Label_Speed.Value = TL::ToText(ML::FloorInteger(InputPlayer.Speed * 3.6));
	}
}
--></script>
</manialink>""";
}
Then only need to include Layers2 library in the mode and attach a layer to the global UI:

Code: Select all

In the top of the script:
#Include "Libs/Nadeo/Layers2.Script.txt" as Layers

Inside ***StartServer*** label (when using a script running on ModeBase):
Layers::Create("Speedometer", SpeedAndDistance());
Layers::Attach("Speedometer");
UIManager.UIAll.OverlayHideSpeedAndDist = True; ///< Hides default speedometer
Important: If the mode uses UI library, call the《UI::UnloadModule("SpeedAndDistance");》after attaching the layer or just remove "SpeedAndDistance" from "UI::Load([...]);".

More! You can also use the UI library to modify visibility and positions of various elements on the screen, for example the Chrono. Just use《UI::SetModulePosition("ModuleName", <0., 0., 0.>);》or《UI::SetModuleVisibility("ModuleName", False);》.

To be honest, I modified the source code of the UI library to make interface for my Turbo title pack with some extra position changes :D .
WOW :shock:
it looks interesting!
I will test something

edit:
I will test nothing, because game falls
/\rkady
Image
oliverde8
Posts: 1345
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: Changing the HUD with Interface Designer. Is it possible

Post by oliverde8 »

Hi,

The problem is the hud can already be completed changed by the game script & by the dedicated server tools. So if players add their own layer ontop of it it will become a nightmare to have it all work. Your customization will work on one server and not another.
I don't see how it would be possible. :?
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Post Reply

Return to “Interface Designer”

Who is online

Users browsing this forum: No registered users and 1 guest