• 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.

Custom Projectiles System

CUSTOM PROJECTILES SYSTEM
Ver 1.2c

I. Features
This system allows you to create spell in a simpler way with these feathers:
o Simply create a straight projectile
o Create a projectile with vertical arc (normal missile) or horizontal arc (like
DotA's Wild Axe of Rexxar)
o Create a projectile toward a unit or location
o Can activate following trigger when hit (allow you to create attaching effect
(like stun, knock back,...).
II. Installation

**This system require UMSWE**
1. Import missiledummy.mdx with contained in this map to your map
2. Create a new dummy which uses the model above and have Harvest ability.
3. Copy triggers: CPS Loop, CPS Creating, CPS Init to your map.
4. In trigger CPS Init, Set CPS_Dummy = "Your missile dummy"
III. Variables' Functions

  • Projectile_AttackType: attack type of damage
  • Projectile_Damage: impact damage (real)
  • Projectile_DamageType: type of impact damage
  • Projectile_Impact: effect will be created at the impact
  • Projectile_Model: model of projectile
  • Projectile_Height: flying height of projectile
  • Projectile_Size: size (%) of projectile, this value decides both Length, Width, Height.
  • Projectile_Speed: flying range of projectile every 0.02 second
  • Projectile_Source: source unit of projectile
  • Projectile_TargetUnit: target unit of projectile
  • Projectile_TargetPoint: target point of projectile
  • Projectile_UnitOrPoint: this value decides target type of projectile
    + True: target type of projectile is unit.
    + False: target type of projectile is point. When it is false, you need to set the
    following variable:
    <> Projectile_AoE - decide projectile's area of effect.
    <> Projectile_DestroyTree - allow to destroy trees or not (true/false)
  • Projectile_Trigger: trigger will be activated at the projectile's impact
  • Projectile_HArc: true = projectile will move with horizontal arc, false = without arc.
    Once this value is true, there are variables you need to set:
    <> Projectile_HArcWidth: decide arc's width, it also depends on projectile's speed
    <> Projectile_HArcLeftOrRight: true = left, false = right
  • Projectile_VArc: true = projectile will move with vertical arc, false = without arc.
    Once this value is true, there is a variable you need to set:
    <> Projectile_VArcHeight: decide arc's height, it also depend on projectile's speed
IV. How to Use

1. You need 1 trigger to set all (or what neccesary) variables above, then run
CPS Creating by using:
  • Custom script: call TriggerExecute( gg_trg_CPS_Creating )
2. To use a following trigger:
a) You can use directly stored Projectile System's data through those variables:
  • SPSD_Caster
  • SPSD_TargetUnit
  • SPSD_TargetPoint (it's unnecessary to remove leak this variable, because the
    system will automatically do it)

b) In my onpinion, you should set those variables above into yours own because those
data will be removed/replaced in about a trigger loop.
  • Set ABC_Caster = SPSD_Caster
  • Set ABC_Target = SPSD_TargetUnit
  • Set ABC_Point = SPSD_TargetPoint
    (ABC is your spell's name)

3. See "Example Spells" - "Frost Arrow / Immolation Arrow Spell" if you need some
example about how to use following trigger.
V. Credit

@ redscores for the dummy model.
@ Magtheridon96, Almia for useful tips
@ GhostHunter123

System-Projectile5.jpg

System-Projectile2.jpg

System-Projectile1.jpg

System-Projectile4.jpg

System-Projectile3.jpg
  • CPS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set CPS_Off = True
        • Do Multiple ActionsFor each (Integer CPS_Loop) from 1 to CPS_MUI, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • CPS_Missile[CPS_Loop] Not equal to (!=) No unit
              • Then - Actions
                • Set CPS_Point[9] = (Position of CPS_Missile[CPS_Loop])
                • Set CPS_Point[10] = (Position of CPS_TargetUnit[CPS_Loop])
                • Set CPS_Point[11] = (CPS_SourcePoint[CPS_Loop] offset by CPS_TraveledDistance[CPS_Loop] towards (Angle from CPS_SourcePoint[CPS_Loop] to CPS_Point[10]) degrees)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between CPS_Point[10] and CPS_Point[11]) Greater than or equal to (>=) (CPS_Speed[CPS_Loop] + 10.00)
                    • Then - Actions
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                      • -------- MOVE PROJECTILE --------
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                      • Set CPS_Point[12] = (CPS_Point[11] offset by CPS_Speed[CPS_Loop] towards (Angle from CPS_Point[11] to CPS_Point[10]) degrees)
                      • Set CPS_ArcReal[0] = (Distance between CPS_SourcePoint[CPS_Loop] and CPS_Point[10])
                      • Set CPS_ArcReal[1] = (CPS_ArcReal[0] / 2.00)
                      • Set CPS_Point[13] = (CPS_SourcePoint[CPS_Loop] offset by CPS_ArcReal[1] towards (Angle from CPS_SourcePoint[CPS_Loop] to CPS_Point[10]) degrees)
                      • Set CPS_ArcReal[2] = (Distance between CPS_Point[12] and CPS_Point[13])
                      • Set CPS_TraveledDistance[CPS_Loop] = (CPS_TraveledDistance[CPS_Loop] + CPS_Speed[CPS_Loop])
                      • Unit - Move CPS_Missile[CPS_Loop] instantly to CPS_Point[12], facing CPS_Point[10]
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                      • -------- HORIZONTAL ARC PROJECTILE'S CREATING --------
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • CPS_HArc[CPS_Loop] Equal to (==) True
                          • Then - Actions
                            • Set CPS_ArcReal[3] = ((CPS_ArcReal[2] / CPS_ArcReal[1]) x CPS_HArcWidth[CPS_Loop])
                            • Set CPS_ArcReal[4] = (CPS_ArcReal[1] - CPS_ArcReal[2])
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Distance between CPS_Point[12] and CPS_Point[10]) Greater than or equal to (>=) CPS_ArcReal[1]
                                • Then - Actions
                                  • Set CPS_MissileDistance[CPS_Loop] = (CPS_MissileDistance[CPS_Loop] + CPS_ArcReal[3])
                                • Else - Actions
                                  • Set CPS_MissileDistance[CPS_Loop] = (CPS_MissileDistance[CPS_Loop] - CPS_ArcReal[3])
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CPS_HArcLeftRight[CPS_Loop] Equal to (==) True
                                • Then - Actions
                                  • Set CPS_Point[14] = (CPS_Point[12] offset by CPS_MissileDistance[CPS_Loop] towards ((Angle from CPS_Point[11] to CPS_Point[10]) + 90.00) degrees)
                                • Else - Actions
                                  • Set CPS_Point[14] = (CPS_Point[12] offset by CPS_MissileDistance[CPS_Loop] towards ((Angle from CPS_Point[11] to CPS_Point[10]) - 90.00) degrees)
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Distance between CPS_Point[12] and CPS_Point[10]) Greater than or equal to (>=) CPS_ArcReal[1]
                                • Then - Actions
                                  • Set CPS_ArcReal[5] = (Angle from CPS_Point[9] to CPS_Point[14])
                                • Else - Actions
                                  • Set CPS_ArcReal[5] = (Angle from CPS_Point[14] to CPS_Point[10])
                            • Unit - Move CPS_Missile[CPS_Loop] instantly to CPS_Point[14], facing CPS_ArcReal[5] degrees
                            • Custom script: call RemoveLocation(udg_CPS_Point[14])
                          • Else - Actions
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                      • -------- VERTICAL ARC PROJECTILE'S SETTING --------
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • CPS_VArc[CPS_Loop] Equal to (==) True
                          • Then - Actions
                            • Set CPS_ArcReal[3] = ((CPS_ArcReal[2] / CPS_ArcReal[1]) x CPS_VArcHeight[CPS_Loop])
                            • Set CPS_ArcReal[4] = (CPS_ArcReal[1] - CPS_ArcReal[2])
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Distance between CPS_Point[12] and CPS_Point[10]) Greater than or equal to (>=) CPS_ArcReal[1]
                                • Then - Actions
                                  • Set CPS_ArcReal[5] = ((Current flying height of CPS_Missile[CPS_Loop]) + CPS_ArcReal[3])
                                  • Set CPS_ArcReal[6] = (2.50 x (Atan((CPS_ArcReal[5] / CPS_ArcReal[4]))))
                                • Else - Actions
                                  • Set CPS_ArcReal[5] = ((Current flying height of CPS_Missile[CPS_Loop]) - CPS_ArcReal[3])
                                  • Set CPS_ArcReal[6] = (1.50 x (Atan((CPS_ArcReal[4] / CPS_ArcReal[5]))))
                            • Custom script: call SetUnitAnimationByIndex( udg_CPS_Missile[udg_CPS_Loop], R2I(udg_CPS_ArcReal[6]) )
                            • Animation - Change CPS_Missile[CPS_Loop] flying height to CPS_ArcReal[5] at 0.00
                          • Else - Actions
                      • Custom script: call RemoveLocation(udg_CPS_Point[12])
                      • Custom script: call RemoveLocation(udg_CPS_Point[13])
                    • Else - Actions
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                      • -------- CAUSE DAMAGE AND CREATE EFFECTS --------
                      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                      • Set SPSD_Caster = CPS_Source[CPS_Loop]
                      • Set SPSD_TargetUnit = CPS_TargetUnit[CPS_Loop]
                      • Set SPSD_TargetPoint = (Position of CPS_TargetUnit[CPS_Loop])
                      • Custom script: if udg_CPS_Trigger[udg_CPS_Loop] != null then
                      • Custom script: call TriggerExecute(udg_CPS_Trigger[udg_CPS_Loop])
                      • Custom script: endif
                      • Set CPS_Point[12] = (Position of CPS_TargetUnit[CPS_Loop])
                      • Special Effect - Create a special effect at CPS_Point[12] using CPS_Impact[CPS_Loop]
                      • Special Effect - Destroy (Last created special effect)
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • CPS_UnitOrPoint[CPS_Loop] Equal to (==) True
                          • Then - Actions
                            • Unit - Cause CPS_Source[CPS_Loop] to damage CPS_TargetUnit[CPS_Loop], dealing CPS_Damage[CPS_Loop] damage of attack type CPS_AttackType[CPS_Loop] and damage type CPS_DamageType[CPS_Loop]
                          • Else - Actions
                            • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                            • -------- DESTROY TREES --------
                            • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CPS_Destroy[CPS_Loop] Equal to (==) True
                                • Then - Actions
                                  • Destructible - Pick every destructible within CPS_AoE[CPS_Loop] of CPS_Point[12] and do (Actions)
                                    • Loop - Actions
                                      • Set CPS_Tree = (Picked destructible)
                                      • Set CPS_Point[8] = (Position of CPS_Tree)
                                      • Unit - Order CPS_Dummy to Harvest CPS_Tree
                                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                          • If - Conditions
                                            • (String((Current order of CPS_Dummy))) Equal to (==) harvest
                                          • Then - Actions
                                            • Destructible - Kill CPS_Tree
                                          • Else - Actions
                                      • Unit - Order CPS_Dummy to Stop
                                      • Custom script: call RemoveLocation(udg_CPS_Point[8])
                                • Else - Actions
                            • Custom script: set bj_wantDestroyGroup = true
                            • Unit Group - Pick every unit in (Units within CPS_AoE[CPS_Loop] of CPS_Point[12]) and do (Actions)
                              • Loop - Actions
                                • Set CPS_Target = (Picked unit)
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (CPS_Target is A structure) Equal to (==) False
                                      • (CPS_Target is Mechanical) Equal to (==) False
                                      • (CPS_Target is alive) Equal to (==) True
                                      • (CPS_Target belongs to an enemy of (Owner of CPS_Source[CPS_Loop])) Equal to (==) True
                                    • Then - Actions
                                      • Unit - Cause CPS_Source[CPS_Loop] to damage CPS_Target, dealing CPS_Damage[CPS_Loop] damage of attack type CPS_AttackType[CPS_Loop] and damage type CPS_DamageType[CPS_Loop]
                                    • Else - Actions
                            • Unit - Remove CPS_TargetUnit[CPS_Loop] from the game
                      • Custom script: call RemoveLocation(udg_CPS_Point[12])
                      • Custom script: call RemoveLocation(udg_CPS_SourcePoint[udg_CPS_Loop])
                      • Custom script: call RemoveLocation(udg_SPSD_TargetPoint)
                      • Unit - Remove CPS_Missile[CPS_Loop] from the game
                      • Set CPS_Missile[CPS_Loop] = No unit
                • Custom script: call RemoveLocation(udg_CPS_Point[9])
                • Custom script: call RemoveLocation(udg_CPS_Point[10])
                • Custom script: call RemoveLocation(udg_CPS_Point[11])
                • Set CPS_Off = False
              • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • CPS_Off Equal to (==) True
          • Then - Actions
            • Set CPS_MUI = 0
            • Trigger - Turn off (This trigger)
          • Else - Actions
  • CPS Creating
    • Events
    • Conditions
    • Actions
      • Set CPS_MUI = (CPS_MUI + 1)
      • Set CPS_AoE[CPS_MUI] = Projectile_AoE
      • Set CPS_AttackType[CPS_MUI] = Projectile_AttackType
      • Set CPS_Damage[CPS_MUI] = Projectile_Damage
      • Set CPS_DamageType[CPS_MUI] = Projectile_DamageType
      • Set CPS_Destroy[CPS_MUI] = Projectile_DestroyTree
      • Set CPS_Impact[CPS_MUI] = Projectile_Impact
      • Set CPS_UnitOrPoint[CPS_MUI] = Projectile_UnitOrPoint
      • Set CPS_Speed[CPS_MUI] = Projectile_Speed
      • Set CPS_VArc[CPS_MUI] = Projectile_VArc
      • Set CPS_VArcHeight[CPS_MUI] = Projectile_VArcHeight
      • Set CPS_Height[CPS_MUI] = Projectile_Height
      • Set CPS_HArc[CPS_MUI] = Projectile_HArc
      • Set CPS_HArcWidth[CPS_MUI] = Projectile_HArcWidth
      • Set CPS_HArcLeftRight[CPS_MUI] = Projectile_HArcLeftOrRight
      • Set CPS_Source[CPS_MUI] = Projectile_Source
      • Set CPS_SourcePoint[CPS_MUI] = (Position of Projectile_Source)
      • Set CPS_Trigger[CPS_MUI] = Projectile_Trigger
      • Set CPS_TraveledDistance[CPS_MUI] = 0.00
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Projectile_UnitOrPoint Equal to (==) True
          • Then - Actions
            • Set CPS_TargetUnit[CPS_MUI] = Projectile_TargetUnit
            • Set CPS_Point[2] = (Position of Projectile_TargetUnit)
            • Set CPS_Angle = (Angle from CPS_SourcePoint[CPS_MUI] to CPS_Point[2])
            • Custom script: call RemoveLocation(udg_CPS_Point[2])
          • Else - Actions
            • Unit - Create 1 CPS_DummyType for (Owner of CPS_Source[CPS_MUI]) at Projectile_TargetPoint facing Default building facing (270.0) degrees
            • Set CPS_TargetUnit[CPS_MUI] = (Last created unit)
            • Set CPS_Point[2] = (Position of CPS_TargetUnit[CPS_MUI])
            • Set CPS_Angle = (Angle from CPS_Point[1] to CPS_Point[2])
            • Custom script: call RemoveLocation(udg_CPS_Point[2])
      • Unit - Create 1 CPS_DummyType for (Owner of Projectile_Source) at CPS_SourcePoint[CPS_MUI] facing CPS_Angle degrees
      • Set CPS_Missile[CPS_MUI] = (Last created unit)
      • Custom script: if UnitAddAbility(udg_CPS_Missile[udg_CPS_MUI], 'Amrf') and UnitRemoveAbility(udg_CPS_Missile[udg_CPS_MUI], 'Amrf') then
      • Custom script: endif
      • Unit - Move CPS_Missile[CPS_MUI] instantly to CPS_SourcePoint[CPS_MUI]
      • Animation - Change CPS_Missile[CPS_MUI] flying height to Projectile_Height at 0.00
      • Animation - Change CPS_Missile[CPS_MUI]'s size to (Projectile_Size%, 0.00%, 0.00%) of its original size
      • Special Effect - Create a special effect attached to the origin of CPS_Missile[CPS_MUI] using Projectile_Model
      • Set CPS_MissileDistance[CPS_MUI] = 0.00
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Projectile_VArc Equal to (==) False
          • Then - Actions
            • Custom script: call SetUnitAnimationByIndex( udg_CPS_Missile[udg_CPS_MUI] , 90 )
          • Else - Actions
      • Custom script: call RemoveLocation(udg_Projectile_TargetPoint)
      • Custom script: call TriggerExecute( gg_trg_CPS_Init )
      • Trigger - Turn on CPS Loop <gen>
  • CPS Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CPS_DummyType = Dummy
      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
      • -------- RESET SETTINGS --------
      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
      • Set Projectile_AoE = 0.00
      • Set Projectile_AttackType = Magic
      • Set Projectile_Damage = 0.00
      • Set Projectile_DamageType = Normal
      • Set Projectile_DestroyTree = False
      • Set Projectile_HArc = False
      • Set Projectile_Height = 50.00
      • Set Projectile_Impact = none
      • Set Projectile_Model = none
      • Set Projectile_Size = 100.00
      • Set Projectile_Source = No unit
      • Set Projectile_Speed = 25.00
      • Set Projectile_TargetUnit = No unit
      • Custom script: set udg_Projectile_Trigger = null
      • Set Projectile_UnitOrPoint = True
      • Set Projectile_VArc = False
      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
      • -------- DUMMY CREATING --------
      • -------- [][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][]X[][] --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • CPS_Dummy Equal to (==) No unit
          • Then - Actions
            • Set TempPoint = (Center of (Playable map area))
            • Unit - Create 1 CPS_DummyType for Neutral Passive at TempPoint facing Default building facing (270.0) degrees
            • Unit - Add Harvest (Neutral) to (Last created unit)
            • Set CPS_Dummy = (Last created unit)
            • Custom script: call RemoveLocation(udg_TempPoint)
          • Else - Actions

