• 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] doesn't compile

Status
Not open for further replies.

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
Hi, this little trigger block my compilation...
i wonder why?
[Jass=]
function SpawnActions takes nothing returns nothing
call Beast_Spawn1()
call TriggerSleepAction(0.10)
call Beast_Spawn2()
call TriggerSleepAction(0.10)
call Beast_Spawn3()
call TriggerSleepAction(0.10)
call Beast_Spawn4()
call TriggerSleepAction(0.10)
call Beast_Spawn5()
call TriggerSleepAction(0.10)
call DestroyTrigger(GetTriggeringTrigger())
endfunction

//===========================================================================
function InitTrig_SpawnLauncher_JASS takes nothing returns nothing
set gg_trg_SpawnLauncher_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_SpawnLauncher_JASS, function SpawnActions )
endfunction
[/code]
when desactivated it compile, when activated it says error....
the library called is :
library Beast
and the functions names:
Spawn1 , Spawn2 , Spawn3 , Spawn4 , Spawn5
they all takes(nothing) returns(nothing)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Please post the entire script if you want help... Also what error? Syntax errors do give a reason behind why they were raised.

It could be that the functions are private (in which case they cannot be used outside the library) or that they have no modifier at all (so do not inherit the Library prefix). All those spawn functions must be "public" so you can do what you are trying.
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
The library is quite Big...
but don't focus on the constant , they are used in the whole map, not just this library.
[Jass=]
library Beast
globals
//i removed all constant to increase lisibility
endglobals

function Spawn1 takes nothing returns nothing
local real x
local real y
local integer i = 1
set x = GetRandomReal(GetRectMinX(gg_rct_Mojo_Anaconda), GetRectMaxX(gg_rct_Mojo_Anaconda))
set y = GetRandomReal(GetRectMinY(gg_rct_Mojo_Anaconda), GetRectMaxY(gg_rct_Mojo_Anaconda))
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANACONDA_ID, x, y, bj_UNIT_FACING )
set x = GetRectCenterX(gg_rct_Secret_Deep_Zone)
set y = GetRectCenterY(gg_rct_Secret_Deep_Zone)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEBIRD_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
set x = GetRectCenterX(gg_rct_Froll_Hut)
set y = GetRectCenterY(gg_rct_Froll_Hut)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROLLHUTT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(1.00, 50.00) )
call SetItemCharges( UnitAddItemById( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROLL_ID, x, y, bj_UNIT_FACING ), HARPOON_ID ), GetRandomInt(1, 5) )
loop
exitwhen i > 9
set x = GetRandomReal(GetRectMinX(udg_Area), GetRectMaxX(udg_Area))
set y = GetRandomReal(GetRectMinY(udg_Area), GetRectMaxY(udg_Area))
if GetRandomInt(1, 10) <= 6 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEBIRD_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), VULTURE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
set x = GetRandomReal(GetRectMinX(udg_Area), GetRectMaxX(udg_Area))
set y = GetRandomReal(GetRectMinY(udg_Area), GetRectMaxY(udg_Area))
if GetRandomInt(1, 10) <= 6 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEBIRD_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), VULTURE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
if GetRandomInt(0, 1) == 1 then
set x = GetRandomReal(GetRectMinX(gg_rct_Mojo_Anaconda), GetRectMaxX(gg_rct_Mojo_Anaconda))
set y = GetRandomReal(GetRectMinY(gg_rct_Mojo_Anaconda), GetRectMaxY(gg_rct_Mojo_Anaconda))
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANACONDA_ID, x, y, bj_UNIT_FACING )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 2
set x = GetRectCenterX(gg_rct_Mojo_Tarantula)
set y = GetRectCenterY(gg_rct_Mojo_Tarantula)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TARENTULAQUEEN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
set x = GetRandomReal(GetRectMinX(gg_rct_Mojo_Tarantula), GetRectMaxX(gg_rct_Mojo_Tarantula))
set y = GetRandomReal(GetRectMinY(gg_rct_Mojo_Tarantula), GetRectMaxY(gg_rct_Mojo_Tarantula))
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SPIDER_EGGBAG_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 6
set x = GetRandomReal(GetRectMinX(udg_Cave), GetRectMaxX(udg_Cave))
set y = GetRandomReal(GetRectMinY(udg_Cave), GetRectMaxY(udg_Cave))
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MANGYRAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set x = GetRandomReal(GetRectMinX(udg_Cave), GetRectMaxX(udg_Cave))
set y = GetRandomReal(GetRectMinY(udg_Cave), GetRectMaxY(udg_Cave))
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MANGYRAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set x = GetRandomReal(GetRectMinX(udg_Cave), GetRectMaxX(udg_Cave))
set y = GetRandomReal(GetRectMinY(udg_Cave), GetRectMaxY(udg_Cave))
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MANGYRAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
set x = GetRandomReal(GetRectMinX(udg_water_big), GetRectMaxX(udg_water_big))
set y = GetRandomReal(GetRectMinY(udg_water_big), GetRectMaxY(udg_water_big))
if GetRandomInt(1, 10) != 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATOR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
elseif GetRandomInt(1, 20) <= 6 then
if GetRandomInt(1, 3) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), HERMITCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RIVERCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
elseif GetRandomInt(1, 14) <= 6 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROG_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
elseif GetRandomInt(1, 8) <= 3 then
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MOSQUITOES_ID, x, y, bj_UNIT_FACING )
elseif GetRandomInt(1, 5) <= 3 then
if GetRandomInt(1, 4) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), GIANTTORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
else
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATORHATCHLING_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATOR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
endif
set i = i + 1
endloop
endfunction

