The official site of Clan TMMM
 
HomeHomeSearchUsergroupsFAQRegisterLog in


Latest topics
» Hey whats up
by seankly Wed Nov 14, 2018 1:55 pm

» Gotta click fast - WC3 Mazing #mildlyinteresting
by hoffmann Wed Jun 21, 2017 10:28 pm

» I'm getting married and you guys are invited
by Achilles.42 Wed Sep 07, 2016 11:00 am

» Server Photo Album 1
by Pat1487 Sat Aug 06, 2016 5:28 pm

» Legacy of The Void Beta
by Achilles.42 Sun Oct 18, 2015 3:21 am

» Hey guys!!!
by Eat_bacon_daily Fri Oct 16, 2015 11:20 pm

» What everyone been up to
by The_Chosen_Oreo Sun Jun 14, 2015 11:55 am

SC2 Links
SC2 Challenge/Tourney Info

Official SC2 Forums

SC2 Curse

SC2Mapster

Team Liquid

SC2 Replayed

SC2 Strategy
WC3 Links
Clan_TMMM[Host] Info

WC3 Challenge/Tourny Rules

Epicwar
Poll
What game does everyone play now?
Starcraft 2
26%
 26% [ 8 ]
Warcraft 3
35%
 35% [ 11 ]
League of Legends
19%
 19% [ 6 ]
World of Warcraft
0%
 0% [ 0 ]
Diablo 2
0%
 0% [ 0 ]
No games at all
10%
 10% [ 3 ]
Other game not listed
10%
 10% [ 3 ]
Total Votes : 31
Transparency

Share | 
 

 What is wrong with this JASS?

Go down 
AuthorMessage
The_Chosen_Oreo
Corporal
Corporal
avatar


PostSubject: 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
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: 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"
Back to top Go down
The_Chosen_Oreo
Corporal
Corporal
avatar


PostSubject: 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.
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: 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
Back to top Go down
The_Chosen_Oreo
Corporal
Corporal
avatar


PostSubject: 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.
Back to top Go down
The_Chosen_Oreo
Corporal
Corporal
avatar


PostSubject: Re: What is wrong with this JASS?   Mon Aug 01, 2011 2:42 pm

Laughing I'm A Retard...
Code:
function CreateUnit
is a native function... I accidentally named my function that Laughing
Back to top Go down
Sponsored content




PostSubject: Re: What is wrong with this JASS?   

Back to top Go down
 
What is wrong with this JASS?
Back to top 
Page 1 of 1
 Similar topics
-
» Theres SOMETHING WRONG With The Way I Sketch?
» How get a wrong sent gift back?
» Reset if you use the wrong energy/strength charm!
» TiaSusi - What she's wrong?
» TMNT NECA series with wrong head, rare?

Permissions in this forum:You cannot reply to topics in this forum
Clan TMMM :: Warcraft 3 :: WC3 Tutorials and Help-
Jump to: