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

Custom Script Compile errors, unexpected end of line

Status
Not open for further replies.
Is there any limit to how many characters I can have in a custom script? When I try to save a map with the following I get a compile error saying syntax error, unexpected end of line.

  • MIL
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Inner Fire
    • Actions
      • Set MI_Count = (MI_Count + 1)
      • Set MI_Caster[MI_Count] = (Triggering unit)
      • Set MI_Target[MI_Count] = (Target unit of ability being cast)
      • Set MIL_Point1[MI_Count] = (Position of MI_Caster[MI_Count])
      • Set MIL_Point2[MI_Count] = (Position of MI_Target[MI_Count])
      • Custom script: set udg_MIL[MI_Count] = AddLightningEx("DRAL", true , GetLocationX(udg_MIL_Point1[MI_Count]), GetLocationY(udg_MIL_Point1[MI_Count]), GetLocationZ(udg_MIL_Point1[MI_Count]) + 70, GetLocationX(udg_MIL_Point2[MI_Count]), GetLocationY(udg_MIL_Point2[MI_Count]), GetLocationZ(udg_MIL_Point2[MI_Count]) + 70)
      • Custom script: call RemoveLocation (udg_MIL_Point1[1])
      • Custom script: call RemoveLocation (udg_MIL_Point2[1])
      • Wait 10.00 seconds
      • Set MI_Total = (MI_Total + 1)
      • Lightning - Destroy MIL[MI_Total]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MI_Count Equal to MI_Total
        • Then - Actions
          • Set MI_Count = 0
          • Set MI_Total = 0
        • Else - Actions


  • MIL Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set MIL_Point1[MI_Count] = (Position of MI_Caster[MI_Count])
      • Set MIL_Point2[MI_Count] = (Position of MI_Target[MI_Count])
      • Custom script: call MoveLightningEx(udg_MIL[MI_Count], true , GetLocationX(udg_MIL_Point1[MI_Count]), GetLocationY(udg_MIL_Point1[MI_Count]), GetLocationZ(udg_MIL_Point1[MI_Count]) + 70, GetLocationX(udg_MIL_Point2[MI_Count]), GetLocationY(udg_MIL_Point2[MI_Count]), GetLocationZ(udg_MIL_Point2[MI_Count]) + 70)
      • Custom script: call RemoveLocation (udg_MIL_Point1[1])
      • Custom script: call RemoveLocation (udg_MIL_Point2[1])



If I change [MI_Count] to a number (example [1]) instead it compiles without errors....
 
Last edited:
Level 12
Joined
Feb 22, 2010
Messages
1,115
There is indeed a max character limit, I think it was around 200 (2xx) but I don't exactly remember. Try storing some of the xyz values inside temporary variables to shorten.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,891
One of the most retarded errors of all time. There is also this error when making strings you can't put the "" directly when you already have another pair of "" delimiting the scope of the string.
stupid.png
 
One of the most retarded errors of all time.
Haha truly...
There is indeed a max character limit, I think it was around 200 (2xx) but I don't exactly remember. Try storing some of the xyz values inside temporary variables to shorten.
Changed it up a bit, compiled with no errors now :)

  • MIL
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Inner Fire
    • Actions
      • Set MIC = (MIC + 1)
      • Set MC[MIC] = (Triggering unit)
      • Set MT[MIC] = (Target unit of ability being cast)
      • Set MP1[MIC] = (Position of MC[MIC])
      • Set MP2[MIC] = (Position of MT[MIC])
      • Custom script: set udg_MIL[udg_MIC] = AddLightningEx("DRAL", true , GetLocationX(udg_MP1[udg_MIC]), GetLocationY(udg_MP1[udg_MIC]), GetLocationZ(udg_MP1[udg_MIC]) + 70, GetLocationX(udg_MP2[udg_MIC]), GetLocationY(udg_MP2[udg_MIC]), GetLocationZ(udg_MP2[udg_MIC]) + 70)
      • Custom script: call RemoveLocation (udg_MP1[1])
      • Custom script: call RemoveLocation (udg_MP2[1])
      • Wait 10.00 seconds
      • Set MIT = (MIT + 1)
      • Lightning - Destroy MIL[MIT]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MIC Equal to MIT
        • Then - Actions
          • Set MIC = 0
          • Set MIT = 0
        • Else - Actions


  • MIL Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set MP1[MIC] = (Position of MC[MIC])
      • Set MP2[MIC] = (Position of MT[MIC])
      • Custom script: call MoveLightningEx(udg_MIL[udg_MIC], true , GetLocationX(udg_MP1[udg_MIC]), GetLocationY(udg_MP1[udg_MIC]), GetLocationZ(udg_MP1[udg_MIC]) + 70, GetLocationX(udg_MP2[udg_MIC]), GetLocationY(udg_MP2[udg_MIC]), GetLocationZ(udg_MP2[udg_MIC]) + 70)
      • Custom script: call RemoveLocation (udg_MP1[1])
      • Custom script: call RemoveLocation (udg_MP2[1])
 
Status
Not open for further replies.
Top