"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
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
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).
 

Komaqtion

You can change this now in User CP.
Reaction score
469
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!!
 

Komaqtion

You can change this now in User CP.
Reaction score
469
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!!!!
 

SFilip

Gone but not forgotten
Reaction score
634

Komaqtion

You can change this now in User CP.
Reaction score
469
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 ???
 

wraithseeker

Tired.
Reaction score
122
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..
 

cleeezzz

The Undead Ranger.
Reaction score
268
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))
 

Komaqtion

You can change this now in User CP.
Reaction score
469
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
 

SFilip

Gone but not forgotten
Reaction score
634
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
 

Komaqtion

You can change this now in User CP.
Reaction score
469
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 ?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
And as i asked before =), does this create the effect right also and then destroy it ?
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
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.
 

Charapanga

New Member
Reaction score
46
Anything that returns something can be used to set the type variable the function returns, be it global, be it local, be it array...
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Not to mention that the above function won't work, since the native CreateUnit doesn't set bj_lastCreatedUnit, while the BJ-version does. :)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top