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

[Trigger] what is wrong with this trigger

Status
Not open for further replies.
Level 13
Joined
Sep 24, 2007
Messages
1,023
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Peasant
  • Actions
    • Environment - Change terrain type at (Position of (Triggering unit)) to Lordaeron Winter - Snow using variation -1 in an area of size 2 and shape Circle
 
Last edited by a moderator:
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type Snowman) and do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Picked unit))
          • Environment - Change terrain type at Point to Northrend - Snow using variation -1 in an area of size 1 and shape Circle
          • Custom script: call RemoveLocation(udg_Point)

Point is a Point variable ...
 
Level 13
Joined
Sep 24, 2007
Messages
1,023
when i did that it say
error
trigger "snowman trail" has been disabled due to errors

JASS:
//===========================================================================
// 
// Just another Warcraft III map
// 
//   Warcraft III map script
//   Generated by the Warcraft III World Editor
//   Date: Tue Jan 01 19:09:43 2008
//   Map Author: Unknown
// 
//===========================================================================

//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // User-defined
    location                udg_snowman                = null

    // Generated
    trigger                 gg_trg_Melee_Initialization = null
    trigger                 gg_trg_snowman_trail       = null
endglobals

function InitGlobals takes nothing returns nothing
endfunction

//***************************************************************************
//*
//*  Unit Creation
//*
//***************************************************************************

//===========================================================================
function CreateUnitsForPlayer0 takes nothing returns nothing
    local player p = Player(0)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit( p, 'H000', -13.7, 72.7, 286.521 )
    set u = CreateUnit( p, 'H000', -196.0, 65.6, 65.799 )
    set u = CreateUnit( p, 'H000', -411.5, 65.6, 147.804 )
    set u = CreateUnit( p, 'H000', -658.8, 58.6, 244.959 )
    set u = CreateUnit( p, 'H000', -859.6, 63.3, 55.911 )
    set u = CreateUnit( p, 'H000', 174.7, 70.3, 340.235 )
endfunction

//===========================================================================
function CreatePlayerBuildings takes nothing returns nothing
endfunction

//===========================================================================
function CreatePlayerUnits takes nothing returns nothing
    call CreateUnitsForPlayer0(  )
endfunction

//===========================================================================
function CreateAllUnits takes nothing returns nothing
    call CreatePlayerBuildings(  )
    call CreatePlayerUnits(  )
endfunction

//***************************************************************************
//*
//*  Triggers
//*
//***************************************************************************

//===========================================================================
// Trigger: Melee Initialization
//
// Default melee game initialization for all players
//===========================================================================
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction

//===========================================================================
// Trigger: snowman trail
//===========================================================================
function Trig_snowman_trail_Func002A takes nothing returns nothing
    set udg_snowman = GetUnitLoc(GetEnumUnit())
    call SetTerrainTypeBJ( udg_snowman, 'Nsnw', -1, 1, 0 )
    call RemoveLocation(udg_Point)
endfunction

function Trig_snowman_trail_Actions takes nothing returns nothing
    set bj_wantDestroyGroup = true
    call ForGroupBJ( GetUnitsOfTypeIdAll('H000'), function Trig_snowman_trail_Func002A )
endfunction

//===========================================================================
function InitTrig_snowman_trail takes nothing returns nothing
    set gg_trg_snowman_trail = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_snowman_trail, 1.00 )
    call TriggerAddAction( gg_trg_snowman_trail, function Trig_snowman_trail_Actions )
endfunction

//===========================================================================
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_Melee_Initialization(  )
    call InitTrig_snowman_trail(  )
endfunction

//===========================================================================
function RunInitializationTriggers takes nothing returns nothing
    call ConditionalTriggerExecute( gg_trg_Melee_Initialization )
endfunction

//***************************************************************************
//*
//*  Players
//*
//***************************************************************************

function InitCustomPlayerSlots takes nothing returns nothing

    // Player 0
    call SetPlayerStartLocation( Player(0), 0 )
    call SetPlayerColor( Player(0), ConvertPlayerColor(0) )
    call SetPlayerRacePreference( Player(0), RACE_PREF_HUMAN )
    call SetPlayerRaceSelectable( Player(0), true )
    call SetPlayerController( Player(0), MAP_CONTROL_USER )

endfunction

function InitCustomTeams takes nothing returns nothing
    // Force: TRIGSTR_002
    call SetPlayerTeam( Player(0), 0 )

endfunction

//***************************************************************************
//*
//*  Main Initialization
//*
//***************************************************************************

//===========================================================================
function main takes nothing returns nothing
    call SetCameraBounds( -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )
    call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" )
    call NewSoundEnvironment( "Default" )
    call SetAmbientDaySound( "LordaeronSummerDay" )
    call SetAmbientNightSound( "LordaeronSummerNight" )
    call SetMapMusic( "Music", true, 0 )
    call CreateAllUnits(  )
    call InitBlizzard(  )
    call InitGlobals(  )
    call InitCustomTriggers(  )
    call RunInitializationTriggers(  )

endfunction

//***************************************************************************
//*
//*  Map Configuration
//*
//***************************************************************************

function config takes nothing returns nothing
    call SetMapName( "Just another Warcraft III map" )
    call SetMapDescription( "Nondescript" )
    call SetPlayers( 1 )
    call SetTeams( 1 )
    call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS )

    call DefineStartLocation( 0, -2527.6, -1967.3 )

    // Player setup
    call InitCustomPlayerSlots(  )
    call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER )
    call InitGenericPlayerSlots(  )
endfunction

this is the trigger
  • Events
    • Time - Every 1.00 seconds of game time
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type Snowman) and do (Actions)
      • Loop - Actions
        • Set snowman = (Position of (Picked unit))
        • Environment - Change terrain type at snowman to Northrend - Snow using variation -1 in an area of size 1 and shape Circle
        • Custom script: call RemoveLocation(udg_Point)
 
Last edited by a moderator:
Status
Not open for further replies.
Top