Pb with BigMessage duration [Solved]

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
BusardCendre
Posts: 174
Joined: 30 May 2013, 09:40

Pb with BigMessage duration [Solved]

Post by BusardCendre »

Hi all,

I'm writing a new gameMode for TrackMania, and I have a little problem with BigMessage duration :
I want to display a message like this : Round 1/4 at the begining of the round,
I've set duration to 5000 ms but this message isn't cleared after 5 second, it stays in the middle of the screen until another message is written upon it ...
here is a piece of my code :

Code: Select all

***PlayLoop***
***
foreach (Event in PendingEvents) {
	PassOn(Event);
	XmlRpc::PassOn(Event);


	// ----------------------------- //
	// Send Message to players at round start (ex : Round 1/3)
	// ----------------------------- //
	if (Event.Type == CTmModeEvent::EType::StartLine) {
		if (G_RoundNb < S_RoundsPerMap) {
			Message::SendBigMessage(Event.Player, TextLib::Compose(_("$s$F80Round %1 / %2"), TextLib::ToText(G_RoundNb), TextLib::ToText(S_RoundsPerMap)), 5000, 10);			
		} else if (G_RoundNb == S_RoundsPerMap) {
			Message::SendBigMessage(Event.Player, "$s$F80Last Round", 5000, 10);
		}
	}
}
***
Have I made a mistake ?
It was working fine when my script was extending RoundBase.Script, but since I've rewritten it so that it's an extend of BaseMde.script, it doesn't work anymore ...
thanks for help =)
Last edited by BusardCendre on 17 Mar 2016, 00:39, edited 1 time in total.
Image

CPU : AMD FX-4170 (4 CPUs, ~4.2 GHz)
GPU : Sapphire Radeon HD 7850, 2 Go , DX 11
RAM : 8 Go DDR3
Win 7 Ultimate x64
BusardCendre
Posts: 174
Joined: 30 May 2013, 09:40

Re: Pb with BigMessage duration

Post by BusardCendre »

Hi all,

don't try to find a solution anymore, I found it :mrgreen:

I had forgot to add this :

Code: Select all

***Yield***
***
Message::Loop();
***
Strangely, that wasn't needed when my script was extending RoundBase.Script ...
Image

CPU : AMD FX-4170 (4 CPUs, ~4.2 GHz)
GPU : Sapphire Radeon HD 7850, 2 Go , DX 11
RAM : 8 Go DDR3
Win 7 Ultimate x64
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 2 guests