Ver 1.2c
- Improved code.
Ver 1.2b
- Used 1 global dummy instead of creating dummy on checking tree
- Reduced default projectile's height to 50.00

Notice for those using version 1.2: before updating to version 1.2b, you
should remove the old system, change "CPS_Dummy" into unit type and then
copy the new system in order to avoid variable type error.
Ver 1.2
- Add new arc effect - Vertical Arc (like DotA's Wild Axe of Rexxar)
- Added 3 new example spells
- Added some descriptions to understand code easier.
- Fixed bug that destroy bridge
- Fixed bug that straight projectiles played random animation while moving.
- Reposition action:
"Custom script: call RemoveLocation(udg_SPSD_TargetPoint)"
- System will reset almost data into default. A default projectile will have:
  • AoE = 0.00
  • AttackType = Magic
  • Damage = 0.00
  • DamageType = Normal
  • DestroyTree = False
  • HArc = False
  • Height = 100.00 (from version 1.2b, this value is 50)
  • Impact = none
  • Model = none
  • Size = 100.00
  • Source = No unit
  • Speed = 25.00
  • TargetUnit = No unit
  • Trigger = No trigger
  • UnitOrPoint = True
  • VArc = False
When you want to create a default projectile, you only need to set caster,
target, model, impact,... then run CPS_Creating trigger. This function may
shorten your setting (if you don't use some values, you needn't set them to
null) or avoid creating projectile with the last created one's effects.
Ver 1.1
- From now on, target unit/point and projectile's source will be stored at SPSD
(stored projectile system's data) variables.
- Allowed the user to destroy destructibles around target point area.
- System will reset Projectile_Trigger after each run time.
- Added a new example spell.
- Fixed a bug that created wrong dummy.
Ver 1.0
- First upload.

Keywords:
projectile, missile, system, LeoNguyen112, arc, dummy
Contents

System - Custom Projectiles (Map)

Reviews
07:43, 26th Jul 2012 Magtheridon96: This is excellent. Rated 5/5 for being more than a half-decent projectile system for GUIers.

Moderator

M

Moderator

07:43, 26th Jul 2012
Magtheridon96: This is excellent.
Rated 5/5 for being more than a half-decent projectile system for GUIers.
 
It would be nice if you were to post the triggers for those who aren't on their computers to be able to give you feedback as well.

Also, this may surprise you, but some people here don't have Warcraft III installed. :p

edit
For some odd reason, this has Custom scripts that say "Unknown" and there's a global setting in the InitGlobals function that's setting a trigger variable to "TriggerNull" rather than "null".
It's probably your version of the World Editor writing the file differently or something.

The custom script "Unknown" crashes my World editor when I attempt to edit it.
I'll fix this for you and give you a version of your map that can be opened with any editor, one moment.

edit
Okay, this is going to be harder than I thought >.>
Could you post the triggers so I can decipher what the rest of the "Unknowns" are?
 
Tip:

It's usually more readable to avoid those one-liner if blocks and enumeration blocks =o (Pick every unit in ...)

edit
Also, you don't need that location array.
Using 3 location variables is totally fine.

I would also recommend making a couple of variables that store the target unit, the source unit,
and some other data so that when you run the trigger for the user, he would be able to access that data.
(Sort of like how DamageEngine by Bribe has DamageEventSource, DamageEventTarget and DamageEventAmount.
 
Magtheridon96 said:
Don't create a dummy and order him to harvest, create a dummy on Map Initialization and use him, because that would be far more efficient ;)
Create the dummy, give him Locust, make him invulnerable, then hide him.
I have a question, do you mean only use 1 dummy for whole map? It may take 1 more trigger and variable to do this so I think it's unnecessary.

Updated and removed leak!
 
Yes, one dummy.

It's necessary because what you can do on map initialization should not be left for game-time ;)
(There's this rule in programming: What can be done at compile time shouldn't be left for run-time)

Creating units is a slow operation, so creating one dummy per destructable may slow things down quite a lot =o
 
^ What you said is quite difficult to... understand :| or my English isn't good enough to understand it totally.
- You said it's unnecessary to create dummy per destructible, so I will not create it. My solution is using CSP_Missile. I'll add Harvest to it then order it to harvest, anyway it will be removed after dealing damage. So, if I do this, can the problem be solved?
__________________________

I have another problem:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • CPS_Destroy[CPS_Loop] Equal to True
    • Then - Actions
      • Destructible - Pick every destructible within CPS_AoE[CPS_Loop] of CPS_Point[12] and do (Actions)
        • Loop - Actions
          • Unit - Order CPS_Missile[CPS_Loop] to Harvest (Picked destructible)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (String((Current order of CPS_Missile[CPS_Loop]))) Equal to harvest
            • Then - Actions
              • Destructible - Kill (Picked destructible)
            • Else - Actions
    • Else - Actions
It does not destroy brigde, but destroy ramp and other destructibles
 
Well, maybe I had mistake. After several testing times, I now understand that the dummy must be at destructible location. So this is my last result:

  • Destructible - Pick every destructible within CPS_AoE[CPS_Loop] of CPS_Point[12] and do (Actions)
    • Loop - Actions
      • Set CPS_Point[8] = (Position of (Picked destructible))
      • Unit - Move CPS_Missile[CPS_Loop] instantly to CPS_Point[8]
      • Unit - Add Harvest (Gold and Lumber) to CPS_Missile[CPS_Loop]
      • Unit - Order CPS_Missile[CPS_Loop] to Harvest (Picked destructible)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (String((Current order of CPS_Missile[CPS_Loop]))) Equal to harvest
        • Then - Actions
          • Destructible - Kill (Picked destructible)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_CPS_Point[8])
 
Level 8
Joined
Dec 22, 2008
Messages
207
You know, at this point, it would be far better to just have one global dummy unit so you don't have to keep adding the harvest ability :L

Create a Locust unit and give it the harvest ability and use it.
That's about it.

bump
This seems to have been updated since the above post by Magtheridon96... But it's still 'pending update'? :O
 
The arcing animation of the missile is ugly,you can use some other methods like GetZAngle or check other missiles systems for formulas.

In this part of code:
  • Unit - Create 1 CPS_DummyType for (Owner of Projectile_Source) at CPS_SourcePoint[CPS_MUI] facing CPS_Angle degrees
  • Unit - Add Crow Form to (Last created unit)
  • Unit - Remove Crow Form from (Last created unit)
  • Unit - Move (Last created unit) instantly to CPS_SourcePoint[CPS_MUI]
  • Animation - Change (Last created unit) flying height to Projectile_Height at 0.00
  • Animation - Change (Last created unit)'s size to (Projectile_Size%, 0.00%, 0.00%) of its original size
  • Special Effect - Create a special effect attached to the origin of (Last created unit) using Projectile_Model
  • Set CPS_Missile[CPS_MUI] = (Last created unit)
Move the CPS_Missile var after the dummy is created,then use it in the parameters instead of last create unit. This is a missile system,we need speed bro.

Same goes to the Picked Destructable and Picked Unit. You should cache these kind of parameters inside variables to increase speed.

I suggest to get rid of damage,destroy trees, special effect on drop, etc.,you should use a much friendlier, much easier to use method,its what we call Custom Event. You should use a real variable,then change its value depending on what event you want. You can check Unit Indexer and Unit Event for an example.

  • Unit - Add Crow Form to (Last created unit)
  • Unit - Remove Crow Form from (Last created unit)

AFAIK, this is not a safe method. This is a safe method:
  • Custom script : if UnitAddAbility(bj_lastCreatedUnit, 'Amrf') and UnitRemoveAbility(bj_lastCreatedUnit, 'Amrf') then
  • Custom script : endif

50 fps is bad,make it 33 fps or 32 fps or 25 fps(in other words,the loop must be 0.03 or 0.03125 or 0.04)

  • Set TempPoint = (Center of (Playable map area))
    • Unit - Create 1 CPS_DummyType for Neutral Passive at TempPoint facing Default building facing degrees
    • Unit - Add Harvest (Neutral) to (Last created unit)
    • Set CPS_Dummy = (Last created unit)
    • Custom script: call RemoveLocation(udg_TempPoint)
Move the CPS_Dummy above then use it as the parameter for Last Created unit in Add Harvest. Don't use your own dummy,use Peasant,hide it then add Locust(via trigger),but this is optional.

You don't need to move the dummy when destroying trees.

This is my review for now.Mainly,the other reviews I didn't put is for the Dummy Object Datas.
 
Level 3
Joined
Dec 8, 2013
Messages
51
That's a really good system, but..
I think you could use SetUnitX and the y equivalent instead of moving unit instantly with GUI. You could then ignore pathing checks and the system would be faster. Move unit instantly is a performance expensive action.
I think it would really make the system better, but i'm not sure if I can handle this myself. Author is afk for now, anyone could "upgrade" his system? And so I will be really grateful.
 
Level 2
Joined
Apr 13, 2018
Messages
14
I have a question...

For the rain of arrows kind of spell. When I put in another Sylvannas in the map, and make both heroes fire the spell (as close to each instance as possible) at the same time, then the first caster only shoots 2-3 waves, while the second caster shoots the default 5. Is this supposed to be happening?
 
Level 42
Joined
Feb 27, 2007
Messages
5,327
Can this create a shockwave type of spell?
So you didn't read the very first box of text in the resource description...?
This system allows you to create spell in a simpler way with these feathers:
o Simply create a straight projectile
...
o Can activate following trigger when hit (allow you to create attaching effect
(like stun, knock back,...).
 
Level 42
Joined
Feb 27, 2007
Messages
5,327
If you're not going to read literally anything about a resource, then don't comment on it asking how it works or if it does something. Get your head out of your ass and use your eyes. The idiocy you just displayed is unbelievable.

The text is not a "wall" it's a description you are supposed to read to see if the resource is useful for your purposes.
 
Level 5
Joined
Apr 13, 2008
Messages
184
If you're not going to read literally anything about a resource, then don't comment on it asking how it works or if it does something. Get your head out of your ass and use your eyes. The idiocy you just displayed is unbelievable.

The text is not a "wall" it's a description you are supposed to read to see if the resource is useful for your purposes.
Yeah sorry about that, i'll read it before commenting in the future.
 
Top