- Joined
- May 9, 2011
- Messages
- 228
anyone knows how to make the computer units cast spells?
pls help me +rep for the one who help me
pls help me +rep for the one who help me
What's the spell you have based your custom one on?
If its normal ladder skill you can refer to it via actions. Lets say it's custom chain lightning.
There are 3 types of actions Unit - Issued an order:
- Unit - Order Yourunit to Orc - Far Seer: Chain Lightning YourTarget
- no target
- target object (one for unit, one for destructible, one for item)
- target location
Find the one you need in Unit section in Actions and from filter select the 'base' ability.
If your spell isn't ladder one (egzample channel) you can always use:
Ofcourse you can write it with custom scripts in GUI - don't worry.JASS:// For location native IssuePointOrder takes unit whichUnit, string order, real x, real y returns boolean // Target native IssueTargetOrder takes unit whichUnit, string order, widget targetWidget returns boolean // No target native IssueImmediateOrder takes unit whichUnit, string order returns boolean
There is also alternative: you can always replace those functions with 'ById' ones - so instead of 'string' (order egzample: "thunderbolt") you can write the Id (integer number) of given order.
As you see, instead of 'string' function requires integer variable. If you gonna follow that method this will be usefull for you.JASS:native IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean
It's simple. You have to order CPU to cast your custom spells via triggers. mckill2009 said that CPU cast ladder based spell without triggers - although half true because if your ladder spell has no effect (whole effect is triggered) you are still forced to trigger that reaction yourself.spIn>>i dont get your point can you make it understandable
you mean the order string right? is the base spell