• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to make a unit spawn from meteor every x mins of the game?

Status
Not open for further replies.
Level 9
Joined
Jul 30, 2018
Messages
445
Just make a periodic trigger that triggers every 600 seconds (or a repeating timer that expires in 600 seconds). Then make a special effect on the unit and use the Unit - Create Unit function. Alternatively you can make a dummy unit cast Inferno on the unit or something. It's not really that hard: just play around with the Editor!
 
Level 7
Joined
May 14, 2019
Messages
255
Ye a reoccurring periodic event that fires every 60000 seconds and causes a dummy unit to cast inferno at some point in the map should do it. You can also make it cast rain of chaos to spawn multiple units in an area.
 
Level 6
Joined
Aug 31, 2018
Messages
157
Just make a periodic trigger that triggers every 600 seconds (or a repeating timer that expires in 600 seconds). Then make a special effect on the unit and use the Unit - Create Unit function. Alternatively you can make a dummy unit cast Inferno on the unit or something. It's not really that hard: just play around with the Editor!
Yes, but the problem is that i don't know how to make the trigger... Also i never used Dummies before.
 
Level 9
Joined
Jul 30, 2018
Messages
445
Read these: Basics of Triggers and Variables

Then make a variable of type Unit named something like PlayerHero, or whatever. The name doesn't really matter, just use something that you know what it's meant for. You also need a second variable of type Point. Name it something like ImpactPoint.

Then you actually store your unit to the variable. It really depends on how your hero is created, but if it is already placed in the World Editor you can go to your Map Initialization trigger and put an action General - Set Variable. Then choose the variable you made and then select the unit you placed on the world.

Then try to make a trigger with an event: Time - Periodic Event (and put in the 600 seconds). Now you have to set the ImpactPoint variable. So use the Set Variable action again to set ImpactPoint = (Position of PlayerHero). This will store the position of the unit to the variable. Next add another action: Special Effect - Create Special Effect At Point. Put the ImpactPoint as the position of the special effect. Lastly, add the desired special effect, like Inferno from abilities category.

Now, if you are making it this way, without a dummy, you might want to wait before you create the unit. So put on General - Wait and choose the time it takes for the fireball of the Inferno to land.

Then use Unit - Create Units Facing Angle action and choose whatever you want, and put ImpactPoint as the location where the unit is created.

Now you have to put a custom script to remove the leak. You don't have to understand it fully, but basically it's just removing data you don't need or even can't use later, like the point stored into the ImpactPoint variable here. I think it's a good practice to start learning to remove the leaks right from the beginning so it becomes a habit faster and not something you'd have to learn later.

Anyway, now for the last line, put an action General - Custom Script and fill in call RemoveLocation(udg_ImpactPoint).
 
Level 6
Joined
Aug 31, 2018
Messages
157
Read these: Basics of Triggers and Variables

Then make a variable of type Unit named something like PlayerHero, or whatever. The name doesn't really matter, just use something that you know what it's meant for. You also need a second variable of type Point. Name it something like ImpactPoint.

Then you actually store your unit to the variable. It really depends on how your hero is created, but if it is already placed in the World Editor you can go to your Map Initialization trigger and put an action General - Set Variable. Then choose the variable you made and then select the unit you placed on the world.

Then try to make a trigger with an event: Time - Periodic Event (and put in the 600 seconds). Now you have to set the ImpactPoint variable. So use the Set Variable action again to set ImpactPoint = (Position of PlayerHero). This will store the position of the unit to the variable. Next add another action: Special Effect - Create Special Effect At Point. Put the ImpactPoint as the position of the special effect. Lastly, add the desired special effect, like Inferno from abilities category.

Now, if you are making it this way, without a dummy, you might want to wait before you create the unit. So put on General - Wait and choose the time it takes for the fireball of the Inferno to land.

Then use Unit - Create Units Facing Angle action and choose whatever you want, and put ImpactPoint as the location where the unit is created.

Now you have to put a custom script to remove the leak. You don't have to understand it fully, but basically it's just removing data you don't need or even can't use later, like the point stored into the ImpactPoint variable here. I think it's a good practice to start learning to remove the leaks right from the beginning so it becomes a habit faster and not something you'd have to learn later.

Anyway, now for the last line, put an action General - Custom Script and fill in call RemoveLocation(udg_ImpactPoint).
It would be easier just to show me the triggers, but thank you for the answer ^_^
 
Status
Not open for further replies.
Top