• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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