"Invalid escape character sequence" is ?

Komaqtion

You can change this now in User CP.
Reaction score
469
Hi!
I was just wondering what this sentence means?
I get that error in this line in my attempt at starting to work with JASS:

local string e = "Abilities\Spells\NightElf\Taunt\TauntCaster.mdl"

What am I doing wrong ?

PS: Does any1 know how come i can't use CODE wrapping or any of those things, because it just don't seem to work. I can't even click those icons when im writing a reply... and I can either use the Quick reply button to reply to posts. i have 2 use the Quote button to be able to write posts
 
JASS:
local string e = "Abilities\Spells\NightElf\Taunt\TauntCaster.mdl"


Should be

JASS:
local string e = "Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl"


You must have double \ in the JASS strings if you're refering to "\".

Think of the first one as a "start" for the escape character sequence, the second one is the actual character you're using (break line would be \n for example instead of |n).
 
JASS:
local string e = "Abilities\Spells\NightElf\Taunt\TauntCaster.mdl"


Should be

JASS:
local string e = "Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl"


You must have double \ in the JASS strings if you're refering to "\".

Oh ok thanks you sooo much!!
 
Ok but now i got an other error that i don't know what it means:
"Local declaration after first statement"

It refferes to these lines:

"loop
local integer i = 1
exitwhen i==4 <-- This one
local string e = "Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl"
local location loc = GetUnitLoc(GetTriggerUnit()) <-- This one
local location loco = OffsetLocation(loc,i*2,i*2) <-- This one
endloop <-- This one
endfunction"


BTW: Sorry for dubble post!!!!
 
Ok thanks =)

Also...is there a function that is like polar offset as in GUI ??

EDIT: Sorry found it XD

But what is the local for a special effect?

And also, is there any none BJ functions to get last created unit/special effect ???
 
Yes, just convert it from GUI to Jass and you get it , but it is a BJ which alot people here don't really like for making code more efficent.

There is a native but I forgot which..
 
misread
what do you mean "what is the local of a special effect?"
its a string?
if you want to avoid last create sfx, then set it as a variable. set sfx = AddSpecialEffect(blah,blah,blah) or just destroy it as you create it. call DestroyEffect(AddSpecialEfect(blah,blah,blah))
 
but if I create a special effect and then set it to a local, why do i use DestroyEffect(AddSpecialEffect()) ???
Why not use DestroyEffect(e)
where e is the variable set for the effect ?
will this create the effect as i set it to a variable ?

This is the trigger:
JASS:
function Spell_Check takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == &#039;0000&#039; ) ) then
        return false
    endif
    return true
endfunction

function Spell takes nothing returns nothing
local location l = GetUnitLoc(GetTriggerUnit())
local string s = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
call AddSpecialEffectLoc(s,l)
call DestroyEffect(GetLastCreatedEffectBJ())
call RemoveLocation(l)
set s = null
endfunction

function Effects takes nothing returns nothing
local integer i = 1
local string e = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
local location loc = GetUnitLoc(GetTriggerUnit())
local location loco = PolarProjectionBJ(loc,200.,i*90)
loop
exitwhen i==4
call AddSpecialEffectLoc(e,loco)
call DestroyEffect(GetLastCreatedEffectBJ())
call RemoveLocation(loc)
call RemoveLocation(loco)
set e = null
endloop
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_006 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_006 = CreateTrigger()
    call TriggerAddCondition(gg_trg_Untitled_Trigger_006,Condition(function Spell_Check))
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Untitled_Trigger_006,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddAction(gg_trg_Untitled_Trigger_006,function Spell)
endfunction
 
There is no point in having the effect variable if you're just going to destroy it right away.
And strings don't have to be nulled, but locations do.
And you probably don't want to use GetLastCreatedEffectBJ (or any GetLastWhatever) in Jass.
And your condition can be simplified like this:
JASS:
function Spell_Check takes nothing returns boolean
    return (GetSpellAbilityId() == &#039;0000&#039;)
endfunction
 
Then how am i supposed to destroy them??? (the effects i mean XD)
And am i supposed to remove the location first and then null it or what ?
 
And as i asked before =), does this create the effect right also and then destroy it ?
 
Yes. But not all effects are displayed, only those who have no animation names. Such as Thunder Clap, War Stomp, Taunt, Howl of Terror, etc.
 
Anything that returns something can be used to set the type variable the function returns, be it global, be it local, be it array...
 
Not to mention that the above function won't work, since the native CreateUnit doesn't set bj_lastCreatedUnit, while the BJ-version does. :)
 
So I'm just wondering, are these triggers quite efficient now then ?

JASS:
function Spell_Check takes nothing returns boolean
    return (GetSpellAbilityId() == &#039;0000&#039;)
endfunction

function Spell takes nothing returns nothing
    local location l = GetUnitLoc(GetTriggerUnit())
    local string s = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
    call DestroyEffect(AddSpecialEffectLoc(s,l))
    call RemoveLocation(l)
    set l = null
endfunction

function Effects takes nothing returns nothing
local integer i = 1
local string e = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
local location loc = GetUnitLoc(GetTriggerUnit())
local location loco
loop
exitwhen i==4
set loco = PolarProjectionBJ(loc,200.,i*90)
call DestroyEffect(AddSpecialEffectLoc(e,loco))
call RemoveLocation(loc)
call RemoveLocation(loco)
set i = i+1
endloop
set i = 0
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_006 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_006 = CreateTrigger()
    call TriggerAddCondition(gg_trg_Untitled_Trigger_006,Condition(function Spell_Check))
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Untitled_Trigger_006,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddAction(gg_trg_Untitled_Trigger_006,function Spell)
endfunction


JASS:
function Trig_Untitled_Trigger_006_Actions takes nothing returns nothing
local string e = &quot;Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl&quot;
local integer i = (&#039;Hpal&#039;)
local location l = (GetRectCenter(GetPlayableMapRect()))
local unit u = (CreateUnitAtLoc(Player(0),i,l,bj_UNIT_FACING)) 
call PanCameraTo((GetLocationX(l)),(GetLocationY(l)))
call RemoveLocation (l)
call TriggerSleepAction(5.)
set l = GetUnitLoc(u)
call DestroyEffect(AddSpecialEffectLoc(e,l))
call RemoveLocation (l)
set l = null
set i = 0
set u = null
endfunction
//===========================================================================
function InitTrig_UntitledTrigger006 takes nothing returns nothing
    set gg_trg_UntitledTrigger006 = CreateTrigger()
    call TriggerRegisterTimerEventSingle(gg_trg_UntitledTrigger006, 1.0)
    call TriggerAddAction( gg_trg_UntitledTrigger006, function Trig_Untitled_Trigger_006_Actions )
endfunction


EDIT: But how do i pan the camera for only player red, without BJ:s ?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    It is weird seeing a way more realistic users online number
  • The Helper The Helper:
    Happy Tuesday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top