• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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