Question

import EternalDungeon
import System.Collections

static def PlayerActivate():
    for x in range(ED.Mobs.Count):
        if ED.Mobs(x).Pos == ED.player.SpaceInFront():
            ED.Mobs(x).OnHit(ED.Sword)
            break

When this is compiled, I get the error

BCE0077: It's not possible to invoke an expression of type 'System.Collections.Generic.List'1[[EternalDungeon.Mob, Eternal Dungeon, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=null]]

At (6,15) and (7,16). In C# I include assemblies like so, which is probably wrong and wierd:

        compiler.Parameters.References.Add(Assembly.LoadFile(Directory.GetCurrentDirectory() + @"\Eternal Dungeon.exe";));
        compiler.Parameters.References.Add(Assembly.GetAssembly(typeof(System.Collections.Comparer)));

Any help is appreciated, and I'm rather new to both Boo and 'Assemblies'. Thanks in advance.

Was it helpful?

Solution

Solved the problem myself, I confused lists for arrays,

    if ED.Mobs(x).Pos == ED.player.SpaceInFront():

Changes to

    if ED.Mobs[x].Pos == ED.player.SpaceInFront():
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top