View topic - I can't get icongenerator to work



All times are UTC + 1 hour


Post new topic Reply to topic  [ 20 posts ] 
Author Message
PostPosted: 25 Apr 2012, 16:37 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
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:
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, 00:53, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 25 Apr 2012, 17:29 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
include("LuaRules/Configs/","icon_generator.lua")

got that file too?


Top
 Offline Profile  
 
PostPosted: 25 Apr 2012, 17:38 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
Yeah, its there.

http://code.google.com/p/evolutionrts/s ... erator.lua

http://code.google.com/p/evolutionrts/s ... erator.lua


Top
 Offline Profile  
 
PostPosted: 25 Apr 2012, 17:43 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
put both files in mah mod, did /luarules buildicons all
:arrow: some error about corrad nil blabla
went to config, replaced unitConfigs= with this:

Quote:
[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


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 03:08 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
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


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 03:29 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
did /luarules buildicons tptank and found this in spring-88.0-release\buildicons\_5to4_64x64:
Image :-)
in infolog it only said:
Quote:
[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.

Quote:
[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..

Quote:
I have tried deleting all other gadgets
not in the posted infolog though..


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 06:26 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
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).


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 08:25 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
http://pastebin.com/pU4d9zue << All units (except commander unit), widgets, and gadgets (except icongenerator) removed.

As you can see... nothing. Wtf is going on?


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 09:12 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
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

--[[
]]--


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 10:58 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
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.


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 16:32 
MC: Legacy & Spring 1944 Developer
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
Toolbox should have a working copy in it

http://spring1944.svn.sourceforge.net/v ... olBox.sdd/


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 16:43 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
put in something like this:
Code:
  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...

Quote:
[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.


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 17:43 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: You are going to die anyway, hurry up and do it.
ALL takes a good while. I usually start it and go eat dinner.


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 18:11 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
seems it is normal to take some time:
Quote:
<[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?)
Quote:
<[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


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 22:33 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
knorke wrote:
put in something like this:
Code:
  function gadget:Initialize()
  Spring.Echo ("IAM HERE")
  end
see if that prints.


infolog wrote:
[f=0000000] IAM HERE


Top
 Offline Profile  
 
PostPosted: 26 Apr 2012, 23:13 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: You are going to die anyway, hurry up and do it.
now walk that echo throughout the code.


Top
 Offline Profile  
 
PostPosted: 27 Apr 2012, 00:52 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
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/


Top
 Offline Profile  
 
PostPosted: 27 Apr 2012, 04:22 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
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


Top
 Offline Profile  
 
PostPosted: 27 Apr 2012, 05:43 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
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.


Top
 Offline Profile  
 
PostPosted: 27 Apr 2012, 06:33 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
Knorke, I've tried replicating what you said you did in many different ways and it still doesn't work. What am i missing?


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.