ID:158850
 
Why am I getting an error while trying to clear medals?

var/list/listOfNames = params2list(world.GetMedal());
for(var/name in listOfNames)
world.ClearMedal("Level 60", name, hub_password="asdf")


Error:
runtime error: illegal use of list2args() or named parameters
proc name: Proc ResetHubScores (/proc/Proc_ResetHubScores)

ts
I am taking a wild guess here, but i'm going to say that the bug is somewhere esles in your code, because i cant find list2args() or RsetHubScores() in that code segement you got there.
In response to Neos300
Well, if I comment out the line, it doesn't repro. If I remove the password part, it doesn't error but it doesn't work which I think is expected because I have a password on my hub now.

Note the "illegal use of ... named parameters" part. I suspect that is the problem. I'm running 442.1020.
In response to Tsfreaks
ClearMedal(medal, player, hub=world.hub, hub_password=world.hub_password)

The F1 key is my favorite key.
In response to Neos300
What are you implying? Could you elborate on what I might have done wrong?

hub and hub_password are optional.

ts
In response to Tsfreaks
Oh, woops. I didnt read the full description.

Edit: You should put world.ClearMedals("Medal", usr, , hub_password = "whatever")
In response to Neos300
Actually, in another thread Hobnob and GhostAnime pointed out that named parameters are invalid although the help file makes it seem otherwise.

The best way (at least I believe it to be so) is to specify your hub and password under world.
world
hub = "Tsfreaks.TowerDefense";
hub_password = "asdf";


Then in your hub medal/score calls, you don't need to specify either.

    world.log << world.ClearMedal("Level 60", "JerkWads")


If you wanted to specify them inline, then do so without the named parameters.
    world.log << world.ClearMedal("Level 60", "JerkWads", "Tsfreaks.TowerDefense", "asdf");


If your interested in the other thread.
http://www.byond.com/developer/forum/?id=704777

ts
In response to Tsfreaks
Well then, problem solved.