| 04-27-2003, 08:32 PM | #1 |
Let's say that you're trying to create a custom spell with triggers. Here's an example: You want your hero (let's call him "Archmage") to have a spell capture all enemy units in a small radius around himself. Now, let's also say that you want the player to click an ability button for the spell to capture all of the enemy units around Archmage. Since some things cannot be done by spell editing with an external program, you can use this method. - - - 1. Player clicks a spell button (starfall) <-- Or whatever, doesn't matter but I'm using that one as an example. 2. You don't actually want the unit to cast the starfall, but rather to set off a trigger that you created that will use trigger actions to do the actual things your spell wants. - - - If you want the unit to stop what it is doing, including stopping spells like "starfall", use the trigger action: Game - Force UI Key From there, you can force them to push 's' or 'h', or whatever. If a player has a unit or group selected, this will stop the unit in it's tracks ignoring all spell casting or movement orders it previously had. NOTE - You may also have to do a small wait action (.5 or something) after a spell has begun casting, but maybe not. - - - If you are still reading this (and are understanding), I will go through a full example right now. EVENT - Unit - A unit owned by player (X) is issued an order with no target (i.e. starfall) CONDITON - Unit Comparrison - Triggering unit equal to "Archmage" ACTIONS: Wait .5 seconds (or so) IF/THEN/ELSE - IF [Order Comparisson] Issued order equal to "starfall - THEN [Game] Force UI Key 'S' - ELSE - Do Nothing IF/THEN/ELSE - IF [Order Comparisson] Issued order equal to "starfall - THEN [Unit Group] Pick every unit within (range) 500 units of (Archmage) and do ACTION (Unit - Change Owner of "Picked Unit" to Player 1) - ELSE - Do Nothing - - - Two additional trigger actions to provide more security for tricky people trying to use the actual starfall spell: Selection - Clear Selection Selection - Add (Archmage) to selection The two above trigger actions should be at the top of the trigger action list to prevent the user from clicking the ability button and then quickly unclicking it. - - - NOTES: On the Issuing orders subjects, one must remember that spells such as Starfall and Immolation are orders "WITH NO TARGET" whereas abilities such as blizzard are orders "TARGETING A POINT" and don't forget that abilities such as chain lightning are orders "TARGETING A UNIT" This can also be used to prevent units from moving into regions they are not currently allowed into by forcing the 's' key when they are ordered to move to a region. - - - - Draco Comments/Questions? |
| 04-29-2003, 03:08 AM | #2 |
If you want to click a button to execute a trigger based spell, wouldn't it be easier to simply spell edit a spell so that it does zero damage (or has no duration, deoending on the spell)? Then you could base the trigger based spell off of the "real" spell without any need to abort the "real" spell. Am I wrong? |
| 05-01-2003, 10:19 PM | #3 |
Ah, but what if you still wanted to use that spell for other units? |
| 05-01-2003, 11:10 PM | #4 |
True. Hmmm. I suppose you could use the spell editor to create a dummy spell (with a new and unique order string). I've not tried it but I'd *think* it would work. To be sure, your method is way better if you don't want to muck around in all the labor, and annoyance that spell editing is. |
| 05-01-2003, 11:32 PM | #5 |
Yeah, it is easier than spell editing; but I must agree with you on a certain point of going about it your way. You see, if some crazy guy decided to click the button a lot (I mean a whole lot of times) and has super reflexes or uses hotkeys really good, there IS SOME CHANCE that the spell will still go through. It is a minimal threat, but nonetheless, not 100.00% error proof. That's where the more complicated stuff would pay off. :D |
| 05-17-2003, 02:07 PM | #6 |
Ummm order with no target-stop ordered unit |
| 05-21-2003, 06:03 PM | #7 |
This way to do the things does have an use! I created a npc-Guy based on the priesess of the moon and he actually uses his ultimate spell without AI programing thanks to this method! I just found that Unit-issue order without a target And using "Stop" as the order works exactly as Force UI key, I believe that using order instead of ui key is better, just because there are different language versions of the game and some of them have a different hotkey for stop, also you can Use wait for 0.01 seconds. Also Order prevents better from using the spell and you don't need those selection triggers, OH And it won't stop the other units! |
| 06-01-2003, 02:59 PM | #8 |
For normal spells this would work but for making a new channeling spell a couple of problems might arise. What if the channeler of the new spell was hit by storm bolt?Or Sleep? Or was perhaps killed? I know you could probably make a whole new trigger to detect if any of these events happen but I think it might be kind of hard sometimes. |
| 06-02-2003, 12:11 AM | #9 |
Thnx for putting this up. We do have a good use for this info. Nothing to do with spells tho. We are working on a 4 team AoS stlye map with 12 player slots. That leaves no room for computer controlled player slots. We had to give the regular units to the players and forbid control. This was only semi effective. When a unit was selected we had a trigger deselect it. This didnt work fast enough tho and players could still issue a command if quick enough. We tried to reissue a order if a unit was given a order but that caused the game to crash with a memory useage error. Think we ended up getting stuck in a endless command loop. If this works as you say it should solve our problem. Thnx again. |
