The_Chosen_Oreo Corporal
| Subject: What is wrong with this JASS? Mon Aug 01, 2011 1:30 am | |
| I can't figure out what is wrong with this jass trigger... Ill post the complete trigger, including the generated stuff and the error list. If I could narrow it down to a particular thing I would. Trigger: - Code:
-
//*************************************************************************** //* //* Global Variables //* //***************************************************************************
globals // User-defined string udg_LastEnteredChatString integer array udg_CurrentTerrainShape integer array udg_CurrentTerrainSize unit array udg_Spawner
// Generated trigger gg_trg_Terrain_Type = null trigger gg_trg_UnitSpawner = null endglobals
function InitGlobals takes nothing returns nothing local integer i = 0 set udg_LastEnteredChatString = "" set i = 0 loop exitwhen (i > 12) set udg_CurrentTerrainSize[i] = 1 set i = i + 1 endloop
endfunction
function Trig_UnitSpawner_Custom_Parser takes string s returns nothing endfunction
function Trig_UnitSpawner_Normal_Parser takes string s returns nothing if(s == "hpea") then call CreateUnit('hpea') return endif if(s =="hfoo") then call CreateUnit('hfoo') return endif if(s == "hkni") then call CreateUnit('hkni') return endif if(s == "hrif") then call CreateUnit('hrif') return endif if(s == "hmtm") then call CreateUnit('hmtm') return endif if(s == "hgyr") then call CreateUnit('hgyr') return endif if(s == "hgry") then call CreateUnit('hgry') return endif if(s == "hmpr") then call CreateUnit('hmpr') return endif if(s == "hsor") then call CreateUnit('hsor') return endif if(s == "hmtt") then call CreateUnit('hmtt') return endif return endfunction
function CreateUnit takes integer i returns nothing CreateUnitAtLoc(1, i, GetEventPlayer(GetTriggerPlayer(), GetUnitLoc(udg_UnitGrp1[GetConvertedPlayerId(GetTriggerPlayer())]), 180.00 ) return endfunction
function Trig_UnitSpawner_Actions takes nothing returns nothing if(SubString(GetEventPlayerChatString(), 6, 11) == "Normal") then call Trig_UnitSpawner_Normal_Parser(SubString(GetEventPlayerChatString(), 13, 16)) return endif if(SubString(GetEventPlayerChatString(), 6, 11) == "Custom") then call Trig_UnitSpawner_Custom_Parser(SubString(GetEventPlayerChatString(), 13, 16)) return endif return endfunction
function InitTrig_UnitSpawner takes nothing returns nothing set gg_trg_UnitSpawner = CreateTrigger() call TriggerRegisterPlayerChatEvent(gg_trg_UnitSpawner, Player(0), "-SpawnNormal", false) call TriggerAddAction(gg_trg_UnitSpawner, function Trig_UnitSpawner_Actions) endfunction Error: - Code:
-
Line 38: Invalid number of arguments Line 42: Invalid number of arguments Line 46: Invalid number of arguments Line 50: Invalid number of arguments Line 54: Invalid number of arguments Line 58: Invalid number of arguments Line 62: Invalid number of arguments Line 66: Invalid number of arguments Line 70: Invalid number of arguments Line 74: Invalid number of arguments Line 79: Expected a name Line 80: Expected a name Line 81: Expected 'endif' Line 83: Expected 'endif' Line 93: Expected 'endif' Line 95: Expected 'endif' Line 99: Expected a function name Line 99: Expected 'endif'
The name of the trigger is UnitSpawner -Oreo | |
|
Pat1487 Moderator
| Subject: Re: What is wrong with this JASS? Mon Aug 01, 2011 2:03 am | |
| All your return statements that return nothing should be "return null" | |
|
The_Chosen_Oreo Corporal
| Subject: Re: What is wrong with this JASS? Mon Aug 01, 2011 10:27 am | |
| This still has to do with the trigger, but I think my WE just broke. I'm clicking the enabled checkbox and nothing is happening. It's changing if it has a check in it but the trigger is not enabling. I just restarted the WE and it is still doing that.
EDIT:
That seems to be the only trigger that WON'T enable. It doesn't even show errors when I click enable trigger, it just does nothing...
EDIT 2: I got rid of all the nulls after the Return statements and it shows me errors again...
EDIT 3: I re-added nulls after the returns and now it shows me errors but they're the SAME errors I had before. | |
|
Pat1487 Moderator
| Subject: Re: What is wrong with this JASS? Mon Aug 01, 2011 10:52 am | |
| My line numbering might be wrong
But I copied and pasted your code into notepad++ to get the right line numbers so they should be right All the lines it refers to in the errors are the return statements (the first 10)
If thats not the case then im not sure whats wrong with them | |
|
The_Chosen_Oreo Corporal
| Subject: Re: What is wrong with this JASS? Mon Aug 01, 2011 11:44 am | |
| It's not working so I'll just scrap what I have and start from scratch again
Thanks for answering tho. | |
|
The_Chosen_Oreo Corporal
| Subject: Re: What is wrong with this JASS? Mon Aug 01, 2011 2:42 pm | |
| I'm A Retard... - Code:
-
function CreateUnit is a native function... I accidentally named my function that | |
|
Sponsored content
| Subject: Re: What is wrong with this JASS? | |
| |
|