# SnippetDummy

#### Dirac

##### 22710180
JASS:
``````/**********************************************************************

My own version of the so called DummyCaster &quot;system&quot;

***********************************************************************
*
*   struct Dummy
*
*       method load takes integer abilityRawCode returns nothing
*       method unload takes integer abilityRawCode returns nothing
*           -   Adds or removes the given ability
*
*       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 &quot;!&quot; 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);
UnitRemoveAbility(dummy,CROW_FORM);
}
}

public struct Dummy[]
{
static method is(unit whichUnit)-&gt;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);
}

{
}

{
return UnitRemoveAbility(dummy,this);
}

module Init;
}
}
//! endzinc
//! textmacro DUMMY_UNIT_CREATE
//! externalblock extension=lua ObjectMerger \$FILENAME\$
//! i setobjecttype(&quot;units&quot;)
//! i createobject(&quot;ewsp&quot;,&quot;dumy&quot;)
//! i makechange(current,&quot;uabi&quot;,&quot;Avul,Aloc,Aeth&quot;)
//! i makechange(current,&quot;uble&quot;,&quot;0&quot;)
//! i makechange(current,&quot;ucbs&quot;,&quot;0&quot;)
//! i makechange(current,&quot;umxp&quot;,&quot;0&quot;)
//! i makechange(current,&quot;umxr&quot;,&quot;0&quot;)
//! i makechange(current,&quot;umdl&quot;,&quot;war3mapImported\\dummy.mdl&quot;)
//! i makechange(current,&quot;uico&quot;,&quot;replaceableTextures\\CommandButtons\\BTNtemp.blp&quot;)
//! i makechange(current,&quot;uimz&quot;,&quot;0&quot;)
//! i makechange(current,&quot;ulpz&quot;,&quot;0&quot;)
//! i makechange(current,&quot;uprw&quot;,&quot;1&quot;)
//! i makechange(current,&quot;uspa&quot;,&quot;&quot;)
//! i makechange(current,&quot;ucbs&quot;,&quot;0&quot;)
//! i makechange(current,&quot;udty&quot;,&quot;divine&quot;)
//! i makechange(current,&quot;umvs&quot;,&quot;522&quot;)
//! i makechange(current,&quot;umvt&quot;,&quot;hover&quot;)
//! i makechange(current,&quot;ucol&quot;,&quot;0&quot;)
//! i makechange(current,&quot;ufle&quot;,&quot;0&quot;)
//! i makechange(current,&quot;ufoo&quot;,&quot;0&quot;)
//! i makechange(current,&quot;uhom&quot;,&quot;1&quot;)
//! i makechange(current,&quot;umpi&quot;,&quot;1000&quot;)
//! i makechange(current,&quot;umpm&quot;,&quot;1000&quot;)
//! i makechange(current,&quot;umpr&quot;,&quot;100&quot;)
//! i makechange(current,&quot;urac&quot;,&quot;commoner&quot;)
//! i makechange(current,&quot;usid&quot;,&quot;0&quot;)
//! i makechange(current,&quot;usin&quot;,&quot;0&quot;)
//! i makechange(current,&quot;utyp&quot;,&quot;&quot;)
//! i makechange(current,&quot;ubui&quot;,&quot;&quot;)
//! i makechange(current,&quot;upgr&quot;,&quot;&quot;)
//! i makechange(current,&quot;unam&quot;,&quot;DummyUnit&quot;)
//! i makechange(current,&quot;utip&quot;,&quot;DummySystem&quot;)
//! i makechange(current,&quot;utub&quot;,&quot;&quot;)
//! endexternalblock
//! endtextmacro``````

#### Dirac

##### 22710180
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!!
You forget to change this:

and this

[ljass]- CCS by Dirac[/ljass]

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

#### Dirac

##### 22710180
Update:
-Minor fix (now the constant Dummy_Type is public)

#### Solmyr

##### Active Member
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)
Jesus4Lyf's DummyCaster is implemented horribly (just like all of his scripts).

#### Dirac

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

#### Solmyr

##### Active Member
1. It does, that's the whole idea
It doesn't. Do some research before ridiculing yourself.

#### PurgeandFire

##### zxcvmkgdfg
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
This appears to be the less useful cousin of xecast (an xe module).

Graveyarded.

#### Dirac

##### 22710180
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.

#### Ghan

##### Administrator - Servers are fun
Staff member
Bump for reconsideration.

#### Dirac

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

#### luorax

##### Invasion in Duskwood
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.
• jonas:
where did you go?
• The Helper:
Jefferson TX on a Paranormal Investigation of a haunted bed and breakfast - I got some friends that are paranormal investigators and they have an RV and do YouTubes
+1
• The Helper:
It was a lot of fun. The RV was bad ass
• jonas:
That sounds like fun!
+1
• The Helper:
it was a blast!
• The Helper:
I am going to post the Youtube of the investigation in the forums when it is ready
+1
• jonas:
cool!
• vypur85:
Sounds cool TH.
• tom_mai78101:
I was on a Legend of Zelda marathon...
• tom_mai78101:
Am still doing it now
+1
• jonas:
which one(s) are you playing?
• jonas:
I played a little bit of the switch title two weeks ago and found it quite boring
• The Helper:
just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
+1
• The Helper:
Happy Tuesday!
• The Helper:
We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
• The Helper:
Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
+1
• Ghan:
Beep boop
+1
• The Helper:
hears robot sounds while 250 bots are on the forum lol
• The Helper:
Happy Saturday!
+1
• The Helper:
and then it was Thursday...
+2
• tom_mai78101:
And then Monday
+1
• The Helper:
I got the day off today!
+1
• tom_mai78101:
How...? (T-T)
• The Helper:
I took the day off. I work for myself so I can do that.
+1
• Varine:

### Members online

No members online now.