function Spawn2 takes nothing returns nothing
local real x
local real y
local integer i = 1
loop
exitwhen i > 86
set x = GetRandomReal(GetRectMinX(udg_ground_normal), GetRectMaxX(udg_ground_normal))
set y = GetRandomReal(GetRectMinY(udg_ground_normal), GetRectMaxY(udg_ground_normal))
if GetRandomInt(1, 10) <= 3 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIGLET_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BOAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
elseif GetRandomInt(1, 7) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPEFAWN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 5) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERKITTEN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERCAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 3) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEARCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
elseif GetRandomInt(1, 2) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOONCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOON_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
else
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BUNNY_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RABBIT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
endif
endif
set i = i + 1
endloop
endfunction

function Spawn3 takes nothing returns nothing
local real x
local real y
local integer i = 1
loop
exitwhen i > 54
set x = GetRandomReal(GetRectMinX(udg_water_normal), GetRectMaxX(udg_water_normal))
set y = GetRandomReal(GetRectMinY(udg_water_normal), GetRectMaxY(udg_water_normal))
if GetRandomInt(1, 20) <= 6 then
if GetRandomInt(1, 3) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), HERMITCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RIVERCRAB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
elseif GetRandomInt(1, 14) <= 5 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROG_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
elseif GetRandomInt(1, 9) <= 1 then
call SetItemCharges( UnitAddItemById( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), FROLL_ID, x, y, bj_UNIT_FACING ), HARPOON_ID ), GetRandomInt(1, 5) )
elseif GetRandomInt(1, 8) <= 3 then
call CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), MOSQUITOES_ID, x, y, bj_UNIT_FACING )
elseif GetRandomInt(1, 5) <= 3 then
if GetRandomInt(1, 4) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), GIANTTORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TORTOISE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
elseif GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATORHATCHLING_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ALLIGATOR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 400.00) )
endif
set i = i + 1
endloop
endfunction

function Spawn4 takes nothing returns nothing
local real x
local real y
local integer i = 1
loop
exitwhen i > 42
set x = GetRandomReal(GetRectMinX(udg_ground_vermin), GetRectMaxX(udg_ground_vermin))
set y = GetRandomReal(GetRectMinY(udg_ground_vermin), GetRectMaxY(udg_ground_vermin))
if GetRandomInt(1, 20) <= 9 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), JUNGLEASPIC_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
elseif GetRandomInt(1, 11) <= 9 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), TARENTULA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BLACKWIDOW_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
set x = GetRandomReal(GetRectMinX(udg_ground_big), GetRectMaxX(udg_ground_big))
set y = GetRandomReal(GetRectMinY(udg_ground_big), GetRectMaxY(udg_ground_big))
if GetRandomInt(1, 10) != 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
elseif GetRandomInt(1, 10) <= 3 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIGLET_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BOAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
elseif GetRandomInt(1, 7) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPEFAWN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 100.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), ANTELOPE_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 5) <= 2 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERKITTEN_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), SABERCAT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 300.00) )
endif
elseif GetRandomInt(1, 3) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEARCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEAR_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 500.00) )
endif
elseif GetRandomInt(1, 2) <= 1 then
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOONCUB_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RACOON_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 250.00) )
endif
else
if GetRandomInt(1, 10) <= 1 then
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BUNNY_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
else
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), RABBIT_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 200.00) )
endif
endif
set i = i + 1
endloop
endfunction

