| 04-21-2004, 04:52 AM | #1 |
Ok, I want to know how to make a trigger where it tells (UNIT X) to attack ground a random place in region X, then where it told him to attack it creates a special effect there, then repeats the trigger (with a new random spot in region)... can you help me? |
| 04-21-2004, 07:50 AM | #2 |
Code:
AttackPointWithSFX
Events
Conditions
Actions
Set TempPointVariable = (Random point in MyRegion <gen>)
Unit - Order UnitVariableX to Attack-Move To TempPointVariable
Special Effect - Create a special effect at TempPointVariable using Abilities\Spells\Orc\Bloodlust\BloodlustTarget.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation( udg_TempPointVariable )This does the attack and the special effect part. I'm not sure how you want it repeated, after a set amount of time or... you can do that with another trigger that then runs this trigger. The last two lines in this triggerare there to clean up memory leaks, however, the "destroy last created special effect" will work only with models that have a "birth" animation: others will dissapear the instant they are made, so if you want to use a different effect, you will have to remove the effect-destruction line and allow the trigger to leak or make a more difficult way of removing the effects with effect-variables. And some mod move this to the Trigger haven, please. |
| 04-21-2004, 03:29 PM | #3 |
TempPointVariable is a Point variable, and MyRegion is the region you created, just to cover the basics :)) and i would personaly move the Custom script up by one (before Destroy SE), pun in a wait interval od 1-2 secs and then destroy the SE, and add a line "Trigger - Run <this trigger>" that lets you preview the SE you selected (anyone), wait a bit, destroy the effect and start the trigger again.... the wait interval is kinda a failsafe to an neverending loop that might crash your computer or game (it happened to me once, the trigger was run so many times it couldn't "catch up", so it started lagging and crashed the game before i knew what was going on).... and if you want the Attack Ground, the unit you are ordering that must have an Artillery Attack/Weapon Type.... |
| 04-21-2004, 11:16 PM | #4 | |
Quote:
TY for your help :). |
| 04-22-2004, 12:24 AM | #5 |
Er... Just do this... For each (Integer A) from 1 to [your number], do (Actions) Loop - Actions Set Temp_Point = (Random point in ([your region])) Unit - Order (Last created unit) to Attack Ground Temp_Point Special Effect - Create a special effect at Temp_Point using [your SFX] Wait 1.50 seconds Special Effect - Destroy (Last created special effect) Have none of you heard of Loops... Who needs JASS when it's not needed? |
