| 02-18-2007, 11:13 PM | #1 |
I seem to have made an error in a (JASS) trigger of mine... I can't enable it because the WE throws a lot of really -weird- errors at me if I do, citing a load of code that isn't in any of the triggers, but looks like it could be related to where the map declares global variables... The offending trigger's code is as follows: JASS:fucntion GF_Is_Refugee takes nothing returns boolean local integer iUnitType set iUnitType = GetUnitTypeId(GetFilterUnit()) return (iUnitType == 'n001' or iUnitType == 'n002' or iUnitType == 'n000') endfunction function GF_Process_Escapees takes nothing returns nothing call DoNothing() endfunction // ------------------- //----MAIN TRIGGER SCRIPT---- // ------------------- function GF_Refugee_Escape_Main takes nothing returns nothing if(GetUnitTypeId(GetTriggerUnit()) == 'hbot') then call ForGroup(GetUnitsInRectMatching(gg_rct_open_sea, Condition(function GF_Is_Refugee)), function GF_Process_Escapees) endif endfunction //---Initialisation--- function InitTrig_GF_Refugee_Escape takes nothing returns nothing set gg_trg_GF_Refugee_Escape = CreateTrigger( ) call TriggerRegisterEnterRectSimple( gg_trg_GF_Refugee_Escape, gg_rct_open_sea ) call TriggerAddAction( gg_trg_GF_Refugee_Escape, function GF_Refugee_Escape_Main ) endfunction I'm thinking it's something really stupid that I've either missed, or that I just aren't aware of due to being new with JASS. Anyone able to track down the source of my error? Thanks. |
| 02-19-2007, 12:22 AM | #2 |
What is the point of even having a trigger to call DoNothing(). This trigger does nothing but waste memory, unless you are not giving us the whole thing. Delete it, problem sovled ![]() |
| 02-19-2007, 12:50 AM | #3 |
Well function is misspelled in the first function. JASS:function GF_Is_Refugee takes nothing returns boolean return GetUnitTypeId(GetFilterUnit()) == 'n001' or GetUnitTypeId(GetFilterUnit()) == 'n002' or GetUnitTypeId(GetFilterUnit()) == 'n000' endfunction Also make sure that you've named your trigger correctly. If its still UntitledTrigger001 or something like that you'll get an error. Its need to be called GF_Refugee_Escape. |
| 02-19-2007, 12:56 AM | #4 | ||
Quote:
Because, I hadn't got to the actions yet, and I don't like leaving the function empty, the call to DoNothing is going to be removed when I finish it. =P I'm weird like that. Quote:
Then this is most likely the cause. =P I hate the fact that, after staring at code (of any kind, JASS, PHP, C++...) for some time, I lose the ability to spot the smallest things, because it always makes me look an idiot when I have to ask for help because I've missed something. >_< Thanks. |
