• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Weird JASS function error

Status
Not open for further replies.
Level 19
Joined
Aug 16, 2007
Messages
881
Hello, I'm currently creating a function that should store variables into a DPS system... But I've encountered a weird error, I don't know why it's appearing...

This is the function:

JASS:
function SetDPS takes unit uc, unit ud, real dmg, real dur, string effectpos, string speffect returns nothing

endfunction

and this is how I call it:

  • Cast
    • Events
    • Conditions
    • Actions
      • Custom script: call SetDPS(udg_DT_Caster[udg_DT_Index[3]], udg_u[0], udg_DT_DPS[udg_DT_Index[3]], 2.0, "overhead", "Abilities\Weapons\PoisonSting\PoisonStingTarget.mdl")
(Don't care about the "udg_DT" variables and such, it's just a test)

but this will give me this error:
  • Expected expression
  • Expected a function name

but when I remove "Abilities\Weapons\PoisonSting\PoisonStingTarget.mdl" it won't give me any error... Seriosly, whats wrong?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
While you're on the topic of strings and slashes, you can do:

JASS:
local string s = "\""

This will be a string that is filled with nothing but ". The back-slash characters yield a special character right after them, so if you've just got one "\" then it won't necessarily mean it is a back-slash, but if you've got two then the processor/compiler can ensure it is always a back-slash.
 
Status
Not open for further replies.
Top