• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Error system? SIMERROR links dead (wc3)

Level 5
Joined
Nov 3, 2018
Messages
80
hey there! i was looking for an error system so that i could change the sounds in game like
"an ally its being attacked"
"a hero has fallen" and so for a custom race , after googling and searching a lot my solution was/is "Vexorian's SimError" system
issue is that like many old posts that send you to wc3 the solution is no longer available since that site is dead. i tried searching in a lot of different ways for that system so is there anything closely related?

i know that you can replce sounds and errors in game interface constants but that's replacing human ui sounds which is not what i am aiming for
and i know for a fact that i can mute those sounds and catch some events with triggers as a workaround but there's many events that i'm not sure how to catch (like a player not being able to place a building or attacking an unit or not having enough mana to cast a spell or food)
1710715066108.png
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
SimError only plays the generic error chime and then shows a custom text message in (what it thinks is) approximately the place a normal error would appear. It does not modify the game's error functionality in any way. Here is the full library, but I don't think it helps with what you want to achieve:
JASS:
library SimError initializer init
//**************************************************************************************************
//*
//*  SimError
//*
//*     Mimic an interface error message
//*       call SimError(ForPlayer, msg)
//*         ForPlayer : The player to show the error
//*         msg       : The error
//* 
//*     To implement this function, copy this trigger and paste it in your map.
//* Unless of course you are actually reading the library from wc3c's scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************

//==================================================================================================
    globals
        private sound error
    endglobals
    //====================================================================================================

    function SimError takes player ForPlayer, string msg returns nothing
        set msg="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+msg+"|r"
        if (GetLocalPlayer() == ForPlayer) then
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
            call StartSound( error )
        endif
    endfunction

    private function init takes nothing returns nothing
         set error=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
         //call StartSound( error ) //apparently the bug in which you play a sound for the first time
                                    //and it doesn't work is not there anymore in patch 1.22
    endfunction

endlibrary
there's many events that i'm not sure how to catch (like a player not being able to place a building or attacking an unit or not having enough mana to cast a spell or food)
There are no events or anything else like that you can use to detect these sorts of things. The only way to know would be to do something like repeatedly read the UI elements currently displayed on a very short timeout and then check the cooldown of all abilities to confirm that the cast frame was exited but nothing went on cooldown. Way too much work.
 
Level 5
Joined
Nov 3, 2018
Messages
80
SimError only plays the generic error chime and then shows a custom text message in (what it thinks is) approximately the place a normal error would appear. It does not modify the game's error functionality in any way. Here is the full library, but I don't think it helps with what you want to achieve:
JASS:
library SimError initializer init
//**************************************************************************************************
//*
//*  SimError
//*
//*     Mimic an interface error message
//*       call SimError(ForPlayer, msg)
//*         ForPlayer : The player to show the error
//*         msg       : The error
//*
//*     To implement this function, copy this trigger and paste it in your map.
//* Unless of course you are actually reading the library from wc3c's scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************

//==================================================================================================
    globals
        private sound error
    endglobals
    //====================================================================================================

    function SimError takes player ForPlayer, string msg returns nothing
        set msg="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+msg+"|r"
        if (GetLocalPlayer() == ForPlayer) then
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
            call StartSound( error )
        endif
    endfunction

    private function init takes nothing returns nothing
         set error=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
         //call StartSound( error ) //apparently the bug in which you play a sound for the first time
                                    //and it doesn't work is not there anymore in patch 1.22
    endfunction

endlibrary

There are no events or anything else like that you can use to detect these sorts of things. The only way to know would be to do something like repeatedly read the UI elements currently displayed on a very short timeout and then check the cooldown of all abilities to confirm that the cast frame was exited but nothing went on cooldown. Way too much work.
Thank you pyrogasm ! this is better than nothing
i appreciate the code :D ill give it a try
 
Top