I updated the documentation with a quick introduction on what is ManiaScript and what you can do with it:
http://maniaplanet.github.io/documentation/maniascript/
@Steeffeen:
The LocalUser issue in the doc should be fixed in the next update.
ManiaScript Documentation
Moderator: English Moderator
Re: ManiaScript Documentation
Eole wrote:I updated the documentation with a quick introduction on what is ManiaScript and what you can do with it:
Re: ManiaScript Documentation
Is there any way to properly stop the execution of a label implementation?
return, break and continue work properly by actually affecting the function where the label is declared (which is great)
so there is probably a need for a new statement:
maybe stop() but that could be confused with a die() effect for the whole script
so i would rather suggest something like suspend, abandon, interrupt
a work-around would be to wrap every label in a function so that you can use return that will only return the function and not the whole script but that would be really annoying ^^
return, break and continue work properly by actually affecting the function where the label is declared (which is great)
so there is probably a need for a new statement:
maybe stop() but that could be confused with a die() effect for the whole script
so i would rather suggest something like suspend, abandon, interrupt
a work-around would be to wrap every label in a function so that you can use return that will only return the function and not the whole script but that would be really annoying ^^
- Nerpson
- Translator
- Posts: 1555
- Joined: 27 Sep 2013, 18:02
- Manialink: nerpson
- Location: France
- Contact:
Re: ManiaScript Documentation
Hi guys, I've a problem.
I'm currently creating my first gamemode.
I want to play a sound IG.
So I thought that the command
is right. But it's not working.
Need some help here!
Thanks.
I'm currently creating my first gamemode.
I want to play a sound IG.
So I thought that the command
Code: Select all
CUIConfig::EUISound::PhaseChange;
Need some help here!
Thanks.
Re: ManiaScript Documentation
well how exactly do you want to play the sound?
from the game mode script you could send an empty notice withsource
example:
you have only posted a type/value that doesn't perform anything ^.^
from the game mode script you could send an empty notice with
Code: Select all
CUIConfig::SendNotice (Text Text, ENoticeLevel Level, CUser Avatar,
EAvatarVariant AvatarVariant, EUISound Sound, Integer SoundVariant)
example:
Code: Select all
UIManager.UIAll.SendNotice("", CUIConfig::ENoticeLevel::Default, Null,
CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::PhaseChange, 0);
- Nerpson
- Translator
- Posts: 1555
- Joined: 27 Sep 2013, 18:02
- Manialink: nerpson
- Location: France
- Contact:
Re: ManiaScript Documentation
Thanks!
Another question:
I have a countdown but it's frozen. I think it's because the countdown is not launched.
So how to launch it?
Another question:
I have a countdown but it's frozen. I think it's because the countdown is not launched.
So how to launch it?
Re: ManiaScript Documentation
which countdown do you mean?
the timer at the top?
the timer at the top?
- Nerpson
- Translator
- Posts: 1555
- Joined: 27 Sep 2013, 18:02
- Manialink: nerpson
- Location: France
- Contact:
Re: ManiaScript Documentation
Yes. I've done a modification and now the timer goes wrong, it's fixed.
Here's my code for the case 3 and 4 based ont Royal.
Here's my code for the case 3 and 4 based ont Royal.
Code: Select all
/* ------------------------------------- */
// Offzone shrinking
case 3: {
if (AllowDoubleCapture) {
if (!Pole.Captured && Pole.Sector.PlayersIds.count > 0) {
declare CaptureSpeed = 1.;
declare BonusMax = 0.;
foreach (PlayerId in Pole.Sector.PlayersIds) {
declare CaptureSpeedBonus for Players[PlayerId] = 1.;
if (CaptureSpeedBonus > BonusMax) BonusMax = CaptureSpeedBonus;
}
CaptureSpeed = BonusMax * C_GaugeMultiplier;
Pole.Gauge.Speed = MathLib::NearestInteger(CaptureSpeed);
declare RadiusSpeedBonus = (1 + ((S_OffZoneMaxSpeed - 1.) * (MathLib::ToReal(Pole.Gauge.Value) / MathLib::ToReal(Pole.Gauge.Max))));
OffZoneRadiusSpeed = OffZoneStartingRadiusSpeed * RadiusSpeedBonus;
UIManager.UIAll.StatusMessage = TextLib::Compose(
_("OffZone speed: %1%%"), TextLib::ToText(MathLib::NearestInteger(RadiusSpeedBonus * 100))
);
} else Pole.Gauge.Speed = 0;
}
/* -- -- -- Modifificated here -- -- -- */
if (OffZoneReverseCounter != S_OffZoneMaxReverses) {
if (OffZoneRadius <= C_OffZoneMinRadius) {
OffZoneRadiusSpeed = -OffZoneRadiusSpeed;
OffZoneRadius = C_OffZoneMinRadius;
OffZoneReverseCounter = OffZoneReverseCounter + 1;
UIManager.UIAll.StatusMessage = TextLib::Compose(
_("Tornado goes away")
);
UIManager.UIAll.SendNotice("", CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::PhaseChange, 0);
}
if (OffZoneRadius >= C_OffZoneDefaultRadius) {
OffZoneRadiusSpeed = -OffZoneRadiusSpeed;
OffZoneReverseCounter = OffZoneReverseCounter + 1;
UIManager.UIAll.StatusMessage = TextLib::Compose(
_("Tornado gets closer")
);
UIManager.UIAll.SendNotice("", CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::PhaseChange, 0);
}
}
if (GameplaySequence != 4) {
GameplaySequence = 4;
}
}
/* ------------------------------------- */
// Revert pole gauge
case 4: {
declare EndRoundTimeLimit = S_EndRoundTimeLimit * 1000;
if (EndRoundTimeLimit < 0) EndRoundTimeLimit = 0;
UIManager.UIAll.CountdownEndTime = -1;
EndTime = Now + EndRoundTimeLimit;
if (Pole.Gauge.Value == 0) {
Pole.Gauge.Max = 0;
Pole.Gauge.Value = 0;
Pole.Gauge.Speed = 0;
} else {
Pole.Gauge.Max = MathLib::NearestInteger((Pole.Gauge.Max / (Pole.Gauge.Value *1.)) * (EndTime - Now));
Pole.Gauge.Value = EndTime - Now;
Pole.Gauge.Speed = -1;
}
/* -- -- -- Modified here -- -- -- */
if (OffZoneReverseCounter != S_OffZoneMaxReverses + 1) {
if (OffZoneRadius <= C_OffZoneMinRadius) {
OffZoneRadiusSpeed = -OffZoneRadiusSpeed;
OffZoneRadius = C_OffZoneMinRadius;
OffZoneReverseCounter = OffZoneReverseCounter + 1;
UIManager.UIAll.StatusMessage = TextLib::Compose(
_("Tornado goes away")
);
UIManager.UIAll.SendNotice("", CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::PhaseChange, 0);
}
if (OffZoneRadius >= C_OffZoneDefaultRadius) {
OffZoneRadiusSpeed = -OffZoneRadiusSpeed;
OffZoneReverseCounter = OffZoneReverseCounter + 1;
UIManager.UIAll.StatusMessage = TextLib::Compose(
_("Tornado gets 4")
);
UIManager.UIAll.SendNotice("", CUIConfig::ENoticeLevel::Default, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::PhaseChange, 0);
}
}else{
OffZoneRadiusSpeed = 0.;
UIManager.UIAll.StatusMessage = TextLib::Compose(
_("Tornado fixed")
);
GameplaySequence = 10;
}
}
Re: ManiaScript Documentation
what? do you need help or not? xDNerpson wrote:and now the timer goes wrong, it's fixed.
Who is online
Users browsing this forum: No registered users and 0 guests