SRL Archive - FAQ

invalid number of parameters fix


janbricky

2012-11-04 08:02:39

Hey all,

i've read a dozen of threads now that show how to solve the invalid number of parameters in the smartparams.simba file. However this doesn't seem to do the trick for me…

I removed the -1 at the end, resulting in:


{$IFDEF SMART8}
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '');
{$ELSE}
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '');
{$ENDIF}

I havent used simba in ages so haven't seen all the changes. I just wanted to try a script, but this way it won't work. Been busy for 1.5 hours now and still getting the error :/

Hope some of you can help me get it working!

P1ng

2012-11-05 08:01:36

You need to change the script to have {$DEFINE SMART8} instead of just {$DEFINE SMART} AFAIK.

janbricky

2012-11-05 10:52:47

From: P1ng
You need to change the script to have {$DEFINE SMART8} instead of just {$DEFINE SMART} AFAIK.


Thanks for the reply,

I did and unfortunately nothing happened :(

edit:

I assume you mean the following piece of code at the top of the file?

{$DEFINE SRL_SMART}
{$DEFINE SMART8}
{$loadlib libsmartremote}

Silentcore

2012-11-05 10:56:37

From: P1ng
You need to change the script to have {$DEFINE SMART8} instead of just {$DEFINE SMART} AFAIK.


Most scripts have
{$DEFINE SMART}

Rezozo

2012-11-05 11:23:31

Don't just remove the -1, you have to remove the last comma and the "" as well.

The problem is the entire parameter for that is wrong. So you have to do this^^^

*Remember to save it as well :p

janbricky

2012-11-05 11:42:51

From: Rezozo
Don't just remove the -1, you have to remove the last comma and the "" as well.

The problem is the entire parameter for that is wrong. So you have to do this^^^

*Remember to save it as well :p


I've tried

Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's','');
Aswell as

Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's');

Tried using both define smart and smart8, but nothing seems to work.

janbricky

2012-11-06 05:04:47

So I think I've found the problem.. after trying alot of combinations with the parameters i decided to actually print result to see what it is on runtime.

the result is:

[Hint] C:\Simba\Includes\SRL/SRL/core/globals.simba(55:3): Variable 'WORLDSWITCHERENABLED' never used at line 54
Compiled successfully in 733 ms.
SRL Compiled in 0 msec
0
** Smart Cannot Spawn Clients **
Successfully executed.
Apparently the 0 is result… which means result never get's initialized… hence the crash on trying to retrieve [0] and [1] of result, as it's not an array.
I've tried to go with a clean install but same problem again.
Running as admin / normal program doesn't help either.

Anyone knows what to try now?

Ashaman88

2012-11-06 07:04:33

Try doing the steps on the last few posts on my Sally hunter thread!

Master BAW

2012-11-06 07:20:32

i have this at the top of my file: both smart and smart8 defined… :) That's the way

  {$DEFINE SMART} // This is how we include SMART
{$DEFINE SMART8} // This is how we include SMART
{$i SRL\SRL.simba} // includes all main functions
{$i SRL/SRL/misc/SmartGraphics.simba}// PaintSmart for the Paint!

janbricky

2012-11-07 11:28:42

From: Master BAW
i have this at the top of my file: both smart and smart8 defined… :) That's the way

  {$DEFINE SMART} // This is how we include SMART
{$DEFINE SMART8} // This is how we include SMART
{$i SRL\SRL.simba} // includes all main functions
{$i SRL/SRL/misc/SmartGraphics.simba}// PaintSmart for the Paint!


If I include those at the top of my file i get other errors with duplicate values (thus it loads the same stuff twice) and if i only use those params you provide i get errors like:

Exception in Script: Too many nested include files while processing 'SRL\SRL.simba' from 'C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba'

All i'm using at the moment at the top of my smartparams.simba file is:

{$DEFINE SRL_SMART}
{$DEFINE SMART}
{$DEFINE SMART8}
{$loadlib libsmartremote}

the params array is filled as i used the lines giving output:


WriteLn(params[0]);
WriteLn(params[1]);

If i follow rezozo's advice i should use


Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's');


