# SpellRocket Launcher

A snippet from a spell that I made:
Code:
``````-------- ACTIVATED BY DESTRUCTIBLES --------
Destructible - Pick every destructible within 64.00 of Point2 and do (Set Integer = (Integer + 1))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer Greater than or equal to 1
Then - Actions
Sound - Play CannonTowerMissile2 <gen> at 100.00% volume, located at Point2 with Z offset 0.00
Special Effect - Create a special effect at Point2 using Abilities\Spells\Other\Doom\DoomDeath.mdl
Special Effect - Destroy (Last created special effect)
Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 250.00 at Point2, dealing 500.00 damage of attack type Spells and damage type Normal
Unit Group - Remove (Picked unit) from Group_Rockets
Unit - Remove (Picked unit) from the game
Else - Actions

Set Integer = 0``````

Actually, you no need to set the Integer. Just pick every destructible. Once destructible is picked, and if there is destructible, then the picked unit (missile dummy) will get removed. Else, nothing will happen. And to kill or 'hurt' destructible, just set their life to a lower value (it will be killed when life drops to 0 or below) or just kill it.

I'm saying this because I'm making a map with similar ability to this Rocket Launcher . Just coincidental.

Edit: Also make sure to check whether the destructible is alive.

Can't find the condition for if there is a destructeble in the picked destructeble group. =/ Do you know the name of the condition?

No need the condition. In the 'Movement' trigger, just immediately create a new line and pick every destructible within your rocket dummy.

Code:
``````Destructible - Pick every destructible within 125.00 of (Position of YourDummy) and do actions
Loop - Actions
If then else
Condition
Picked destructible is alive Equal to True
Then
Destructible - Set life of (Picked destructible) to (Life of (Picked destructible) - 50)
Unit - Remove YourDummy from the game``````

Roughly like the above. It will hit a destructible then get removed from the game and reduce the life of the destructible. You can add SFX if you want to but that's up to you to code. If there is no destructible, then nothing will happen. The dummy won't get removed and will move as usual.

well what you can do is for every destrucable add one to an integer variable, then check if that integer is greater then or equal to 1

after all that set that integer back to 0

Thanks Vipur, I will try that, if it works +rep :thup:

well what you can do is for every destrucable add one to an integer variable, then check if that integer is greater then or equal to 1

after all that set that integer back to 0
Your the third or fourth suggesting that, however I don't think you can't do the action "for every destructble"... Will look around once again though.

Edit: Vipur thanks, it worked^^ However is there a way to prevent to do these actions twice? Also the action sometimes buggs the rocket so that every now and then when you shoot it doesn't trigger, meaning that the rocket is stuck at where you shot it... Anyone knows why? It works without that action..
Code:
``````Rocket movement
Events
Time - RocketLauncherTimer expires
Conditions
Actions
For each (Integer RocketLauncherInteger) from 1 to RocketLauncherCounter, do (Actions)
Loop - Actions
Set RocketLauncherRocketPoint = (Position of RocketLauncherRocket[RocketLauncherInteger])
Set RocketLauncherRocketMoveTo = (RocketLauncherRocketPoint offset by 35.00 towards RocketLauncherDirection[RocketLauncherInteger] degrees)
Unit - Move RocketLauncherRocket[RocketLauncherInteger] instantly to RocketLauncherRocketMoveTo
Custom script:   call RemoveLocation(udg_RocketLauncherRocketMoveTo)
Set RocketLauncherRocketMoveTo = (RocketLauncherRocketPoint offset by 100.00 towards RocketLauncherDirection[RocketLauncherInteger] degrees)
Set RocketLauncherRocketPoint2 = (Position of RocketLauncherRocket[RocketLauncherInteger])
Set RocketLauncherGroup2 = (Units within 200.00 of RocketLauncherRocketPoint matching ((((Matching unit) belongs to an enemy of (Owner of RocketLauncherRocket[RocketLauncherInteger])) Equal to True) and (((Matching unit) is alive) Equal to True)))
Destructible - Pick every destructible within 200.00 of RocketLauncherRocketPoint and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked destructible) is alive) Equal to True
Then - Actions
Trigger - Run Rocket Triggering <gen> (ignoring conditions)
Set RocketLauncherRocket[RocketLauncherInteger] = RocketLauncherRocket[RocketLauncherCounter]
Set RocketLauncherDirection[RocketLauncherInteger] = RocketLauncherDirection[RocketLauncherCounter]
Set RocketLauncherBoolean[RocketLauncherInteger] = RocketLauncherBoolean[RocketLauncherCounter]
Set RocketLauncherCounter = (RocketLauncherCounter - 1)
Set RocketLauncherInteger = (RocketLauncherInteger - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Number of units in RocketLauncherGroup2) Greater than or equal to 1
(Terrain pathing at RocketLauncherRocketMoveTo of type Walkability is off) Equal to True
(Distance between RocketLauncherRocketPoint2 and RocketLauncherRocketPoint) Less than or equal to 10.00
Then - Actions
Trigger - Run Rocket Triggering <gen> (ignoring conditions)
Set RocketLauncherRocket[RocketLauncherInteger] = RocketLauncherRocket[RocketLauncherCounter]
Set RocketLauncherDirection[RocketLauncherInteger] = RocketLauncherDirection[RocketLauncherCounter]
Set RocketLauncherBoolean[RocketLauncherInteger] = RocketLauncherBoolean[RocketLauncherCounter]
Set RocketLauncherCounter = (RocketLauncherCounter - 1)
Set RocketLauncherInteger = (RocketLauncherInteger - 1)
Else - Actions
Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint)
Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint2)
Custom script:   call RemoveLocation(udg_RocketLauncherRocketMoveTo)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RocketLauncherCounter Equal to 0
Then - Actions
Countdown Timer - Pause RocketLauncherTimer
Else - Actions``````

