| 05-11-2004, 11:25 PM | #1 |
Ok, this is my problem, I want my spell to be: unit casts chain lightning, appears at each struck target and ends up where the lightning finishes, supposed to be the hero moving really fast and hitting things, if you get what I mean. I've realised that the only way to do this is dummy casters casting spells, and I had what I thought would be a working method (it is posted following) but all that happens is the hero teleports to the first attackm but nothing else happens, any ideas? I apologise if the triggers are not fantastic, I'm, as always, pulling this clean out of my ass, not knowing really that much to do with triggers, but this is the best way to learn, right? anyway, here they are, with a description of the variables, spell names etc. This is the initial trigger: Lightning strike is the initial spell, the one the hero has. Spellcaster_ash_p10 is the hero that casts it: ashastis there are multiple versions of this variable because more than one person can have the same hero. lightningpoint is a point variable caster_creator is a variable that determines the level of the spells in the second trigger, since this has 3 levels random casterstylee unitdude is me being really bored and irritated so I decided to give the dummy caster a silly name Lightning stike (caster1) is level 1 of the spell caster-version, I've only done for level 1, but it's simple enough to copy and paste triggers once it works for one level. lightning strike P10 Events Unit - A unit Starts the effect of an ability Conditions (Ability being cast) Equal to Lightning Strike Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Owner of (Triggering unit)) Equal to Player 10 (Light Blue) Then - Actions Wait ((Distance between (Position of (Triggering unit)) and (Position of (Casting unit))) / 3500.00) seconds Set Spellcaster_ash_P10 = (Triggering unit) Set Lightningpoint = (Position of (Target unit of ability being cast)) Set Spell_level_variable_P10 = ((Level of Lightning Strike for (Triggering unit)) x 4) Set caster_creator = ((Level of Lightning Strike for (Triggering unit)) x 1) Unit - Move Spellcaster_ash_P10 instantly to Lightningpoint Animation - Play (Triggering unit)'s attack animation Set Spell_level_variable_P10 = (Spell_level_variable_P10 - 1) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions caster_creator Equal to 1 Then - Actions Unit - Create 1 Random casterstylee unitdude (1) for (Owner of Spellcaster_ash_P10) at (Position of (Target unit of ability being cast)) facing (Position of (Triggering unit)) Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Random unit from (Units within 1000.00 of (Position of (Last created unit)))) Else - Actions Else - Actions Do nothing This is the trigger activated when the caster unit casts his version of lightning strike (i.e. lightning strike (caster1)) P10 trigger continuous Events Unit - A unit Starts the effect of an ability Conditions (Ability being cast) Equal to Lightning Strike (caster1) (Owner of (Triggering unit)) Equal to Player 10 (Light Blue) Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Spell_level_variable_P10 Greater than 0 Then - Actions Set Spell_level_variable_P10 = (Spell_level_variable_P10 - 1) Set Lightningpoint = (Position of (Target unit of issued order)) Unit - Move Spellcaster_ash_P10 instantly to Lightningpoint Animation - Play Spellcaster_ash_P10's attack animation If (caster_creator Equal to 1) then do (Unit - Create 1 Random casterstylee unitdude (1) for (Owner of Spellcaster_ash_P10) at (Center of (Playable map area)) facing Default building facing degrees) else do (Do nothing) Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Random unit from (Units within 1000.00 of (Position of (Last created unit)))) Else - Actions Do nothing A little long, very irritating, I've tried for 2/3 days to get this to work, and it doesn't, I really thought I had it here, *sigh* anybody have any suggestions or ideas, aside from "give the hell up" which is my favoured one right now. |
| 05-11-2004, 11:32 PM | #2 |
If you get tired of trying in that way, try having a look at my Ice Slash skill in http://www.wc3sear.ch/?p=Spells&ID=104 , it mostly does the same as you point here, and you should be able to change the effects through the object editor to make them use lightning instead of frost |
| 05-12-2004, 02:02 AM | #3 |
Well, I believe it is casting unit, not triggering unit Set caster_creator = ((Level of Lightning Strike for (Triggering unit)) x 1) x1 is completely useless, as nothing is changed. Set Lightningpoint = (Position of (Target unit of ability being cast)) Unit - Create 1 Random casterstylee unitdude (1) for (Owner of Spellcaster_ash_P10) at (Position of (Target unit of ability being cast)) facing (Position of (Triggering unit)) Why not use the variable? Anyway If (caster_creator Equal to 1) then do (Unit - Create 1 Random casterstylee unitdude (1) for (Owner of Spellcaster_ash_P10) at (Center of (Playable map area)) facing Default building facing degrees) else do (Do nothing) It only works if that variable is 1, and you subtract that variable by 1 every time. It will only be 1 once. Furthermore, in order to prevent the same unit from being targetted twice, you'll add all units within 1000 range to a unit group, pick a random unit and put it into a unit-variable, use that unit-variable to cast the spell upon, and then use that unit-variable to remove the unit from the unit-group. |
| 05-12-2004, 07:34 AM | #4 | ||||
Quote:
Quote:
No idea, I think that was a hang-over from when I tried to do it all in one trigger. Anyway Quote:
I subtract 1 from Spell level variable, at least I should, I'll double-check that Quote:
|
| 05-12-2004, 11:00 PM | #5 |
Triggering unit always work for every event though, the thing that changing it to casting unit would fix the issue is a great mith |
| 05-13-2004, 06:55 PM | #6 | |
Quote:
No... not every one, I recall a few that would not work with triggering unit... I'll have to reproduce it later. |
| 05-14-2004, 07:28 AM | #7 |
Well, it still doesn't work, *sigh* I'm thinking of giving up and changing the skill lol, it just does the inital cast, and then doesn't cast anything else, it's just one lightning bolt, and ashastis teleports there - is there something I'm missing -I set the caster1 style bolt to 0 mana, is there a specific unit I need to base the dummy off? I know they exist because they are created, but they are just NOT CASTING ANYTHING. *sigh again* |
| 05-14-2004, 03:37 PM | #8 |
If (caster_creator Equal to 1) then do (Unit - Create 1 Random casterstylee unitdude (1) for (Owner of Spellcaster_ash_P10) at (Center of (Playable map area)) facing Default building facing degrees) else do (Do nothing) I think the problem is the position the caster unit is created. I have made a map with a system to make a chain spell and you are able to know wich target was hit. It can be found on my site. (check sig) I hope you will be able to fix your spell with this map. |
| 05-15-2004, 09:10 AM | #9 |
I already noticed that one lol, it still doesn't work *sigh*I'll just give up doing it myself, which is really annoying - everything else I've done has been, in the words of the perishers "all mi own work" so failing at something, even when, granted, I know next to nothing, is really annoying. oh well, I'll have a look at vexorian's and yours, cheers you two (and flame, obviously). |
| 05-15-2004, 11:59 AM | #10 |
It Works! *does a little dance* everything works, thank you kamux, you're a star I'd hug you if I could. Your chain lightning system is exactly what I had in my head, almost the xact words, I just didn't know where any of the triggers were lol. Thanks all of you, very very helpful. |
| 05-16-2004, 01:04 PM | #11 |
ok, it doesn't really work, it seems to use the position of dead units as well, or possibly my caster units, which it shouldn't since a) they're my units, b) they have generic expiration triggers c) just in case that doesn't work I gave them -90 life regen a second and 120 life. In my chain testing map it does the requisite number of jumps and bounces, but seems to bounce to non-sensical points, in the real map, where I've had to modify the trigger slightly because there are 3 people who can use the same hero - just 3 sets of variables and 3 sets of triggers with if player = 10. It only seems to do one or two jumps. Maybe this is because the hero attacks and interrupts it? I'm not at all sure. Finally, Kamux, I get everything in your chain lightning trigger except the following: Set Units[3] = (Random unit from (Units within 500.00 of (Position of Units[2]) matching ((((Matching unit) belongs to an enemy of (Owner of Units[1])) Equal to True) and (((Matching unit) Not equal to Units[2]) and (True Equal to True))))) what is the purpose of this part of the condition? Sorry I'm being a pain in the ass, I'm tempted to give up, use a normal chain lightning, make the hero transparent and teleport her around randomly lol. |
| 05-18-2004, 09:20 AM | #12 |
I put in that part so that you can easily add one or more conditions without having to make a new action or to copy all my data because that is lost if you change the condition into an 'and' function. |
| 05-18-2004, 09:58 AM | #13 |
Ah, ok, do you have any idea why if I put in the move trigger it jumps around oddly - I can post my test map if you want to have a look at it, I gave the caster unit a model so that I could see if they were being selected, they weren't. it's somewhat irritiating, maybe it's selecting the dead bodies or something. |
| 05-18-2004, 12:20 PM | #14 |
Ok, e-mail or post the tesmap. I will take a look at it. |
| 05-19-2004, 03:24 AM | #15 |
Thank you so very much, sorry I'm being a pain, I know you have better things to do, I just can't figure this out. Just cast the lightning until the units start to die, and you'll see what I mean. |
