Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Air Unit attack instantly upon creation
Air Unit attack instantly upon creation
May 29 2009, 5:18 am
By: Cinolt  

May 29 2009, 5:18 am Cinolt Post #1



Again, didn't know what to search. After an air unit, in my case a wraith, is created, I want it to attack instantly, like in Spellsword or WAF. I tried ordering it to patrol it to its same location, same with attack, but it doesn't attack as fast as I would want it. I thought of centering a location corresponding to the wraith's attack range, and center another location on an enemy unit on the range, and order it to attack.. but hopefully that's not the solution. Suggestions?



None.

May 29 2009, 5:49 am Echo Post #2



Don't create it. Move it from another location. What I did for my map is create it for computers. When the player casts it, move it to the location and give it to the player.



None.

May 29 2009, 6:30 am Madroc Post #3



If you order it to patrol to its own location, for some reason it doesn't do anything. Try making it patrol to, well, anywhere.



None.

May 29 2009, 6:31 am Echo Post #4



Quote from Madroc
If you order it to patrol to its own location, for some reason it doesn't do anything. Try making it patrol to, well, anywhere.
That doesn't work at all. When you create a unit, there is a delayed reaction and it has to actually turn before it hits. A huge example of this is the siege tank (sieged mode). When you create it, it has to take its time to actually siege and then attack.



None.

May 29 2009, 11:22 am Vi3t-X Post #5



You could either create the Wraith and center.
Or you could use Echo's Method.

The only reason why the wraith doesn't 'instantly' attack is probably because it has to spin.



None.

May 29 2009, 3:56 pm Madroc Post #6



Quote from name:Bill Clinton
Quote from Madroc
If you order it to patrol to its own location, for some reason it doesn't do anything. Try making it patrol to, well, anywhere.
That doesn't work at all. When you create a unit, there is a delayed reaction and it has to actually turn before it hits. A huge example of this is the siege tank (sieged mode). When you create it, it has to take its time to actually siege and then attack.
I must not understand or both of you are dead wrong. I made a test map just now because i remember testing this in the past.

I have it so that when you create a marine, a wraith is created for player 2 at location 1 (right next to an enemy building) and ordered to patrol to anywhere and a wraith is created for player 2 at location 2 (in a remote place in the map), moved to location 0 (close to location 1), and ordered to patrol to anywhere. They both have to spin and both begin attacking at the exact same time. I tried making the same test map where I ordered them to patrol to their own location, and they just stop, not doing anything at all forever.

What am I missing? How do you bypass the spin? Your explanation didn't work in the test map.

Oh and I can't think of a single air unit that has a similar creation animation as the siege tank.




None.

May 29 2009, 4:55 pm scwizard Post #7



In spellsword the wraiths for fireburst are created and not moved.

Code
Trigger("          Spellswords"){
Conditions:
    Bring("Current Player", "Protoss Probe", "002", At least, 1);
    Deaths("Current Player", "Mineral Chunk (Type 2)", Exactly, 0);

Actions:
    Display Text Message(Always Display, "\x004+\x002You cast \x006'\x003'\x002\x004F\x002ireburst.");
    Move Location("Current Player", "Zeratul (Dark Templar)", "Anywhere", "016");
    Create Unit with Properties("Player 7", "Zerg Overlord", 1, "016", 2);
    Kill Unit("Player 7", "Zerg Overlord");
    Set Deaths("Current Player", "Mineral Chunk (Type 2)", Set To, 10);
    Play WAV("Spell2.wav", 0);
    Preserve Trigger();
}

Trigger("          Spellswords"){
Conditions:
    Bring("Current Player", "Protoss Probe", "002", At least, 1);
    Deaths("Current Player", "Mineral Chunk (Type 2)", Exactly, 8);

Actions:
    Move Location("Current Player", "Zeratul (Dark Templar)", "Anywhere", "016");
    Remove Unit("Current Player", "Tom Kazansky (Wraith)");
    Create Unit with Properties("Current Player", "Tom Kazansky (Wraith)", 1, "016", 4);
    Order("Current Player", "Tom Kazansky (Wraith)", "Anywhere", "017", attack);
    Preserve Trigger();
}


I'm not sure where this "17" location they're being told to attack to is. I'll find out in a bit.



None.

May 29 2009, 7:26 pm Cinolt Post #8



Thanks for your replies. I made a test map of my own, and found out that creating it than ordering it to attack to the middle of the map gives a fast attack speed, leaving it out for three death counters. With patrol, three death counters sometimes isn't enough time for it to attack. Also, in the rare chance that the hero is in the exact middle of the map, I made it so the middle of the map is unwalkable.

Attachments:
spelltest.scx
Hits: 1 Size: 53.07kb



None.

May 29 2009, 8:57 pm Falkoner Post #9



Ah! I'm surprised, I would have thought Attack wouldn't work at all, also, I tested the difference between Patrolling to the location that you want it to attack vs. patrolling to Anywhere and I didn't see any difference in speed.

Glad you found the solution :)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
Please log in to shout.


Members Online: NudeRaider, Roy