• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

A diffrent Training

Status
Not open for further replies.
Level 10
Joined
Apr 22, 2010
Messages
422
Hiya, Do you remeber the map "Bomber Command" made by blizzard?
Well even if you dont, there is a building ingame that automaticly builds units to bomb a target area.

I want that same thing where the building will "Channel" a ability that will spawn footmen every 5 seconds in a specific area and send it to attack the enemy base.
The trigger must work with multiplayer mode, so yea........

Please help!
 
Level 8
Joined
Aug 21, 2009
Messages
333
Very simple.
Just create a trigger for this:

Event:
Periodic - every 5 seconds

Actions:
Create X footman at point Y for player Z
Unit Group - Order last created units to move-to/attack point

If this needs more explanation, plz ask.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
If this is only supposed to happen when a certain building is built, then you would have to create another periodic trigger that searches if the building is built. if it is, then turn on above trigger.

Then, if it's destroyed, to turn off the above trigger, as well. Otherwise it will constantly happen regardless of the building being there or not.
 
Level 10
Joined
Apr 22, 2010
Messages
422
@Baintastic, no, thats not how its supposed to work, look ill describe the sequence:
1- Player clicks channeling ability "Train Footman"
2-As long as its being chenneled, then every 5 second the spell is channeled, footmen are trained.

The probelm with baintastic's is that it wont work for multiple people and for multiple units(since there are more then one building)

@defskull- This is a small side-project of mine, it is a combo of Tower defense and Bomber Command, with many new features like Global spells, Upgradeable income, and much more.It will also include a simple A.I. to aid unbalenced teams.
 
then you need to index the channel ability, for example if the spell lasts 100 seconds, you need to create an integer variable...everytime you cast the spell set index=0 then it will run in another trigger...

trigger 1 = the spell wil run here, set index = 0

trigger 2 = set index = index+1

trigger 3 = here you set the spaws, and check if the index is less than 100 then this trigger will run, otherewise it will not

if you want it MUI, you will need hashtables & indexing systems for that though
 
Level 8
Joined
Aug 21, 2009
Messages
333
gotcha.

variables:
Unit Group - Training_Group
Point - temp_loc
Point Array - Attack_Point[index is the player number]


  • Trigger 1
    • Events
      • Unit - A unit Starts channeling an ability
    • Conditions
      • (Ability being cast) Equal to ABILITY_GOES_HERE
    • Actions
      • Unit Group - Add (Casting Unit) to Training_Group
  • Trigger 2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to ABILITY_GOES_HERE
    • Actions
      • Unit Group - Remove (Casting Unit) from Training_Group
  • Trigger 3
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Training_Group and do (Actions)
        • Loop - Actions
          • Set temp_loc = (Position of (Picked unit))
          • Unit - Create 6 Footman for (Owner of (Picked unit)) at temp_loc facing 0.00 degrees
          • Unit Group - Order (Last created unit group) to Attack-Move To Attack_Point[(Player number of (Picked unit))]
          • Custom script: call RemoveLocation(udg_temp_loc)
Try that.

EDIT: THIS IS MUI. also, you'll just have to set the follow through time of the channel to determine how long units will be spawning for.
 
Level 10
Joined
Apr 22, 2010
Messages
422
it not like that!
This is more of a auto-cast spell.Its just as long as your channeling, units spawn, when you stop channeling, they stop spawning!
not you order it to spawn, then it spawns after a duration, if it was like that, i would just use the normal training

EDIT-Nevermind- i get the triggers now, it works.......+rep
 
Status
Not open for further replies.
Top