• 🏆 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!

[Solved] Trigger Problem

Status
Not open for further replies.
Level 2
Joined
Jul 20, 2016
Messages
9
I am using this spell that i found in the spell section. The demo map worked just fine but when i copied it all into my map it is giving me some sort of error that looks like this:



I'm not very good with custom script so I'd really appreciate some help with this. The error is stopping me from even testing the map without disabling the trigger. Here is the trigger that is creating a problem (the first 4 custom script lines):

  • Rapid Firebolt Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer RF_Index1) from 1 to RF_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RF_StageId[RF_Index1] Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RF_Distance[RF_Index1] Greater than 0.00
                • Then - Actions
                  • Custom script: set udg_RF_X=GetUnitX(udg_RF_Firebolt[udg_RF_Index1])+udg_RF_HSpeed[udg_RF_Index1]*Cos(udg_RF_Angle[udg_RF_Index1])
                  • Custom script: set udg_RF_Y=GetUnitY(udg_RF_Firebolt[udg_RF_Index1])+udg_RF_HSpeed[udg_RF_Index1]*Sin(udg_RF_Angle[udg_RF_Index1])
                  • Custom script: call SetUnitX(udg_RF_Firebolt[udg_RF_Index1],udg_RF_X)
                  • Custom script: call SetUnitY(udg_RF_Firebolt[udg_RF_Index1],udg_RF_Y)
                  • Animation - Change RF_Firebolt[RF_Index1] flying height to ((Current flying height of RF_Firebolt[RF_Index1]) - RF_VSpeed[RF_Index1]) at 0.00
                  • Set RF_Distance[RF_Index1] = (RF_Distance[RF_Index1] - RF_HSpeed[RF_Index1])
                • Else - Actions
                  • Set RF_TempLoc = (Position of RF_Firebolt[RF_Index1])
                  • For each (Integer RF_Loop1) from 1 to RF_ExplosionEffectNumber, do (Actions)
                    • Loop - Actions
                      • Special Effect - Create a special effect at RF_TempLoc using RF_ExplosionEffect[RF_Loop1]
                      • Special Effect - Destroy (Last created special effect)
                  • Set RF_Owner = (Owner of RF_Caster[RF_Index1])
                  • Set RF_TempGroup = (Units within RF_DamageRadius[RF_Level[RF_Index1]] of RF_TempLoc)
                  • Unit Group - Pick every unit in RF_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set RF_PickedUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (RF_PickedUnit is A flying unit) Equal to False
                          • (RF_PickedUnit belongs to an ally of RF_Owner) Equal to False
                          • (RF_PickedUnit is dead) Equal to False
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (RF_PickedUnit has buff Ignited ) Equal to False
                            • Then - Actions
                              • Set RandomNumber = (Random integer number between 1 and 100)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • RandomNumber Less than or equal to 3
                                • Then - Actions
                                  • Unit - Create 1 Trigger Dummy for (Owner of RF_Caster[RF_Index1]) at RF_TargetPoint[RF_Index1] facing Default building facing degrees
                                  • Unit - Add Ignition (Dummy) to (Last created unit)
                                  • Unit - Order (Last created unit) to Undead Necromancer - Cripple RF_PickedUnit
                                  • Set Ignite_Index = (Ignite_Index + 1)
                                  • Set Ignite_Caster[Ignite_Index] = RF_Caster[RF_Index1]
                                  • Set Ignite_Target[Ignite_Index] = RF_PickedUnit
                                  • Set Ignite_Damage[Ignite_Index] = ((Real((Intelligence of RF_Caster[RF_Index1] (Include bonuses)))) x (Real(HeroCustomTierNumber[(Player number of (Owner of RF_Caster[RF_Index1]))])))
                                  • Set Ignition_CurrentWave[Ignite_Index] = 7
                                  • Set Ignition_MaxWave[Ignite_Index] = 7
                                  • Set Ignite_Counter[Ignite_Index] = 0.00
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Ignite_Index Equal to 1
                                    • Then - Actions
                                      • Trigger - Turn on Ignition Damage <gen>
                                    • Else - Actions
                                • Else - Actions
                            • Else - Actions
                          • Unit - Cause RF_Caster[RF_Index1] to damage RF_PickedUnit, dealing ((0.50 x (Real((Intelligence of RF_Caster[RF_Index1] (Include bonuses))))) + (Real((RF_Level[RF_Index1] + 3)))) damage of attack type RF_AttackType and damage type RF_DamageType
                        • Else - Actions
                  • Custom script: call DestroyGroup(udg_RF_TempGroup)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RF_DestroyTrees Equal to True
                    • Then - Actions
                      • Destructible - Pick every destructible within RF_DamageRadius[RF_Level[RF_Index1]] of RF_TempLoc and do (Actions)
                        • Loop - Actions
                          • Set RF_PickedDest = (Picked destructible)
                          • Custom script: call IssueTargetOrderById(udg_RF_Harvester,udg_RF_HarvestOrderId,udg_RF_PickedDest)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Current order of RF_Harvester) Equal to RF_HarvestOrderId
                            • Then - Actions
                              • Destructible - Kill RF_PickedDest
                            • Else - Actions
                      • Unit - Order RF_Harvester to Stop
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_RF_TempLoc)
                  • Unit - Kill RF_Firebolt[RF_Index1]
                  • Set RF_StageId[RF_Index1] = 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RF_StageId[RF_Index1] Equal to 2
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (RF_Caster[RF_Index1] is dead) Equal to False
                      • (Current order of RF_Caster[RF_Index1]) Equal to RF_OrderId
                    • Then - Actions
                      • Set RF_rTimer[RF_Index1] = (RF_rTimer[RF_Index1] - 0.03)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RF_rTimer[RF_Index1] Less than or equal to 0.00
                        • Then - Actions
                          • Set RF_rTimer[RF_Index1] = RF_FireboltSpawnInterval[RF_Level[RF_Index1]]
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RF_FireboltCount[RF_Index1] Greater than 0
                            • Then - Actions
                              • Set RF_TempLoc = (RF_TargetPoint[RF_Index1] offset by (Random real number between 0.00 and RF_AoE[RF_Level[RF_Index1]]) towards (Random angle) degrees)
                              • Set RF_MaxIndex = (RF_MaxIndex + 1)
                              • Set RF_Angle[RF_MaxIndex] = (Angle from RF_CasterPosition[RF_Index1] to RF_TempLoc)
                              • Set RF_Distance[RF_MaxIndex] = (Distance between RF_CasterPosition[RF_Index1] and RF_TempLoc)
                              • Unit - Create 1 RF_FireboltMissile for (Owner of RF_Caster[RF_Index1]) at RF_CasterPosition[RF_Index1] facing RF_Angle[RF_MaxIndex] degrees
                              • Set RF_Firebolt[RF_MaxIndex] = (Last created unit)
                              • Animation - Change RF_Firebolt[RF_MaxIndex] flying height to RF_FireboltSpawnHeight[RF_Level[RF_Index1]] at 0.00
                              • Set RF_Caster[RF_MaxIndex] = RF_Caster[RF_Index1]
                              • Set RF_Level[RF_MaxIndex] = RF_Level[RF_Index1]
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • RF_TravelBySpeed Equal to True
                                • Then - Actions
                                  • Set RF_HSpeed[RF_MaxIndex] = RF_FireboltTravelSpeed[RF_Level[RF_Index1]]
                                  • Set RF_FireboltTravelTime[0] = ((RF_Distance[RF_MaxIndex] x 0.03) / RF_HSpeed[RF_MaxIndex])
                                • Else - Actions
                                  • Set RF_HSpeed[RF_MaxIndex] = (RF_Distance[RF_MaxIndex] / (RF_FireboltTravelTime[RF_Level[RF_Index1]] / 0.03))
                                  • Set RF_FireboltTravelTime[0] = RF_FireboltTravelTime[RF_Level[RF_Index1]]
                              • Set RF_VSpeed[RF_MaxIndex] = (RF_FireboltSpawnHeight[RF_Level[RF_Index1]] / (RF_FireboltTravelTime[0] / 0.03))
                              • Custom script: set udg_RF_Angle[udg_RF_MaxIndex]=udg_RF_Angle[udg_RF_MaxIndex]*bj_DEGTORAD
                              • Set RF_StageId[RF_MaxIndex] = 1
                              • Set RF_FireboltCount[RF_Index1] = (RF_FireboltCount[RF_Index1] - 1)
                              • Custom script: call RemoveLocation(udg_RF_TempLoc)
                            • Else - Actions
                              • Unit - Order RF_Caster[RF_Index] to Stop
                        • Else - Actions
                    • Else - Actions
                      • Custom script: call RemoveLocation(udg_RF_CasterPosition[udg_RF_Index1])
                      • Custom script: call RemoveLocation(udg_RF_TargetPoint[udg_RF_Index1])
                      • Set RF_StageId[RF_Index1] = 3
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RF_StageId[RF_Index1] Equal to 3
                    • Then - Actions
                      • Set RF_Angle[RF_Index1] = RF_Angle[RF_MaxIndex]
                      • Set RF_Caster[RF_Index1] = RF_Caster[RF_MaxIndex]
                      • Set RF_CasterPosition[RF_Index1] = RF_CasterPosition[RF_MaxIndex]
                      • Set RF_Distance[RF_Index1] = RF_Distance[RF_MaxIndex]
                      • Set RF_Firebolt[RF_Index1] = RF_Firebolt[RF_MaxIndex]
                      • Set RF_FireboltCount[RF_Index1] = RF_FireboltCount[RF_MaxIndex]
                      • Set RF_HSpeed[RF_Index1] = RF_HSpeed[RF_MaxIndex]
                      • Set RF_Level[RF_Index1] = RF_Level[RF_MaxIndex]
                      • Set RF_StageId[RF_Index1] = RF_StageId[RF_MaxIndex]
                      • Set RF_TargetPoint[RF_Index1] = RF_TargetPoint[RF_MaxIndex]
                      • Set RF_VSpeed[RF_Index1] = RF_VSpeed[RF_MaxIndex]
                      • Set RF_rTimer[RF_Index1] = RF_rTimer[RF_MaxIndex]
                      • Set RF_Index1 = (RF_Index1 - 1)
                      • Set RF_MaxIndex = (RF_MaxIndex - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RF_MaxIndex Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
Any help would be much appreciated :)
 
Status
Not open for further replies.
Top