| 01-30-2007, 02:35 AM | #1 |
Alright, here's the correlating function definition (In the custom script area) JASS://=================================================================================================== // Multiboard Update function Trig_Multiboard_Update_Actions takes integer atimer, unit hero returns nothing local integer a = GetConvertedPlayerId(GetOwningPlayer(hero)) loop call MultiboardSetItemValueBJ( udg_multiboard, 2, a, I2S(atimer) ) call TriggerSleepAction( 1 ) set atimer = atimer - 1 exitwhen atimer == 0 endloop call MultiboardSetItemValueBJ( udg_multiboard, 2, a, "" ) endfunction function InitTrigMultiboard_Update takes nothing returns nothing local trigger mu = CreateTrigger( ) call TriggerAddAction( mu , function Trig_Multiboard_Update_Actions ) endfunction And the function call: JASS:function Trig_AllianceDead_Conditions takes nothing returns boolean if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then return false endif if ( not ( IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()), Player(0)) == true ) ) then return false endif return true endfunction function Trig_AllianceDead_Actions takes nothing returns nothing local integer a = GetHeroLevel(GetTriggerUnit()) * 3 set udg_multiboard_dead[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = I2S(a) call Multiboard_Update(a, GetTriggerUnit()) endfunction //=========================================================================== function InitTrig_AllianceDead takes nothing returns nothing set gg_trg_AllianceDead = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_AllianceDead, EVENT_PLAYER_UNIT_DEATH ) call TriggerAddCondition( gg_trg_AllianceDead, Condition( function Trig_AllianceDead_Conditions ) ) call TriggerAddAction( gg_trg_AllianceDead, function Trig_AllianceDead_Actions ) endfunction But I get a function call problem on the line: "call Multiboard_Update(a, GetTriggerUnit())" This is my first attempt at writing an entire function on my own and attempting to implement it, any help would be awesome. |
| 01-30-2007, 03:17 AM | #2 |
JASS:function Trig_Multiboard_Update_Actions takes integer atimer, unit hero returns nothing JASS:call Multiboard_Update(a, GetTriggerUnit()) |
| 01-30-2007, 03:44 AM | #3 |
K, made the appropriate changes in both the Multiboard_Update name and the Multiboard_Update_Conditions calls. Still get the same error message. |
| 01-30-2007, 04:10 AM | #4 |
Erm... The problem is in your second set of functions. JASS:function Trig_AllianceDead_Actions takes nothing returns nothing local integer a = GetHeroLevel(GetTriggerUnit()) * 3 set udg_multiboard_dead[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = I2S(a) call Multiboard_Update(a, GetTriggerUnit()) endfunction Change that call to call Trig_Multiboard_Update_Actions(a, GetTriggerUnit()) or change the function in the first set to Multiboard_Update Post the updated script when you're done. |
| 01-30-2007, 04:19 AM | #5 |
Yep..I got rid of the "Trig_" prefix on my "Multiboard_Update" trigger and subsequently removed the InitTrigMultiboard Update trigger and the whole thing compiles fine. JASS:function Multiboard_Update takes integer atimer, unit hero returns nothing local integer a = GetConvertedPlayerId(GetOwningPlayer(hero)) loop call MultiboardSetItemValueBJ( udg_multiboard, 2, a, I2S(atimer) ) call TriggerSleepAction( 1 ) set atimer = atimer - 1 exitwhen atimer == 0 endloop call MultiboardSetItemValueBJ( udg_multiboard, 2, a, "" ) if IsPlayerAlly(GetOwningPlayer(hero), Player(0)) then call Alliance_Respawn(hero) elseif IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()), Player(6)) then call Ancients_Respawn(hero) endif endfunction JASS:function Trig_AllianceDead_Conditions takes nothing returns boolean return not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) return not ( IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()), Player(0)) == true ) return true endfunction function Trig_AllianceDead_Actions takes nothing returns nothing local integer a = GetHeroLevel(GetTriggerUnit()) * 3 set udg_multiboard_dead[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = I2S(a) call Multiboard_Update(a, GetTriggerUnit()) endfunction //=========================================================================== function InitTrig_AllianceDead takes nothing returns nothing set gg_trg_AllianceDead = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_AllianceDead, EVENT_PLAYER_UNIT_DEATH ) call TriggerAddCondition( gg_trg_AllianceDead, Condition( function Trig_AllianceDead_Conditions ) ) call TriggerAddAction( gg_trg_AllianceDead, function Trig_AllianceDead_Actions ) endfunction One other quick thing: Is JASS:return not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) return not ( IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()), Player(0)) == true ) Evaluate to be the same as: JASS:if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then return false endif if ( not ( IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()), Player(0)) == true ) ) then return false |
| 01-30-2007, 06:16 AM | #6 |
No. Only the first return it passes through is used. You'll want: JASS:return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true and sPlayerAlly(GetOwningPlayer(GetTriggerUnit()), Player(0)) == true |
| 01-30-2007, 04:30 PM | #7 | |
Quote:
JASS:return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true and IsPlayerAlly(GetOwningPlayer(GetTriggerUnit()), Player(0)) == true Correted Typo. |
