• 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] Function doesn't let warcraft 3 start map.

Status
Not open for further replies.
However it presents to syntax errors, so there must be something wrong with my (ordering?)

JASS:
globals
integer intTerrainTime
rect mapBounds
integer array mapType
timer time
endglobals

function periodic takes nothing returns nothing
    local integer exit = 0
    set mapBounds = Rect(GetCameraBoundMinX(), GetCameraBoundMinY(), GetCameraBoundMaxX(), GetCameraBoundMaxY())
    loop
        exitwhen exit > 17
        call SetTerrainTypeBJ(GetRandomLocInRect(mapBounds),mapType[GetRandomInt(1,7)],-1,GetRandomInt(1,2),0)
        set exit = exit + 1
    endloop
endfunction

function createPeriodicTrigger takes nothing returns nothing
    set time = CreateTimer()
    call TimerStart(time,.05,true,function periodic)
endfunction

function Trig_pointTenSecs_Actions takes nothing returns nothing
    local location centerPlayable = Location(GetRectCenterX(bj_mapInitialPlayableArea),GetRectCenterY(bj_mapInitialPlayableArea))
    set mapType[1] = 'Ldro'
    set mapType[2] = 'Ldrg'
    set mapType[3] = 'Lgrs'
    set mapType[4] = 'Lgrd'
    set mapType[5] = 'Agrd'
    set mapType[6] = 'Lgrs'
    set mapType[7] = 'Ldro'
    call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\White_mask.blp")
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0,0,1,1)
    call SetCineFilterEndUV(0,0,1,1)
    call SetCineFilterStartColor(PercentToInt(0,255),PercentToInt(0,255),PercentToInt(0,255),PercentToInt(100,255))
    call SetCineFilterEndColor(PercentToInt(0,255),PercentToInt(0,255),PercentToInt(0,255),PercentToInt(100,255))
    call SetCineFilterDuration(0)
    call DisplayCineFilter(true)
    set intTerrainTime = 1
    call createPeriodicTrigger()
    call TriggerSleepAction(5)
    call DestroyTimer(time)
    call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\White_mask.blp")
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0,0,1,1)
    call SetCineFilterEndUV(0,0,1,1)
    call SetCineFilterStartColor(PercentTo255(0),PercentTo255(0),PercentTo255(0),PercentTo255(0))
    call SetCineFilterEndColor(PercentTo255(0),PercentTo255(0),PercentTo255(0),PercentTo255(0))
    call SetCineFilterDuration(5)
    call DisplayCineFilter(true)
    call CreateUnit(Player(0),'hfoo',0,0,270)
endfunction

function InitTrig_pointTenSecs takes nothing returns nothing
    set gg_trg_pointTenSecs = CreateTrigger()
    call TriggerRegisterTimerEvent(gg_trg_pointTenSecs,.1,false)
    call TriggerAddAction(gg_trg_pointTenSecs,function Trig_pointTenSecs_Actions)
endfunction

thanks for any help.
 
Level 6
Joined
Sep 13, 2008
Messages
261
The function let me start the map when I added it to mine. so the problem must be somewhere else.

I attached it so you can see for yourself.
 
Last edited:
There are NO syntax errors, yes I'm using JNGP, and the problem is

when the trigger is enabled, the map will not "start"

It doesn't show it's loading screen and just goes back to the player menu when I press the start button in wc3 (goes back to the same thing it was at)

Sorry I didn't specify clearly enough
 
Level 6
Joined
Sep 13, 2008
Messages
261
I have jazz newgen pack and when I put your code in a new map I could run it with no problems. The trigger had no problems for me. I tried it in single player and run from the world editor with newgen.

I don't know what the problem is.
 
Status
Not open for further replies.
Top