Page 2 of 3
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 23 May 2014, 10:12
by djhubertus
Cerovan wrote:For the hit sound it should be automatic so i don't know why it's not played for you

Also for me it's not work

I made custom notice but i don't hear hit sound that should be automatic.
Code: Select all
// Action Maker Events
else if(Event.Type == CSmModeEvent::EType::OnActionCustomEvent)
{
if(Event.Param1 == "damage" && Event.Shooter != Null && Event.Victim != Null && Event.Victim != Event.Shooter)
{
Event.Victim.Armor -= 100;
if(Event.Victim.Armor <= 100)
{
Layers::Attach("Info", Event.Victim);
}
else
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);
Score::AddPoints(Event.Shooter, 1);
//Mode::PlaySound(CUIConfig::EUISound::PlayerEliminated);
//Event.ShooterPoints = 1;
PassOn(Event);
}
}
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 23 May 2014, 10:20
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 "")
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 23 May 2014, 11:00
by fleo
But what sounds are we talking about exactly?

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
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

Re: [Solved] How to dissociate direct hit and AOE?
Posted: 23 May 2014, 11:31
by djhubertus
Cerovan wrote:By removing the "CUIConfig::EUISound::Silence" you hear the sound ? (or put a blank "")
Nope, still the same.
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 23 May 2014, 13:23
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

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
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

Just set the ammo of the Storm weapon at 0
@djhubertus : ok it's strange, in that case trigger the sound manually

Re: [Solved] How to dissociate direct hit and AOE?
Posted: 23 May 2014, 14:38
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.
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 28 May 2014, 10:15
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?
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 28 May 2014, 13:51
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.
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 31 May 2014, 17:07
by fleo
Ok I'll try that, thanks
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...
Re: [Solved] How to dissociate direct hit and AOE?
Posted: 31 May 2014, 19:19
by djhubertus
I have the same, gauge sound are looping and to stop, player need to leave server.