[Solved] How to dissociate direct hit and AOE?

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
Cerovan
Posts: 2007
Joined: 11 Jul 2011, 11:27
Location: France
Contact:

Re: [Solved] How to dissociate direct hit and AOE?

Post by Cerovan »

djhubertus wrote:

Code: Select all

UIManager.UIAll.SendNotice(TextLib::Compose(_("$<%1$> has hit $<%2$>"), Event.Shooter.Name, Event.Victim.Name), CUIConfig::ENoticeLevel::PlayerInfo, Null, CUIConfig::EAvatarVariant::Default, CUIConfig::EUISound::Silence, 0);
By removing the "CUIConfig::EUISound::Silence" you hear the sound ? (or put a blank "")
Online Programmer & Meme Master ヾ(⌐■_■)ノ

Access to your Player Page

You have troubles, please contact the Ubisoft Support

Maniaplanet Documentation (Editors, Scripting, Title Pack, etc...)
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: [Solved] How to dissociate direct hit and AOE?

Post by fleo »

But what sounds are we talking about exactly? :P Because I'm using a modified version of the Elite script and sounds are triggered manually there:

Code: Select all

// Elim attacker
			if (Players[G_AtkPlayerId].Armor - Event.Damage <= 0 && Event.Victim.Id == G_AtkPlayerId) {
				PlaySound(CUIConfig::EUISound::VictoryPoint, 0);
				AtkIsEliminated = True;	///< Set atk elimination at the frame of the hit, not the next OnArmorEmpty
			} 
			// Hit attacker
			else {
				PlaySound(CUIConfig::EUISound::TiePoint, SoundVariant);
			}
So I did the same for custom weapons, that's no big deal. The +1 visual notification is quite harder to code because I'm lost in all the manialinks in Elite :roflol:

And I'm quite confuse about how to use custom weapons. I currently use ActionLoad and ActionBind to equip them. I also use ActionBind(_Player,CSmMode::EActionSlot::Slot_X,CSmMode::EActionInput::None); to unequipped them. But I don't know if I have to unload them. For example if I want a custom weapon not to reload while I'm using a Storm weapon (same behaviour as in Combo for instance, a weapon doesn't reload when it's not equipped), should I unload the weapon from the player or should I modify the energy of the weapon like we do with SetPlayerAmmo? And the other way, how to prevent the Storm weapon to reload when I'm equipped of the custom one? I'm not sure that clear :lol:
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
User avatar
djhubertus
Translator
Translator
Posts: 1097
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: [Solved] How to dissociate direct hit and AOE?

Post by djhubertus »

Cerovan wrote:By removing the "CUIConfig::EUISound::Silence" you hear the sound ? (or put a blank "")
Nope, still the same.
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
User avatar
Cerovan
Posts: 2007
Joined: 11 Jul 2011, 11:27
Location: France
Contact:

Re: [Solved] How to dissociate direct hit and AOE?

Post by Cerovan »

fleo wrote:So I did the same for custom weapons, that's no big deal. The +1 visual notification is quite harder to code because I'm lost in all the manialinks in Elite :roflol:
In that case create a new manialink layer which handle the notification only ;)
fleo wrote:And I'm quite confuse about how to use custom weapons. I currently use ActionLoad and ActionBind to equip them. I also use ActionBind(_Player,CSmMode::EActionSlot::Slot_X,CSmMode::EActionInput::None); to unequipped them. But I don't know if I have to unload them.
CSmMode::EActionInput::None will unequipped it, you have to do that in order to have pads working with the players.
fleo wrote:For example if I want a custom weapon not to reload while I'm using a Storm weapon (same behaviour as in Combo for instance, a weapon doesn't reload when it's not equipped), should I unload the weapon from the player or should I modify the energy of the weapon like we do with SetPlayerAmmo?
Actually there is two things to separe :

Code: Select all