Just use the code I gave you? That only runs once.

You can actually use the trigger Adam gave as well. At first I thought using the Integer check was harder than my idea I posted. But, somehow you made it more complicated . Lol... I'm quite confused with what you are doing. Not familiar with your style of triggering. So I can't give much further comment.

In fact my way should be simpler. But not sure why the bolded lines are used (haven't read through all the code):
Code:
``````                Destructible - Pick every destructible within 200.00 of RocketLauncherRocketPoint and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked destructible) is alive) Equal to True
Then - Actions
Trigger - Run Rocket Triggering <gen> (ignoring conditions)
[B]Set RocketLauncherRocket[RocketLauncherInteger] = RocketLauncherRocket[RocketLauncherCounter]
Set RocketLauncherDirection[RocketLauncherInteger] = RocketLauncherDirection[RocketLauncherCounter]
Set RocketLauncherBoolean[RocketLauncherInteger] = RocketLauncherBoolean[RocketLauncherCounter]
Set RocketLauncherCounter = (RocketLauncherCounter - 1)
Set RocketLauncherInteger = (RocketLauncherInteger - 1)[/B]``````

Edit:
What about trying this? It's something like Adam's method except that it doesn't use integer, it uses boolean.
Code:
``````                Destructible - Pick every destructible within 200.00 of RocketLauncherRocketPoint and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked destructible) is alive) Equal to True
Then - Actions
[B]Set NEW_BOOLEAN_VAR = True[/B]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Number of units in RocketLauncherGroup2) Greater than or equal to 1
(Terrain pathing at RocketLauncherRocketMoveTo of type Walkability is off) Equal to True
(Distance between RocketLauncherRocketPoint2 and RocketLauncherRocketPoint) Less than or equal to 10.00
[B]NEW_BOOLEAN_VAR Equal to True[/B]
Then - Actions
Trigger - Run Rocket Triggering <gen> (ignoring conditions)
Set RocketLauncherRocket[RocketLauncherInteger] = RocketLauncherRocket[RocketLauncherCounter]
Set RocketLauncherDirection[RocketLauncherInteger] = RocketLauncherDirection[RocketLauncherCounter]
Set RocketLauncherBoolean[RocketLauncherInteger] = RocketLauncherBoolean[RocketLauncherCounter]
Set RocketLauncherCounter = (RocketLauncherCounter - 1)
Set RocketLauncherInteger = (RocketLauncherInteger - 1)
[B]Set NEW_BOOLEAN_VAR = False[/B]``````

Think that one condition can solve it all^^ Thanks for help, edited map and +rep:thup:

I update the thread for 2 reasons:
1: If you don't update your resource it's going to the graveyard.
2: I want a moderator to look through, test and approve it.

What do you mean

if you don't update it, it's going to graveyard

where all of the old threads are posted there?

if you don't update it, it's going to graveyard

If a submitted resource isn't suitable for approval, and hasn't been updated to meet approval conditions, it is sent to the graveyard until it has been updated, at that point, it may be approved if it meets the conditions.

where all of the old threads are posted there?

They are either (1) approved (i.e. in one of the subforms, such as Spells, Systems, Tutorials), (2) graveyarded (for the reasons I mentioned above) or (3) still in the Tutorials and Resources sub-forum, either pending approval/moderator to take a look, or just have been forgotten/overlooked

Oh.
Well i just made a tutorial

I DONT WANNA IT TO BE SENT TO GRAVEYARD