So after i did all this i still get the error that the number of parameters don't match… I've got no clue what happened to simba but 7-8 months ago it was plug & play… I don't turn down some anti leech coding as i am not unfamiliar with codez but this is a little too far (if it's the anti leech at all)…

Btw @ashaman88 which posts do you mean? i read pages 55 54 53 and 52 but all i can find is people qq'ing about their traps disappearing and/or other errors.

Dgby714

2012-11-07 12:29:48

From: janbricky
If I include those at the top of my file i get other errors with duplicate values (thus it loads the same stuff twice) and if i only use those params you provide i get errors like:

Exception in Script: Too many nested include files while processing 'SRL\SRL.simba' from 'C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba'

All i'm using at the moment at the top of my smartparams.simba file is:

{$DEFINE SRL_SMART}
{$DEFINE SMART}
{$DEFINE SMART8}
{$loadlib libsmartremote}

the params array is filled as i used the lines giving output:


WriteLn(params[0]);
WriteLn(params[1]);

If i follow rezozo's advice i should use


Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's');


So after i did all this i still get the error that the number of parameters don't match… I've got no clue what happened to simba but 7-8 months ago it was plug & play… I don't turn down some anti leech coding as i am not unfamiliar with codez but this is a little too far (if it's the anti leech at all)…

Btw @ashaman88 which posts do you mean? i read pages 55 54 53 and 52 but all i can find is people qq'ing about their traps disappearing and/or other errors.


  1. Ok, reset your SRL back to no edits. With the updater you can do this with an Override, look for it in the menu.
  2. Make sure you are using SMART8. Link, SMART8 does NOT come with the plugins updater, you must manually install it.
  3. Add the SMART8 define with the SMART define, you currently need both. This will soon change to only needing SMART8.

You should not have made any edits to any files doing this.

Ashaman88

2012-11-07 12:31:48

From: janbricky
If I include those at the top of my file i get other errors with duplicate values (thus it loads the same stuff twice) and if i only use those params you provide i get errors like:

Exception in Script: Too many nested include files while processing 'SRL\SRL.simba' from 'C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba'

All i'm using at the moment at the top of my smartparams.simba file is:

{$DEFINE SRL_SMART}
{$DEFINE SMART}
{$DEFINE SMART8}
{$loadlib libsmartremote}

the params array is filled as i used the lines giving output:


WriteLn(params[0]);
WriteLn(params[1]);

If i follow rezozo's advice i should use


Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's');


So after i did all this i still get the error that the number of parameters don't match… I've got no clue what happened to simba but 7-8 months ago it was plug & play… I don't turn down some anti leech coding as i am not unfamiliar with codez but this is a little too far (if it's the anti leech at all)…

Btw @ashaman88 which posts do you mean? i read pages 55 54 53 and 52 but all i can find is people qq'ing about their traps disappearing and/or other errors.


http://villavu.com/forum/showthread.php?p=1123202#post1123202

Dgby714

2012-11-07 12:36:29

From: Ashaman88
http://villavu.com/forum/showthread.php?p=1123202#post1123202


Ok, Yes, you do need the 32bit Java, but there is no reason to uninstall the 64bit one.

You also need the 32bit one in your system's PATH.


Path to Java on a 32bit Windows: C:\Program Files\Java\jre(Version)\bin
Path to Java on a 64bit Windows: C:\Program Files (x86)\Java\jre(Version)\bin

janbricky

2012-11-09 15:57:38

From: Dgby714
  1. Ok, reset your SRL back to no edits. With the updater you can do this with an Override, look for it in the menu.
  2. Make sure you are using SMART8. Link, SMART8 does NOT come with the plugins updater, you must manually install it.
  3. Add the SMART8 define with the SMART define, you currently need both. This will soon change to only needing SMART8.

You should not have made any edits to any files doing this.


This appeared to did something good, when running the barb fisher of flight i'm not getting any error anymore about smart params :)

All i'm getting now is a

[Error] C:\Simba\Scripts\BarbFlyFisher(1.72).Simba(140:5): Unknown identifier 'AL_SetMouseSpeed' at line 139
But that's something related to the script, so cheers for the help all! Glad to see the comunity hasn't changed.