lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I have a chunk of lua source here that refuses to run as it stands. What I can't understand is, why?

<x-tad-smaller>units_materialcolors_human = D3DMATERIAL8:new() </x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller> // Our toLua code sets up D3DCOLORVALUE as you would expect as well. </x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller> units_materialcolors_human.Ambient.r = 1.0 </x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller> units_materialcolors_human.Ambient.g = 1.0 </x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller> units_materialcolors_human.Diffuse.r = 1.0 </x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller> units_materialcolors_human.Diffuse.g = 1.0 </x-tad-smaller><x-tad-smaller>

This code works perfectly in almost every lua sourcefile I put it in. Except for two, and one of them I cannot change. It gives me this error:
[string ""]:5: attempt to index field `Diffuse' (a nil value)

Anyone heard of something odd like this? I know the basic ability works, but only if I rearrange the whole thing so there is only one redirection (units_materialcolors_human.Diffuse = tempColor) does it finally start working.

This code runs perfectly in Windows, but my Mac install fails. I'm using toLua 5.0 and Lua 5.0 (also tried 5.0.2).

Help! :^)

- Dennis

iChat: DrakkenWulf1 (AIM)