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

[JASS] problem

Status
Not open for further replies.
Level 2
Joined
Jan 20, 2007
Messages
18
i got some problem with my spell i havent added that they will cast the spell but i will create a unit at the picked unit loc but i causes my world editor to crash :/ can anyone tell me why?

JASS:
function trig_test_Condition01 takes nothing returns nothing
    if ( not ( GetSpellAbilityId() == 'AHtc' ) ) then
    return false
endfunction

function trig_test_condtion02 takes nothing returns nothing
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction

function trig_test_action takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(( 600 * I2R(GetUnitAbilityLevelSwapped( 'AHtc', GetTriggerUnit())) )
endfunction

function trig_test_func001 takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'hfoo', Player(GetTriggerUnit), GetRectCenter(GetEnumUnit())), 0.00
endfunction

//==================================================================
function InitTrig_test takes nothing returns nothing
    set gg_trg_test = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_test, EVENT_PLAYER_UNIT_SPELL_CAST )
    call trig_test_condtion01
    call trig_test_action
    call trig_test_condtion02
    call trig_test_func001
endfunction
 
Level 2
Joined
Jan 20, 2007
Messages
18
fixed it a bit

fixed it up a bit but still got 4 errors that i cant fix

line 25: Expected a code statement
line 30: Expected expression
line 34: Expected a function name
line 41: Expected a function name




JASS:
function trig_test_Condition01 takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AHtc' ) ) then
    endif
    return false
endfunction

function trig_test_condtion02 takes nothing returns nothing
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
    endif
    return true
endfunction

function trig_test_action takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(( '600' * I2R(GetUnitAbilityLevelSwapped( 'AHtc', GetTriggerUnit())) )
endfunction

function trig_test_func001 takes nothing returns nothing
    call (CreateNUnitsAtLoc( 1, 'hfoo', (Player(GetTriggerUnit), GetRectCenter(GetEnumUnit( ))), 0.00
endfunction

//==================================================================
function InitTrig_test takes nothing returns nothing
    set gg_trg_test = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_test, EVENT_PLAYER_UNIT_SPELL_CAST )
    call trig_test_condtion01
    call trig_test_action( )
    call trig_test_condtion02( )
    call trig_test_func001( )
endfunction
 
Level 11
Joined
Jul 12, 2005
Messages
764
This is NOT JASS, this is a conversion and bad rewrite of GUI to JASS.

1. A TRIGGER DOES NOT LOOK LIKE THIS
2. READ SOME TUTORIALS
3. LEARN (AT LEAST) THE BASICS OF JASS
4. DON'T POST ANY SCRIPTS UNTIL YOU KNOW WHAT JASS IS ALL ABOUT!!

HELL!!!!
 
Last edited:
Level 5
Joined
May 22, 2006
Messages
150
Hell, this is the biggest bunch of mistakes I have seen for a very, very long time!

I cannot even recognize, what this is supposed to be...
Tell me and I might show you, how you could do it.

@paskovitch:
As we all know, the GUI-way of scripting is pretty bad...
But hell, it does never, never ever create such codes!
Looks more like a piece of paper, which a cat played with for an hour or two. ^^
 
Status
Not open for further replies.
Top