Alright.

Well, the rocket launcher's still awesome.

bump

You know

you don't need to bump all at a time...
Everyone, including me know that ability..

It is wise to be patient as right now it seems as though the moderators for the warcraft/spells forums have many different threads/spell/systems etc too look over, so that by itself is time consuming. Plus those moderates have lives too .

I am, ain't I? I'm just keeping it updated, still even though it's not approved yet people can still use it in their maps since it's fully working mui.

Working and approved.

Moved to the appropriate section.

Good job!

N.B Cleaned your post of bumps.

General chit-chat
Help Users
• No one is chatting at the moment.
• Varine:
I would be there for days, even with my camera set up slides can take a long time, and if they want perfect captures I really need to use my scanners that are professionally made for that. My camera rig works well for what it is, but for enlargements and things it's not as good.
• Varine:
I've only had a couple clients with that so far, though. I don't have a website or anything yet though.
• Varine:
Console repair can be worthwhile, but it's also not a thing I can do at scale in my house. I just don't have room for the equipment. I need an office that I can segregate out for archival and then electronic restoration.
• Varine:
But in order for that to be real, I need more time, and for more time I need to work less, and to work less I need a different job, and for a different job I need more money to fall back on so that I can make enough to just pay like, rent and utilities and use my savings to find these projects
+1
• Varine:
Another couple years. I just need to take it slow and it'll get there.
• jonas:
any chance to get that stolen money back?
• jonas:
Maybe you can do console repair just as a side thing, especially if there's so much competition business might be slow. Or do you need a lot of special equipment for that?
• jonas:
I recently bought a used sauna and the preowner told me some component is broken, I took a look and it was just a burnt fuse, really cheap to fix. I was real proud of my self since I usually have two left hands for this kinda stuff
• tom_mai78101:
I am still playing Shapez 2. What an awful thing to happen, Varine, and hopefully everything has been sorted out soon. Always use multi-factor authentication whenever you have the opportunity to do so.
+1
• Varine:
I think all of the money is accounted for now, and all the cards have been changed out, so I think for the most part it's taken care of now. Just need to go through and make sure all of my accounts are secured again, it's just time consuming.
• Varine:
And yeah everything has 2 factor turned on now, or at least everything I can think of at the moment.
• Varine:
The consoles don't need too much equipment that I don't already have. I would like to get a reflow oven, but I don't really want to buy one so I'm thinking about modifying a toaster oven I have to make something that will work for what I'm doing.
• Varine:
I have the soldering irons and reflow and all that, but without an oven it's kind of hard to build mod chips and things like that. I made a handful of them with a hot air station, but it's a pain.
• Varine:
The only thing I'm not really set up for is BGA rework. I've done it before a little bit, but not reliably, and that equipment is wildly expensive. You need X-rays and shit.
• Varine:
I also have a couple 3D printers. I'm not super good with those and need to get an enclosure built, but they'll be useful for some aesthetic mods I've been thinking about. At least I can use them to do designs and then just have someone else print out the parts for me once I know they work.
• Varine:
I also use them to make adapters for all my camera shit, but that's also an on the side thing for now. Lens adapters get really expensive.
• Varine:
I've been trying to do some little art pieces as well, but I'm not much an engineer so they haven't gone great. I got some new things showing up to try and play with
• Varine:
I want to build this tesserect kind of thing with mirrors, and I've been trying to make this like black hole diorama. In my head it looks really cool, but I kind of thought I could form polarizing lenses into a sphere but I tend to just destroy them every time I try.
• Varine:
So I got a new idea, but I'm not sure how to make it work like I want without being able to get a polarizer curved. I think they are made out of PVA typically, and I thought I could just heat it up a little bit to soften the film, but that clearly isn't working. So I'm going to try a few other things, I'm thinking if I put a mirror film over the polarizing film I might get something cool. I have some polarized LED's as well, and I think if I make a central light source I can use the mirrors combined with the polarizers to make that central light APPEAR black. I have next week off so I'm going to spend some time trying to figure it out
• Varine:
The tesserect works, at least. I just need to figure out how to be able to assemble it, but I think I have a pretty good idea of how to go about it. Or at least a prototype of it. I'll post some pictures next week
• jonas:
That last bit sounds like the last entry in a scientist's journal in a destroyed research facility in a post-apocalyptic video game
• Varine:
lol it's not that exciting
• Varine:
Shiny tho
• Varine:
Basically it's a cube with a two way mirror on the inside, and then a smaller cube suspended in that with a mirrors on the outside of it. Kind of like those infinity pictures where they use two mirrors to go forever. Only it's twelve mirrors
• Varine:
And the tiniest LED strip I could find