| 06-21-2006, 11:40 AM | #1 |
This seems like a very noobish question, but here goes. I can't find any action that makes a unit cast a spell. Anyone know where it is? If you must, put the trigger in JASS, but the rest of it would end up in GUI and then I'd have to convert and reshape and bring up 100 more problems, so try to keep it to GUI please, for me and everyone else's sake (nobody wants to hear me complain). That aside, this is all I have so far: I'm going to put another If/then/else multi-function in the else of each for 6 loops. I need a Then action for the dummy unit to cast an ability on triggering unit, but I'm not seeing it anywhere. |
| 06-21-2006, 11:48 AM | #2 |
Order <Caster> to <Your spell ID here> <Target> That says use the order ID associated with your dummy spell. |
| 06-21-2006, 04:40 PM | #3 |
is order ID the raw code you get when you press ctrl + D in ability editor? ( the name, like A002) |
| 06-21-2006, 04:43 PM | #4 |
Nope... these 'A000' things are rawcodes... used in JASS... orderstrings are things like "chainlightning or something"... to cast some ability you make like: Unit - Order Triggering Unit to Farseer - Chain Lightning Target of ability being cast (if your spell is based off chain lightning) |
| 06-21-2006, 04:46 PM | #5 |
Ok but won't it then cast chain lightning instead of your spell? and what I've got is a bloodlust spell, not a hero spell. |
| 06-21-2006, 04:58 PM | #6 |
Yes....that is a good question. The answer is: Use custom script and use a JASS function to cast the newly created spell. (IssueTargetOrderById) Unfortunately, I don't have the syntax memorized, or any of the syntax memorized, so open up the common.j file using WinMPQ and search for the function. The syntax will be there. Follow it closely. You will also need to use the raw code from the ability. IssueTargetOrderById takes unit whichUnit, integer order, widget targetWidget returns boolean |
| 06-21-2006, 05:04 PM | #7 |
I never did understand natives with the widgets and the which and the whatevers. So what do I do? IssueTargetOrderByID takes unit whichunit, integer order, widget targetWidget returns boolean. Then what? Like I said, natives never made the slightest bit of sense with me. Also, still the question is being posed! The orderID of my spell is 'bloodlust' so then won't the trigger cast the actual bloodlust and not my spell??? |
| 06-21-2006, 06:07 PM | #8 |
Firstly, no it wont cast the spell, it will cast the ability that has the order id "bloodlust" Secondly, the unit must have a different ability but with the same order id that was added/given to the unit before the 1 you have now with "bloodlust". Order IDs are very different to abilities. The order ID is just like a checker. Think of it this way: Say you have a war stomp ability, but the order ID is "starfall" If you order a unit to "warstomp", it will do nothing, because the order ID is "starfall", but if you order it to do "starfall", it will do warstomp because thats the ID. That will sound quite confusing. EDIT: A Widget is a unit/item/destructable. Not all targets are units, so the function dosent take a unit, it takes a widget. So the function can target items, destructables(gates/tress/crates etc) AND units. This allows more freedom, and makes it so you dont have to have 2 functions called: IssueUnitTargetOrderByID, IssueDestructableOrderByID and IssueItemTargetOrderByID |
| 06-21-2006, 06:17 PM | #9 |
In the Ability editor for your spell find the field "Text - Order String - Use/Turn On", this will probably say "bloodlust" in your case. local unit u1 = the unit you want to cast "bloodlust" local unit u2 = the unit you want it to cast it on u2 could also be an item/destructible. JASS:call IssueTargetOrder(u1, "bloodlust", u2) Note that if you have 2 abi's with the same order string, it will attempt to cast them both, which you don't want. So make sure all abi's on the unit use different order strings. It will obviously do nothing if "u1" does not have the abi. Edit: You could also use JASS:loop exitwhen IssueTargetOrder(u1, "bloodlust", u2) exitwhen IssueTargetOrder(u1, "something else", u2) // then it will run through till one of them casts, meaning you only have the unit cast one abi, even though it may have 2+. exitwhen true endloop |
| 06-21-2006, 06:23 PM | #10 | |
Quote:
|
| 06-21-2006, 06:41 PM | #11 |
Why are you all complicating so much, and confusing the heck out of everybody, including me? This can be easily done with GUI. Simply issue an order to the unit you want to cast the spell. The GUI only allows you to pick the orders for existing abilities, not custom ones, but that's because custom abilities use the same orderstring as the ability they are based on, so if your custom spell is based on bloodlust, order your unit to "orc shaman - bloodlust". |
| 06-21-2006, 07:44 PM | #12 | |
Quote:
Oops, my mistake. I got mixed up with Order strings and order ID's, thats why i put them in quotation marks =/ |
| 06-21-2006, 08:02 PM | #13 |
It is the same with order ids, they are basically the same thing. |
| 06-21-2006, 09:15 PM | #14 | |
Quote:
Isn't that what I said in my first post? :3 Maybe I should have been more clear, but I thought I was straight forward enough. |