function Spawn5 takes nothing returns nothing
local real x
local real y
local unit spawn
local integer i = 1
loop
exitwhen i > 70
set x = GetRectCenterX(udg_ground_food)
set y = GetRectCenterY(udg_ground_food)
if GetRandomInt(1, 7) <= 4 then
if GetRandomInt(1, 20) <= 2 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), BEEHIVE_ID, x, y, bj_UNIT_FACING )
set udg_BeeSwarmCount = ( udg_BeeSwarmCount + 1 )
call SetUnitUserData( spawn, udg_BeeSwarmCount )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
set udg_BeeSwarm[udg_BeeSwarmCount] = CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), BEEQUEEN_ID, x, y, bj_UNIT_FACING )
elseif GetRandomInt(1, 18) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), ARIA_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
elseif GetRandomInt(1, 17) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), BARDANE_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
elseif GetRandomInt(1, 16) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), CORIAN_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
elseif GetRandomInt(1, 15) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), DRAXIMOR_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
else
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), BERRYBUSH_ID, x, y, bj_UNIT_FACING )
call SetUnitState( spawn, UNIT_STATE_MANA, GetRandomReal(0.00, 50.00) )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
endif
endif
set spawn =null
set i = i + 1
endloop
endfunction

function Spawn6 takes nothing returns nothing
local real x
local real y
local unit spawn
local integer i = 1
loop
exitwhen i > 24
set x = GetRectCenterX(udg_minerals)
set y = GetRectCenterY(udg_minerals)
if GetRandomInt(1, 2) == 1 then
if GetRandomInt(1, 2) == 1 then
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Rock[GetRandomInt(1, 6)], x, y, bj_UNIT_FACING )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
else
set spawn = CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Rock[GetRandomInt(7, 12)], x, y, bj_UNIT_FACING )
call UnitRemoveAbility( spawn, 'Afir' )
call UnitRemoveAbility( spawn, 'Afio' )
call UnitRemoveAbility( spawn, 'Afih' )
call UnitRemoveAbility( spawn, 'Afin' )
call UnitRemoveAbility( spawn, 'Afiu' )
endif
endif
set spawn =null
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 4
set x = GetRectCenterX(udg_water_piranha)
set y = GetRectCenterY(udg_water_piranha)
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIRANHA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIRANHA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
call SetUnitState( CreateUnit( Player(PLAYER_NEUTRAL_AGGRESSIVE), PIRANHA_ID, x, y, bj_UNIT_FACING ), UNIT_STATE_MANA, GetRandomReal(0.00, 150.00) )
set i = i + 1
endloop
endfunction
endlibrary
[/code]

here is latest modification on the bugging trigger

[Jass=]
function SpawnActions takes nothing returns nothing
call Beast_Spawn1()
call TriggerSleepAction(0.10)
call Beast_Spawn2()
call TriggerSleepAction(0.10)
call Beast_Spawn3()
call TriggerSleepAction(0.10)
call Beast_Spawn4()
call TriggerSleepAction(0.10)
call Beast_Spawn5()
call TriggerSleepAction(0.10)
call Beast_Spawn6()
call DestroyTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_SpawnLauncher_JASS takes nothing returns nothing
set gg_trg_SpawnLauncher_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_SpawnLauncher_JASS, function SpawnActions )
endfunction
[/code]
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
ok, i will try...
but why i don't need to specify the Library?

EDIT

[Jass=]
function SpawnActions takes nothing returns nothing
call Spawn1()
call TriggerSleepAction(0.10)
call Spawn2()
call TriggerSleepAction(0.10)
call Spawn3()
call TriggerSleepAction(0.10)
call Spawn4()
call TriggerSleepAction(0.10)
call Spawn5()
call TriggerSleepAction(0.10)
call Spawn6()
call DestroyTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_SpawnLauncher_JASS takes nothing returns nothing
set gg_trg_SpawnLauncher_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_SpawnLauncher_JASS, function SpawnActions )
endfunction
[/code]

doesn't compile....
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
dsg already told you, if you wanted to call Beast_spawn1() you would need to make the function public(public function spawn1 takes nothing returns ...)

doesnt compiler, sure but you should say or screen what compiler says to you as error
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
i think the compile doesn't come from the new
call Spawn1()

but i can't tell you the error message...
Because i am stuck with WEU on the map i am updating, and WEU systematically crash the error message...
when i get error, it stays like this fore ever without showing the error message, so i have to alt+ctrl+supr and close manually the jasshelper
:(
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
ok it work ^^

there is still a bug, but somewhere else...
so this one at least work fine with the:
call Spawn1()

thanks everyone.
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
it is a map that i made 6 years ago, and at that time i was pretty noob, and knew only a little about GUI, so i choose WEU because some people on forum said it was great to give more possibility...
i eventually gave up on the map after 1 year due to bug and crash after because the map was becoming huge...
a friend took the map and continued updating it and working on it...

the problem is that to remove WEU today, i need to remove all the gui triggers that use WEU, even worse many ability are bugged and cause the editor to crash if i delete them...
so i have no choice but to JASS every triggers one by one, until i can export the map into the normal editor and open it without it crashing due to WEU shit...
after that i will need to copy paste all triggers into a clean map with only terrain, and then copy one by one all ability that are needed....
and maybe re adapt the JASS trigger when the ability code has changed...

anyway for now i cannot use hashtable and i am stuck with WEU..
^^ but not for long... allready 33% triggers have been improved with JASS and VJASS.


(all bugs are settled as of now, everytime i edit new bug tend to appear)
so to use libraryname + function name
i need a library with public function, else the call is function name directly....
if i understand correctly.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
yes, lets have an example for even better understanding:
JASS:
library MyLib
    public function Func takes nothing returns nothing
    endfunction

    function Func2 takes nothing returns nothing
    endfunction

    private function Func3 takes nothing returns nothing
    endfunction

//in the library I can call all 3 of those functions normally, like:

    function test takes nothing returns nothing
        call Func()
        call Func2()
        call Func3()
//this test function causes no troubles
endlibrary

//now Im outside of the library

function TEST takes nothing returns nothing
    //this will not work
    call Func()

    //this, however, will work because it is public:
    call MyLib_Func()

    //this function has no modifiers, it can be called using its name
    call Func2()

    //neither of those works because the function is private and can only be called from within the place it is declared(scope, struct, library etc)
    call Func3()
    call MyLib_Func3()
endfunction
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
it is a map that i made 6 years ago, and at that time i was pretty noob, and knew only a little about GUI, so i choose WEU because some people on forum said it was great to give more possibility...
i eventually gave up on the map after 1 year due to bug and crash after because the map was becoming huge...
a friend took the map and continued updating it and working on it...

the problem is that to remove WEU today, i need to remove all the gui triggers that use WEU, even worse many ability are bugged and cause the editor to crash if i delete them...
so i have no choice but to JASS every triggers one by one, until i can export the map into the normal editor and open it without it crashing due to WEU shit...
after that i will need to copy paste all triggers into a clean map with only terrain, and then copy one by one all ability that are needed....
and maybe re adapt the JASS trigger when the ability code has changed...

anyway for now i cannot use hashtable and i am stuck with WEU..
^^ but not for long... allready 33% triggers have been improved with JASS and VJASS.


(all bugs are settled as of now, everytime i edit new bug tend to appear)
so to use libraryname + function name
i need a library with public function, else the call is function name directly....
if i understand correctly.

As far as I know JNGP can open and edit WEU maps easily.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
if you used any of the GUI functions declared only in WEU, it will crash on load
this happened to me multiple times with functions like: GetTreeInFrontCone or FirstOfGroup
that is because those are injected natives that are called with GUI and cant be retrieved with other editors, thats why its not safe to use WEU.

JNGP maps can still be loaded from normal editor, the only problem are vJass triggers
 
Status
Not open for further replies.
Top