absolutely stumped.

absolutely stumped.

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Locked
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

absolutely stumped.

Post by smoth »

Code: Select all

	local colorSets			= {}
	
	for colorSetName,vals in pairs(colors) do
			.  .  .
			.  .  .
			argbName	=	vals.name .. "_argb"
			colorSets["turquoise_argb"] = 20--ARGBMe(currentColor)

			Spring.Echo(argbName, colorSets[argbName])

		end
	end
	Spring.Echo(colorSets["turquoise_argb"])
when I am at vals.name = turquoise in my color loop:

Code: Select all

	Spring.Echo(argbName, colorSets[argbName])
results in:
[f=0001945] turquoise_argb, 20

Code: Select all

	Spring.Echo(colorSets["turquoise_argb"]) 
results in:
[f=0001945] TABLE:

it stands to reason that after my loop, the same string should result in 20 but it does not. What am I missing?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: absolutely stumped.

Post by smoth »

Best guess, I had some auto generated tables that did something close to cubing my total table. Seems like that was too much for lua.. so yay table limits.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: absolutely stumped.

Post by gajop »

smoth wrote:Best guess, I had some auto generated tables that did something close to cubing my total table. Seems like that was too much for lua.. so yay table limits.
What do you mean by cubing it? Were you changing all values by cubing them or were you modifying the table size? (Can you post your code?)

Btw, can you also post table.echo(colorSets["turquoise_argb"]) instead of Spring.Echo at last Spring.Echo? (use savetable.lua)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: absolutely stumped.

Post by smoth »

I was adding light and dark varients for each color along with ARGB and RGBA alternatives etc. (I was not being precise when I said cubed I was just tired and needed a stupid multiple because I was tired and pissed off, in truth it is more like Colorcount*4*(2 to 3)


I was doing sloppy table work and plan on making this thing LESS nested in the near future
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: absolutely stumped.

Post by knorke »

Colorcount*4*(2 to 3)
If you have 100 colors that is only 100*4*8 = 3200

imo it is unlikely to make something that is "too much for Lua" (or other language) usually there is error in own code.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: absolutely stumped.

Post by smoth »

Can't really fuck up var = 20
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: absolutely stumped.

Post by Satirik »

smoth wrote:What am I missing?
pasting the whole code not just part of it
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: absolutely stumped.

Post by smoth »

Satirik wrote:
smoth wrote:What am I missing?
pasting the whole code not just part of it
Useless reply is useless. Still a douche I see, glad to see you still pop by to start shit with me.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: absolutely stumped.

Post by knorke »

Satirik is right though, with posted information it is not possible to tell what is wrong.
Since smoth says he does not have that code anymore there is nothing to debate -> close.
Locked

Return to “Lua Scripts”