I can't get icongenerator to work

I can't get icongenerator to work

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

I can't get icongenerator to work

Post by Forboding Angel »

http://code.google.com/p/zero-k/source/ ... erator.lua

I go ingame with nullai and do /luarules buildicons all without cheats and get no response (no response from "buildicon" either).

According to

Code: Select all

function gadget:RecvLuaMsg(msg, playerID)
    if (msg:find("buildicon",1,true)) then
      if (not Spring.IsCheatingEnabled()) then
        Spring.SendMessageToPlayer(playerID, "Cheating must be enabled");
It should at least report that cheats aren't enabled.

Obviously, with cheats on the results are no different.

Infolog reports no errors.

Any ideas?

http://code.google.com/p/evolutionrts/source/browse/
Last edited by Forboding Angel on 27 Apr 2012, 01:53, edited 1 time in total.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I can't get icongenerator to work

Post by knorke »

include("LuaRules/Configs/","icon_generator.lua")

got that file too?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I can't get icongenerator to work

Post by knorke »

put both files in mah mod, did /luarules buildicons all
:arrow: some error about corrad nil blabla
went to config, replaced unitConfigs= with this:
[UnitDefNames.tptank.id] = { --some unit in mah mod
scale = 3,
rot = 200,
clamp = 10,
},
now it complains about some missing background image.

probally it will want this too later on:
--// faction colors (check (and needs) LuaRules/factions.lua)

anyway, it "does stuff" though to properly work it needs more files.
dunno why it does nothing for you, either you did not notice the errors in infolog or something steals your /luarules message
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

I have tried deleting all other gadgets, and all other widgets in the hopes that maybe something was stealing the luarules message, but no dice.

It doesn't error knorke. It loads and then does nothing.

Infolog: http://pastebin.com/5E1cdFP4

Unfortunately the infolog doesn't record the commands I give.

/luarules buildicons all
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I can't get icongenerator to work

Post by knorke »

did /luarules buildicons tptank and found this in spring-88.0-release\buildicons\_5to4_64x64:
Image :-)
in infolog it only said:
[f=0000232] Cheating is enabled!
[f=0000968] Warning: Couldn't find texture "LuaRules/Images/IconGenBkgs/bg_ground.png"!
[f=0001234] offlinetester paused the game
so it does not talk much.

i only did whats written in previous post + copy in (accidently the wrong :roll: ) background image.
[f=0000000] Failed to load: chickens_unit_spawner_defense.lua ([string "LuaRules/Gadgets/chickens_unit_spawner_defe..."]:277: attempt to index field 'difficulties' (a nil value))
dunno..
I have tried deleting all other gadgets
not in the posted infolog though..
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

I also tried emptying out all widgets. No dice

No reason to post those infologs because they were the same thing as the above really (minus the widgets/gadgetry being loaded).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

http://pastebin.com/pU4d9zue << All units (except commander unit), widgets, and gadgets (except icongenerator) removed.

As you can see... nothing. Wtf is going on?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I can't get icongenerator to work

Post by knorke »

put in some echos:
quickly looking at it it is not supposed to print anything when it works...

what are all those changes you made?
comments should be like
--[[
--]]

not

--[[
]]--
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

in lua

--[[
This is a block comment
This comment spans multiple lines
]]--

--This is a line level comment
--Line level comments only span one line

--]] Would result in a line level comment.

Also, doesn't really matter what is in the config, I've tried it a billion different ways.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: I can't get icongenerator to work

Post by FLOZi »

Toolbox should have a working copy in it

http://spring1944.svn.sourceforge.net/v ... olBox.sdd/
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I can't get icongenerator to work

Post by knorke »

put in something like this:

Code: Select all

  function gadget:Initialize()
  Spring.Echo ("IAM HERE")
  end
see if that prints.

Also look for that buildicons\_5to4_64x64\ folder.
When I got it working it just created the icons there, without any message at all. (was a bit surprised)
infolog wrote:[f=0000340] Cheating is enabled!
So if you now test with cheating all the time, it will never print anything but maybe it already outputs files.

Beside that, no idea. The version from zK you linked worked for me and further than that I can only guess...
[f=0000000] Loaded gadget: IconGenerator <unit_icongenerator.lua>
[f=0000000] Loaded gadget: IconGenerator <unit_icongenerator.lua>
Why is this double? (some other messages too)

comments:
Both is correct synthax.
Well actually it is
--[[
]]
but there is a useful trick that does not work with ]]-- or ]]
http://www.lua.org/pil/1.3.html
Anyway, that was just funfact :-)


Btw, how long is it supposed to take with /luarules buildicons all ?

/luarules buildicons unitname is almost instant, but now it is hanging spring since 2 minutes and only two icons have appeared so far. Does not seem right?
(i guess from spring hanging you can also tell it is working, though some message would be better)
/edit:
~7 minutes for 54 icons, then spring closed and infolog was cut off. hm.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: I can't get icongenerator to work

Post by smoth »

ALL takes a good while. I usually start it and go eat dinner.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I can't get icongenerator to work

Post by knorke »

seems it is normal to take some time:
<[LCC]jK> icongen renders more than 1 image per icon
(it tries to center icon etc.)
gen CA buildicons could take upto 1h btw
if spring closes before it is done: (because it hangs too long or something?)
<[LCC]jK> might be not such a bad idea to use the `new` Spring.ResetWatchdog() func
<[2up]knorke> just insert it somewhere in loop?
<[LCC]jK> yup just add Spring.ClearWatchDogTimer() somewhere in the loop
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

knorke wrote:put in something like this:

Code: Select all

  function gadget:Initialize()
  Spring.Echo ("IAM HERE")
  end
see if that prints.
infolog wrote:[f=0000000] IAM HERE
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: I can't get icongenerator to work

Post by smoth »

now walk that echo throughout the code.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

The problem is that it isn't even receiving the /luarules message. That is the very first part of it, so of course if it doesn't receive the message it won't do anything.

Something else is apparently snatching it. I don't understand it though, because whatever is doing it is not a widget or a gadget as I ahve tried removing all widgets and gadget from the game (save the icongenerator).

Now I'm reaching... could it be the custom handlers? (gadget/widget)

1 Million cookies to whoever figures this out :-/ I have tried everything I can think of.

http://code.google.com/p/evolutionrts/source/browse/
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I can't get icongenerator to work

Post by knorke »

i check-check-checked it out and yes its one/some of the files in LuaRules\ cba to see which one.
deleted all the files in LuaRules\ and replaced with the ones from my mod and then it worked.
Image
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

Thanks knorke. I did more or less the same thing, but I must not have done it right. I was relying on the engine stuff to replace the important bits and I think I probably just messed up. I'll try again.

I was able to transplant parts of evo into toolbox well enough so that I could get new buildpics, but for a lot of reasons I need it working in evo properly.

http://www.wiki.evolutionrts.info/doku. ... :factories

I'll report back when I figure out what is blocking it.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: I can't get icongenerator to work

Post by Forboding Angel »

Knorke, I've tried replicating what you said you did in many different ways and it still doesn't work. What am i missing?
Post Reply

Return to “Game Development”