LoadAction(Player, CSmMode::EActionSlot::Slot_A, NullId, 0);
It will unload it (the energy of the weapon will be at 0 when you'll put it back).

Code: Select all

BindAction(Player, CSmMode::EActionSlot::Slot_A, CSmMode::EActionInput::None);
It will unequipped the weapon (actually you'll not be able to use it by clicking on the left button of the mouse)

From there i think that you know what you've to do :thumbsup:
fleo wrote:And the other way, how to prevent the Storm weapon to reload when I'm equipped of the custom one? I'm not sure that clear :lol:
Just set the ammo of the Storm weapon at 0 :mrgreen:

@djhubertus : ok it's strange, in that case trigger the sound manually :(
Online Programmer & Meme Master ヾ(⌐■_■)ノ

Access to your Player Page

You have troubles, please contact the Ubisoft Support

Maniaplanet Documentation (Editors, Scripting, Title Pack, etc...)
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: [Solved] How to dissociate direct hit and AOE?

Post by fleo »

Ok thanks, so there is no way pause the energy reloading? I mean if my shotgun was half-loaded when I switched to rockets, is it possible to have it half-loaded when I switch back to it? With these functions I only could let it loading continuously or empty it completely.

I have another question, tell me if I should create another topic. Is it possible to create a custom rocket deny? Working with laser and a projectile of a custom weapon.
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: [Solved] How to dissociate direct hit and AOE?

Post by fleo »

About sound, I've tried to add the UIGunChanged.wav sound for custom weapons because by default there is no sound to indicate that you switched your weapon. I didn't find this sound as a CUIConfig::EUISound so I can't call it through the PlaySound() function. So I decided to play it in the manialink like this:

Code: Select all

UI.ManialinkPage = """//{{{Now}}}
	<audio looping="0" hidden="1" play="1" data="Media/Sounds/UIGunChanged.wav"/>""";
Just before switching weapon, but it takes like half a second to play, that's pretty disturbing...any suggestion?
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: [Solved] How to dissociate direct hit and AOE?

Post by Eole »

fleo wrote:Just before switching weapon, but it takes like half a second to play, that's pretty disturbing...any suggestion?
You could use the functions from the audio manager. You can load and play a sound with a script in a manialink. Then you can use a netwrite variable to play the sound from the mode script.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
fleo
Posts: 304
Joined: 02 Sep 2011, 12:56

Re: [Solved] How to dissociate direct hit and AOE?

Post by fleo »

Ok I'll try that, thanks :thumbsup:

I have a sound glitch with the custom weapon in attack. When a player kills a def (or at least the last def, I have to check) with his custom weapon, a sound loop starts. It sounds a little like the pole sound before it's capturable or a weapon reloading. It lasts until the player is in attack again and equips his custom weapon again.

It's happening only for the attacker and only with his custom weapon. And stops only when he equips this same weapon again.

There is a video: http://youtu.be/o_RBRKuprAo

My scripts are here, but I have no clue about where it's from because even when I disable every sounds played in the mode, the glitch still happens...
Follow me on my maniaflash. Try the new elitealternative! Feedbacks on this post. :thumbsup:

♫ I need αεяø. I'm holding out for αεяø 'til the end of the night. ♫
User avatar
djhubertus
Translator
Translator
Posts: 1097
Joined: 09 Jul 2012, 18:30
Location: Poland
Contact:

Re: [Solved] How to dissociate direct hit and AOE?

Post by djhubertus »

I have the same, gauge sound are looping and to stop, player need to leave server.
My Gamemodes:
MP4 - Countdown, Firefight
MP3 - Reduction, Overload, Flashpoint, Territory, SM Race, Escape
MP2 - Search & Destroy, Oscillation, Instagib
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: [Solved] How to dissociate direct hit and AOE?

Post by steeffeen »

see http://forum.maniaplanet.com/viewtopic.php?t=27903 regarding the actual topic of this thread
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    Post Reply

    Return to “ManiaScript”

    Who is online

    Users browsing this forum: No registered users and 1 guest