• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] script stops execution when adding weathereffect

Status
Not open for further replies.
Level 3
Joined
Sep 11, 2008
Messages
58
Hello Jassers

I have a problem with weather-effects. Below the vJass code:

JASS:
    type weather10 extends weathereffect array[10]
    
    globals
        weather10 glb_map_wide_weathers extends array
    endglobals    
    
    function init_weather takes nothing returns nothing
        set glb_map_wide_weathers[0] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'WOcw' ) //blizzard
        set glb_map_wide_weathers[1] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'SNbs' ) //wind
    endfunction

In the function init_weather i assign 2 weather-effects to an array. I want enable them later somewhere else. I call the init_weather function within a at-map-init-trigger. After this point all other initializations i call within the same trigger won't be executed, execution is stuck in the init_weather function. What's wrong with it?

Thanks for any answers.

whisp
 
Level 3
Joined
Sep 11, 2008
Messages
58
I'm intimate with the basics of Jass. Are you sure i will find what i search within that link?
 
Level 8
Joined
Jul 22, 2008
Messages
331
you are not calling it right
You have
JASS:
type weather10 extends weathereffect array[10]

    globals
        weather10 glb_map_wide_weathers extends array
    endglobals

    function init_weather takes nothing returns nothing
        set glb_map_wide_weathers[0] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'WOcw' ) //blizzard
        set glb_map_wide_weathers[1] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'SNbs' ) //wind
    endfunction


but've setted array

JASS:
        set glb_map_wide_weathers[0] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'WOcw' ) //blizzard
        set glb_map_wide_weathers[1] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'SNbs' ) //wind


you need other call
 
Level 3
Joined
Sep 11, 2008
Messages
58
The function doesn't take any arguments (init_weather takes nothing returns nothing)
 
Level 3
Joined
Sep 11, 2008
Messages
58
solved the problem.

the working code:

JASS:
    type weather10 extends weathereffect array[10]
    
    globals
        weather10 glb_map_wide_weathers
    endglobals    
    
    function init_weather takes nothing returns nothing
        set glb_map_wide_weathers = weather10.create()
        set glb_map_wide_weathers[0] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'WOcw' ) //blizzard
        set glb_map_wide_weathers[1] = AddWeatherEffect ( bj_mapInitialPlayableArea, 'SNbs' ) //wind
    endfunction

Thanks for your advices.

whisp
 
Status
Not open for further replies.
Top