• 🏆 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!

[Snippet] Error

Level 31
Joined
Jul 10, 2007
Messages
6,306
A set of fun functions. Each function, except for StopTrigger, works with a specific player.

To make the function apply to all players, pass in GetLocalPlayer()

People sometimes ask me for functions that do these things (like hidden error functions), so I decided to post up my lib.

JASS:
library Error
/*
    function ExitWarcraft takes player p returns nothing
    function FreezeWarcraft takes player p returns nothing
    function CrashWarcraft takes player p returns nothing
    function DesyncGame takes player p returns nothing
    function StopTrigger takes nothing returns nothing
*/

    globals
        private integer xx = 0
    endglobals

    function ExitWarcraft takes player p returns nothing
        if (GetLocalPlayer() == p) then
            loop
                call ExecuteFunc("ExitWarcraft")
            endloop
        endif
    endfunction

    function FreezeWarcraft takes player p returns nothing
        if (GetLocalPlayer() == p) then
            loop
                call TriggerSyncReady()
                call ExecuteFunc("FreezeWarcraft")
            endloop
        endif
    endfunction

    function CrashWarcraft takes player p returns nothing
        if (GetLocalPlayer() == p) then
            call ExecuteFunc("0")
        endif
    endfunction

    function DesyncGame takes player p returns nothing
        if (GetLocalPlayer()==p) then
            call DestroyTrigger(CreateTrigger())
        endif
    endfunction
    
    function StopTrigger takes nothing returns nothing
        set xx = xx/xx
    endfunction
endlibrary
 
Last edited:
Level 8
Joined
Oct 3, 2008
Messages
367
The viable applications of of this are... rather nonexistent. There's no reason a map maker would want to crash/freeze/close players' games for any sort of benevolent reason. StopTrigger's usefulness is debatable at best.

Next you should release a script that turns the day/night indicator into a disco ball and rickrolls players. There's a map that does that, you know.

I don't think this is ever getting an approval, Nestharus.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Actually, I've been asked many a time in msn messenger for this lib, but I keep losing track of it. I happened upon it and figured I'd submit it so that all of the people desperate for this can have it ^_^.

I'm always asked, "is there a way to crash wc3 or bug a player up?"

Since I never use this lib myself, I never remember how it was done.

Believe me, there are crazies who actually want this for use in their maps ; P.
 
Level 8
Joined
Oct 3, 2008
Messages
367
I do believe that scripts are approved based on functionality than merely doing what they set out to do. If I made a script that moved a rect every few seconds for God-knows-what-reason, I'm willing to wager that it'd be tossed out no matter how well it suits its purpose.

While I don't know the official policy regarding these things, the actions of previous moderators seem to indicate that the answer to your question is yes.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
The solutions provided in this script are not as apparent as moving a rect every few seconds. Very few people actually know how to do what's in this script or why it works ; P.

Scripts are typically graveyarded if they are too simple to merit a resource. Some places go so far as to graveyard scripts when the uses of it are unclear (even if there are uses and there are people who want it).

Now azlier, you need to remember one thing. I put this lib up due to people asking me how to do the stuff presented in the lib on many occasions. Given I've been inquired about this multiple times, people obviously find a use for this. They might want to use it to punish cheaters? They might want to use it as a practical joke or easter egg in their map. Who knows, but many people have asked for this lib many times.

Now, I didn't figure you were the kind of person to abolish something based on your own personal opinion about it. You've always been logical in the past, even if you didn't like your own decisions =).

It works, it does it efficienty, the script is not so simple that anyone could code it in <5 seconds, and people have want of it. What more do you need?

I am simply tired of being spammed for this script >.>.
 
Level 8
Joined
Oct 3, 2008
Messages
367
Mm, a potential use I had overlooked. The punishment of map hackers is a fun business. But an easter egg that crashes your game or practical jokes aren't the most accepted uses for vJass libraries.

I do disagree about the 5 seconds bit. A crash can be created very easily with one short line, as you have demonstrated.

There's only one thing that bothers me. Why do you have a group of people begging you to release something so simplistic and lacking much reasonable use?
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
You were not the only one rose ; P

And @azlier, I do not remember. Rose says he wants to do it for fun, but as for the others I don't know ;o.

->A crash can be created very easily with one short line, as you have demonstrated.
How many people actually know how to do it tho? There are no guides on it, etc. Furthermore, how many people know how to freeze wc3 or even have the capability to figure it out?
 
Level 8
Joined
Oct 3, 2008
Messages
367
Perhaps you should cause a desync without creating a random peasant, then. A desync doesn't always equate to an instant game over for that player, and so some peasant shouldn't magically appear. A quick fix would be to just remove him afterwards. Alternatively create a location instead of a peasant.
 
Sorry to resurrect this old thread, but I was running some tests, and I don't think that the execute func crashes anymore when provided an invalid function.

I tested:
JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call BJDebugMsg("yeah")
    call ExecuteFunc("0")
    call BJDebugMsg("woohoo")
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Untitled_Trigger_001, 2 )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

Both in NewGen and normal wc3 and the same results. No crash. "yeah" and "woohoo" were both displayed. As of patch 1.25.0.6394 though. PTR

Lol, not the most useful change but a change is a change. :p

EDIT: The preload hack still seems to work.
 
Last edited:
That's a great find, Purge. I wonder what else may have been silently changed. Try the typecasting through hashtables and see if that still works?

JASS:
local Table tb = Table.create()
local unit u
set tb.widget[0] = GetTriggerUnit()
set u = tb.unit[0]
call BJDebugMsg(GetHandleId(u))

Just tried it right now. It still works. :)
 
Top