Snippet Dummy

Dirac

22710180
Reaction score
147
JASS:
/**********************************************************************

My own version of the so called DummyCaster "system"

***********************************************************************
*
*   struct Dummy
*
*       method load takes integer abilityRawCode returns nothing
*       method unload takes integer abilityRawCode returns nothing
*           -   Adds or removes the given ability
*           -   Dummy['A000'].load()
*
*       static method operator x= takes real n returns nothing
*       static method operator y= takes real n returns nothing
*       static method operator z= takes real n returns nothing
*           -   Sets the unit's position
*
*       static player owner
*           -   Sets the dummy's owner.
*
*       integer level
*           -   Sets the dummy's ability level.
*           -   Dummy['A000'].level=2
*
*       method castOnTarget takes unit target returns boolean
*       method castOnPoint takes real x, real y returns boolean
*       method cast takes nothing returns boolean
*           -   Dummy[OrderId].castOnTarget(unit)
*
***********************************************************************

    HOW TO IMPLEMENT:
*       Import this code into an empty trigger in your map, requires NewGen installed. Save the map, reopen it,
*       and then delete the "!" exclamation mark from the textmacro below
*/
        //! runtextmacro DUMMY_UNIT_CREATE()

/*********************************************************************/
//! zinc

library Dummy
{
    public  constant integer DUMMY_TYPE      ='dumy';
    public  constant integer CROW_FORM       ='Amrf';
           
    unit    dummy;
    boolean p=false;
    
    module Init
    {
        private static method onInit()
        {
            dummy=CreateUnit(Player(15),DUMMY_TYPE,0,0,0);
            UnitAddAbility(dummy,CROW_FORM);
            UnitRemoveAbility(dummy,CROW_FORM);
        }
    }

    public struct Dummy[]
    {
        static method is(unit whichUnit)->boolean
        {
            return dummy==whichUnit;
        }
            
        static method operator x=(real n)
        {
            SetUnitX(dummy,n);
            p=true;
        }
        
        static method operator y=(real n)
        {
            SetUnitY(dummy,n);
            p=true;
        }
            
        static method operator z=(real n)
        {
            SetUnitFlyHeight(dummy,n,0);
        }
            
        static method operator owner=(player p)
        {
            SetUnitOwner(dummy,p,false);
        }
        
        method operator level=(integer i)
        {
            SetUnitAbilityLevel(dummy,this,i);
        }
            
        method cast()
        {
            IssueImmediateOrderById(dummy,this);
        }
            
        method castOnTarget(widget t)
        {
            if(!p)
            {
                SetUnitX(dummy,GetWidgetX(t));
                SetUnitY(dummy,GetWidgetY(t));
            }
            p=false;
            IssueTargetOrderById(dummy,this,t);
        }
            
        method castOnPoint(real x,real y)
        {
            if(!p)
            {
                SetUnitX(dummy,x);
                SetUnitY(dummy,y);
            }
            p=false;
            IssuePointOrderById(dummy,this,x,y);
        }
        
        method load()->boolean
        {
            return UnitAddAbility(dummy,this);
        }
            
        method unload()->boolean
        {
            return UnitRemoveAbility(dummy,this);
        }
                
        module Init;
    }
}
//! endzinc
//! textmacro DUMMY_UNIT_CREATE
    //! externalblock extension=lua ObjectMerger $FILENAME$
        //! i setobjecttype("units")
        //! i createobject("ewsp","dumy")
        //! i makechange(current,"uabi","Avul,Aloc,Aeth")
        //! i makechange(current,"uble","0")
        //! i makechange(current,"ucbs","0")
        //! i makechange(current,"umxp","0")
        //! i makechange(current,"umxr","0")
        //! i makechange(current,"umdl","war3mapImported\\dummy.mdl")
        //! i makechange(current,"uico","replaceableTextures\\CommandButtons\\BTNtemp.blp")
        //! i makechange(current,"uimz","0")
        //! i makechange(current,"ulpz","0")
        //! i makechange(current,"uprw","1")
        //! i makechange(current,"uspa","")
        //! i makechange(current,"ucbs","0")
        //! i makechange(current,"udty","divine")
        //! i makechange(current,"umvs","522")
        //! i makechange(current,"umvt","hover")
        //! i makechange(current,"ucol","0")
        //! i makechange(current,"ufle","0")
        //! i makechange(current,"ufoo","0")
        //! i makechange(current,"uhom","1")
        //! i makechange(current,"umpi","1000")
        //! i makechange(current,"umpm","1000")
        //! i makechange(current,"umpr","100")
        //! i makechange(current,"urac","commoner")
        //! i makechange(current,"usid","0")
        //! i makechange(current,"usin","0")
        //! i makechange(current,"utyp","")
        //! i makechange(current,"ubui","")
        //! i makechange(current,"upgr","")
        //! i makechange(current,"unam","DummyUnit")
        //! i makechange(current,"utip","DummySystem")
        //! i makechange(current,"utub","")
    //! endexternalblock
//! endtextmacro
 

Dirac

22710180
Reaction score
147
J4L isn't user friendly, plus, it forces the user to move the dummy, add and remove abilities, change it's owner, ability level and has no safety methods.

Mine is clearly more useful
 

Laiev

Hey Listen!!
Reaction score
188
You forget to change this:

[ljass]<Your Jass NewGen folder>\tesh\includes\CCS.j[/ljass]

and this

[ljass]- CCS by Dirac[/ljass]

They are named your system :p

Also you forget an ILLUSION at the header ^_^'
 

Solmyr

Ultra Cool Member
Reaction score
30
  1. Your dummy unit doesn't cast instantaneously. This means that it will fail very hard when used with groups or for consecutive casts.
  2. It doesn't work with channeling spells or spells that have a casting time.
  3. Your functions have way too many arguments.
Why would I ever use this over xecast?

Well, J4L was faster than you. (But it's not that big surprise - he is Jesus4Lyf)
http://www.thehelper.net/forums/showthread.php/133873-DummyCaster
Jesus4Lyf's DummyCaster is implemented horribly (just like all of his scripts).
 

Dirac

22710180
Reaction score
147
1. It does, that's the whole idea
2. No, i should put add that to the system's description, however, there are always ways to avoid dummy channeling spells
3. That's why i added the TESH, these arguments can't be avoided
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
You should add a demo map. ;) It is generally useful for these kinds of resources where some might not see the purpose of it.

Jesus4Lyf's DummyCaster is implemented horribly (just like all of his scripts).

I'm not sure what you mean. It creates a dummy unit, that's it. It assigns it to a variable and it is left to the user to control its casting. It does nothing more and isn't meant to do anything more.

If you are saying that it is inferior to xecast then I am not sure what to say, as the two don't seem to be comparable considering one is meant for the actual casting process while the other is strictly for creation.

Sorry if I misunderstood, but those kinds of blanket statements don't make sense when no reasoning is given for them.
 

tooltiperror

Super Moderator
Reaction score
231
This appears to be the less useful cousin of xecast (an xe module).

Graveyarded.
 

Dirac

22710180
Reaction score
147
after some tests, xecast seems to be broken (most of the times dummies wont cast the spell), plus it's way of working is confusing, noneffective and outdated.

Updated the system
-Changed everything.
 

Dirac

22710180
Reaction score
147
Thanks for the interest Ghan
I updated the system
-Changed the documentation
-The dummy's movement type is now Hover.
 

luorax

Invasion in Duskwood
Reaction score
67
There's a really big chance of rawcode glitch, 'e000' is an object editor standard. You should change it to something different and tell the user where and how to change it in the LUA script (not everyone has the required knowledge, you know)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top