Jump to content

Compile error help


Magnusen2

Recommended Posts

I trying to implement a MCM on my mod. But every time i try to compile a get lots of errors with the following:

"Too many arguments passed to function"

 

Is it because of too many stuff on the event? I have about 1095 lines on a OnOptionSelect MCM event. Almost all of the lines are like this:

 

 

 

elseif xxxFemaleChanceGlobal.GetValue() == 25
WEAssassinSubChar.Revert()
WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1, 1)
WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1, 1)
WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1, 1)
WEAssassinSubChar.AddForm( zxxxLCharNewNPCs, 1, 1)

 

 

 

I removed 464 lines and the error still persists.

Anyone knows why this is happening?

 

EDIT: Fixed it by removing the extra 1 at the end. I thought that two numbers were needed, one for the level and other for the count. My bad.

 

But now there's another error:

 

 

 

GlobalVariable Property xxxFemaleChanceGlobal Auto
int _FemaleRatio



event OnPageReset(string page)
    ;{Called when a new page is selected, including the initial empty page}
	SetCursorFillMode(TOP_TO_BOTTOM)
	
	;sets what appears when no page is selected
	If page == ""
		LoadCustomContent("logo.dds")
		Return
	Else
		UnloadCustomContent()
	EndIf
	
	if page == "$xxxPageMain"
		SetCursorFillMode(LEFT_TO_RIGHT)
		AddHeaderOption("Female ratio")
		_FemaleRatio = AddSliderOption("Female Ratio", xxxFemaleChanceGlobal)
		

 

 

 

"Type mysmatch on parameter 2 <did you forget a cast?>"
"Type mysmatch while assigning to a int <cast missing or types unrelated>"

Both at the last line.

 

Any help on this?

Edited by Magnusen2
Link to comment
Share on other sites

FormLists only have one entry: GemList.AddForm(Diamond)

LeveledActor has two entries: CoolActors.AddForm(Turtle, 5)

LeveledItem has three entries: CoolItems.AddForm(Axe, 5, 2)

LeveledSpell has two entries: CoolSpells.AddForm(Fireball, 5)

 

Based upon the use of Char in your list and form to add, I'm guessing that you intend to use the LeveledActor version of AddForm. If that is the case, you have one too many entries being passed into the AddForm function. That would explain the compiler error.

Link to comment
Share on other sites

"Too many arguments passed to function" ...

 

MyFunction( 1, 2, 3, 4) ; syntax error - Too few arguments passed to function

MyFunction( 1, 2, 3, 4, 5)

MyFunction( 1, 2, 3, 4, 5, 6) ; syntax error - Too many arguments passed to function

 

; 5 arguments: intengers n1 - n5

;----------------------------------------------------------------

Function MyFunction( int n1,int n2,int n3,int n4, int n5)

;

; code

;

EndFunction

Link to comment
Share on other sites

The first issue i fixed some minutes after posting by removing the second number. The second one was solved by replacing the code in my first post with:

if page == "$SDO_Page1"
		float FemaleRatio = xxxFemaleChanceGlobal.GetValue()
		AddHeaderOption("")
		_FemaleRatio = AddSliderOption("$SDO_FemaleRatio", FemaleRatio as int)
		

Hope this helps other people.

Thanks to those that posted.

 

EDIT: The code below also works

		_FemaleRatio = AddSliderOption("$SDO_FemaleRatio", xxxFemaleChanceGlobal.GetValueInt())

Edited by Magnusen2
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...