HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

jass help

04-20-2004, 12:25 AM#1
Hige
When i tryed using Darky's jass spell in my map my editor goes crazy and spots errors and disables it and changes it to this
//===========================================================================
// Trigger: Volcano
// Script Author: Darky27
// Info: Erupts a big volcano
//===========================================================================

function Trig_Volcano_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A000' )
endfunction

function Trig_Volcano_Actions takes nothing returns nothing
local effect array effects
local location targetpoint = udg_VolcanoLoc
call TriggerExecute( udg_VolcanoTriggers[1] )

call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, -450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, 400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.50 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Doodads\\Cinematic\\FireRockSmall\\FireRockSmall.mdl" )
set effects[GetForLoopIndexA() * 2] = GetLastCreatedEffectBJ()
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set effects[(GetForLoopIndexA() * 2) + 1] = GetLastCreatedEffectBJ()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call AddSpecialEffectLocBJ( targetpoint, "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
set effects[1] = GetLastCreatedEffectBJ()
call TriggerSleepAction( 22.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, 450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, -400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyEffectBJ( effects[GetForLoopIndexA() * 2] )
call DestroyEffectBJ( effects[(GetForLoopIndexA() * 2) + 1] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyEffectBJ( effects[1] )
endfunction

function Trig_Volcano_Target_Conditions takes nothing returns boolean
return ( GetIssuedOrderIdBJ() == String2OrderIdBJ("silence") )
endfunction

function Trig_Volcano_Target_Actions takes nothing returns nothing
set udg_VolcanoLoc = GetOrderPointLoc()
endfunction

function Trig_Volcano_Attack_Actions takes nothing returns nothing
local integer i = 1
local integer j
local unit array volcano
local location target
local location targetpoint = udg_VolcanoLoc
set j = 1
loop
exitwhen j > 3
call CreateNUnitsAtLoc( 1, 'e001', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+1] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e002', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+2] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e003', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+3] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
set j = j + 1
endloop
loop
exitwhen i > 22
set j = 1
loop
exitwhen j > 9
set target = PolarProjectionBJ(targetpoint, GetRandomReal(300.00, 700.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( volcano[j], "attackground", target )

set udg_VolcanoTarget = target
set udg_VolcanoTime = 1.6 * ((DistanceBetweenPoints(GetUnitLoc(volcano[j]), target)) / 500)
call TriggerExecute( udg_VolcanoTriggers[2] )

set j = j + 1
endloop
call TriggerSleepAction( 0.8 )
set i = i + 1
endloop
set j = 1
loop
exitwhen j > 9
call UnitRemoveAbilityBJ( 'Aloc', volcano[j] )
call RemoveUnit( volcano[j] )
set j = j + 1
endloop
endfunction

function Trig_Volcano_Damage_Group takes nothing returns boolean
return (( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true ) and ( IsUnitEnemy(GetFilterUnit(), Player(0)) == true ))
endfunction

function Trig_Volcano_Damage_Actions takes nothing returns nothing
local real time = udg_VolcanoTime
local location target = udg_VolcanoTarget
local effect fire
local unit Target2
local group DamageGroup = GetUnitsInRangeOfLocMatching(300.00, target, Condition(function Trig_Volcano_Damage_Group))
call TriggerSleepAction( time )
call AddSpecialEffectLocBJ( target, "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl" )
set fire = GetLastCreatedEffectBJ()
call TriggerSleepAction( 1.0 )
call DestroyEffectBJ( fire )
loop
set Target2 = GroupPickRandomUnit(DamageGroup)
exitwhen Target2 == null
call SetUnitLifeBJ( Target2, ( GetUnitStateSwap(UNIT_STATE_LIFE, Target2) - 40 ) )
call GroupRemoveUnitSimple( Target2, DamageGroup )
endloop
endfunction

//===========================================================================
function InitTrig_Volcano takes nothing returns nothing
local trigger Volcano_Target = CreateTrigger( )
set udg_VolcanoTriggers[1] = CreateTrigger( )
set udg_VolcanoTriggers[2] = CreateTrigger( )
set gg_trg_Volcano = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Volcano, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Volcano, Condition( function Trig_Volcano_Conditions ) )
call TriggerAddAction( gg_trg_Volcano, function Trig_Volcano_Actions )
call TriggerRegisterPlayerUnitEventSimple( Volcano_Target, Player(0), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( Volcano_Target, Condition( function Trig_Volcano_Target_Conditions ) )
call TriggerAddAction( Volcano_Target, function Trig_Volcano_Target_Actions )
call TriggerAddAction( udg_VolcanoTriggers[1], function Trig_Volcano_Attack_Actions )
call TriggerAddAction( udg_VolcanoTriggers[2], function Trig_Volcano_Damage_Actions )
endfunction
04-20-2004, 12:30 AM#2
Narwanza
Whenever posting in this forum, give detailed error reports, and also, if possible, the lines on which the errors occurred. Also enclose all JASS in <code> tags. (replace <'s with ['s) I have read through darky's spell and it worked fine for me, so.... Make sure that the name of the trigger you copy it over to is call Volcano. You also need a global trigger array named VolcanoTriggers. You also need the globas VolcanoLoc (location), VolcanoTarget (unit?,maybe locaiton check map), VolcanoTime (real, I would suppose) Ya, that is all the help I can give until you give me any other information.
04-20-2004, 12:53 AM#3
Hige
Um Narwanza Sense i dont get jass 1 bit i was wondering if you would want to import the spell in for me
04-20-2004, 11:18 PM#4
Vidstige
And what will you do the next time you want to import a spell, ask Narwanza again? Why don't you just do as he suggests if you want help? Or learn some Jass Triggering basics, so you can figure out yourself how it works...
04-21-2004, 12:28 AM#5
Hige
ya know what dude being grumpy like that is not gonna get you any where on this forum and dont post if u arnt gonna be beneficial or helpful in away way