| 09-18-2004, 06:49 AM | #1 |
I thought i was just getting the hang of it, downloaded a editor called "Jass Editor", worked nicely, checked for syntex, my trigger cleared fine, tried to save map with it, got 26 fuc-ken errors. WHY?!?! i wont list the errors, i guess ill just post the trigger... function Trig_Mine_Built_Conditions takes nothing returns boolean if ( not ( GetUnitTypeId(GetConstructedStructure()) == udg_mine ) ) then return false endif return true endfunction function FindTrees takes nothing returns nothing local string dID = GetDestructableName(GetEnumDestructable()) if ( dID == "Fall Tree Wall" ) then set udg_nearTrees = udg_nearTrees + 1 endif endfunction function FindWorkers takes nothing returns nothing endfunction function FindTrees takes nothing returns nothing local integer itemID = 'I003' local item thisItem set udg_nearTrees = 0 call UnitAddItemByIdSwapped( itemID, GetConstructedStructure() ) call EnumDestructablesInCircleBJ( 500, GetUnitLoc(GetConstructedStructure()), FindTrees ) call SetItemCharges( GetLastCreatedItem(), udg_nearTrees ) call ForGroupBJ( GetUnitsInRangeOfLocAll(500, GetUnitLoc(GetConstructedStructure())), FindWorkers ) endfunction //=========================================================================== function InitTrig_Mine_Built takes nothing returns nothing set gg_trg_Mine_Built = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Mine_Built, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH ) call TriggerAddCondition( gg_trg_Mine_Built, Condition( function Trig_Mine_Built_Conditions ) ) call TriggerAddAction( gg_trg_Mine_Built, function Trig_Mine_Built_Actions ) endfunction EDIT: oh and all the errors are of the "expected a name statment" "expected a code statment" "expected a "("" and "expected a function statment" These are all so general, dont make sence at all, and make me wanna shoot world editor for having the worst explinations in the world, its even more frusterating when uve spent the last day trying to figure out how jass works, and comming up with ideas to use it... this is fuken anoying.... please help me understand this peice of crap compiler |
| 09-18-2004, 04:51 PM | #2 |
Same as in your last question. You need to pass function references with "function <functionname>". So your line call EnumDestructablesInCircleBJ( 500, GetUnitLoc(GetConstructedStructure()), FindTrees ) would be call EnumDestructablesInCircleBJ( 500, GetUnitLoc(GetConstructedStructure()), function FindTrees ) Same with the ForGroup |
| 09-19-2004, 12:34 AM | #3 |
ahhh god damn this stupid syntex. ok thank u much |
