| 08-19-2006, 05:33 PM | #1 |
hi well i wrote a trigger in gui converted it to jass and tryed to make it work with "locals" instead of normal variables but it dosent work nothing happens >.< JassCraft does only say that gg_rct_Team_2_Town, gg_trg_team2_wp5 & gg_rct_Team2_waypoint_5 are wrong(Undeclared) but well the orginal jass script used em to and thay did work so i dont think thay are wrong here it goes any way i hope some one can help me, i dont know how to debugg jass yet. JASS:function Trig_team2_wp5_Conditions takes nothing returns boolean if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then return false endif return true endfunction function Trig_team2_wp5_Actions takes nothing returns nothing local unit TempUnit = GroupPickRandomUnit(GetUnitsInRectAll(gg_rct_Team_2_Town)) local real TempX = GetUnitX(TempUnit) local real TempY = GetUnitY(TempUnit) local unit killerUnit = GetTriggerUnit() local real killerX = GetUnitX(killerUnit) local real killerY = GetUnitY(killerUnit) local lightning TempLi call PauseUnitBJ(true, GetTriggerUnit()) set TempLi = AddLightning("AFOD", true, TempX, TempY, killerX, killerY) call KillUnit(TempUnit) call KillUnit(killerUnit) call TriggerSleepAction(0.50) call DestroyLightningBJ(TempLi) set TempLi = null set TempUnit = null set killerUnit = null endfunction //=========================================================================== function InitTrig_team2_wp5 takes nothing returns nothing set gg_trg_team2_wp5 = CreateTrigger( ) call DisableTrigger( gg_trg_team2_wp5 ) call TriggerRegisterEnterRectSimple( gg_trg_team2_wp5, gg_rct_Team2_waypoint_5 ) call TriggerAddCondition( gg_trg_team2_wp5, Condition( function Trig_team2_wp5_Conditions ) ) call TriggerAddAction( gg_trg_team2_wp5, function Trig_team2_wp5_Actions ) endfunction Tnx! |
| 08-19-2006, 07:17 PM | #2 |
The trigger is initially off, are you turning it on? |
| 08-19-2006, 07:38 PM | #3 |
yes i did (= well first i converted it to jass tested workt but if 2 units would enter the area in 0,5s the first lightning effect would not be removed so well i guess jass has locals, but well i dont know what is wrong if i coded it wrong or if its some thing else as said this is my first jass >.< but tnx for the tip The orginal jass code (working) JASS:function Trig_team2_wp5_Orginal_Conditions takes nothing returns boolean if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then return false endif return true endfunction function Trig_team2_wp5_Orginal_Actions takes nothing returns nothing set udg_TempUnit = GroupPickRandomUnit(GetUnitsInRectAll(gg_rct_Team_2_Town)) call PauseUnitBJ( true, GetTriggerUnit() ) call AddLightningLoc( "AFOD", GetUnitLoc(GetTriggerUnit()), GetUnitLoc(udg_TempUnit) ) call KillUnit( udg_TempUnit ) call KillUnit( GetTriggerUnit() ) call TriggerSleepAction( 0.50 ) call DestroyLightningBJ( GetLastCreatedLightningBJ() ) endfunction //=========================================================================== function InitTrig_team2_wp5_Orginal takes nothing returns nothing set gg_trg_team2_wp5_Orginal = CreateTrigger( ) call TriggerRegisterEnterRectSimple( gg_trg_team2_wp5_Orginal, gg_rct_Team2_waypoint_5 ) call TriggerAddCondition( gg_trg_team2_wp5_Orginal, Condition( function Trig_team2_wp5_Orginal_Conditions ) ) call TriggerAddAction( gg_trg_team2_wp5_Orginal, function Trig_team2_wp5_Orginal_Actions ) endfunction |
| 08-19-2006, 07:48 PM | #4 |
agg dont know what the call DisableTrigger( gg_trg_team2_wp5 ) dose there but i guess it disabels the jass code like you said removed it and it worked tnx |
