Chili exploration - Page 2

Chili exploration

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

Moderator: Moderators

EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: UI how to start ?

Post by EatMyShrapnel »

ok always caps problem i renamed :
  • Controls
    Handlers
    Skins
    Headers
    Themes
in
  • /home/user/.spring/LuaUI/Widgets/chili
some chili stuff works some other don't :

Code: Select all

[f=0001499] Loading:  LuaUI/Widgets/gui_chili_facbar.lua
[f=0001499] false
[f=0001499] Error in Initialize(): [string "LuaUI/Widgets/gui_chili_facbar.lua"]:281: attempt to call field 'GetBuildIconFrame' (a nil value)
[f=0001499] Removed widget: Chili FactoryBar
[f=0001593] Loading:  LuaUI/Widgets/gui_chili_minimap.lua
[f=0001593] false
[f=0001593] Error in Initialize(): [string "LuaUI/Widgets/gui_chili_minimap.lua"]:125: attempt to index field 'crude' (a nil value)
[f=0001593] Removed widget: Chili Minimap
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: UI how to start ?

Post by EatMyShrapnel »

I found a way to work ChiliFactory Bar by replacing

Code: Select all

file2 = WG.GetBuildIconFrame(ud),
with

Code: Select all

file2 = 'LuaUI/Images/nested_buildmenu/frame_Fac.png',
in gui_chili_facbar.lua like someone did in gui_chili_radial_buildmenu.lua

i commented from line 120 to line 126 in gui_chili_minimap.lua and Chiliminimap works but not properly :
Image
As you can see I don't have comands menu...
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: UI how to start ?

Post by luckywaldo7 »

You will need a lot of stuff from 'zk/LuaUI/Images', maybe just copy the whole folder maybe to (You will probably end up using mostly your images in the end anyway).

There is also some necessary files in 'zk/LuaUI/Configs', just take whatever mentions chili.

Not things needed by the chili framework itself but by the various chili widgets that zk packages.
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: UI how to start ?

Post by EatMyShrapnel »

i think you right, moreover after scrolling in infologs, i saw that i need luarules too. Now I have other errors... well i take a break! :mrgreen: horror movie & coffee time
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: UI how to start ?

Post by EatMyShrapnel »

Well, i just saw that some lua files use a directory called images and some other use a directory called Images such things should not hapen! I know that windows don't take care about sensitive but linux does! so you should take a decision about caps or not and respect it every where.
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: UI how to start ?

Post by EatMyShrapnel »

EatMyShrapnel wrote:I found a way to work ChiliFactory Bar by replacing

Code: Select all

file2 = WG.GetBuildIconFrame(ud),
about that i just read :

Code: Select all

NOTE FOR OTHER GAME DEVS:
	ZK uses WG.GetBuildIconFrame to draw the unit type border around buildpics.
	If you're not using them (likely), remove all lines containing that function.
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: Chili exploration

Post by EatMyShrapnel »

many things works now :
Image
I had to change several stuffs.

Now I have some problem with tooltip if someone can explains to me what do these lines in gui_chili_tip.lua:

Code: Select all

local function GetUnitIcon(ud)

	if not ud then return false end

	return icontypes 

		and	icontypes[(ud and ud.iconType or "default")].bitmap

		or 	'icons/'.. ud.iconType ..iconFormat

end
that can maybe help me. Here the error msg in infologs.txt :

Code: Select all

[f=0040418] Loading:  LuaUI/Widgets/gui_chili_selections_and_cursortip.lua
[f=0040566] false
[f=0040566] Error in Update(): [string "LuaUI/Widgets/gui_chili_tip.lua"]:872: attempt to index field '?' (a nil value)
[f=0040566] Removed widget: Chili Cursor Tip 3
Other problem, when I start the game some chili widgets are in yellow in the widget selector, if i click on to activate them they works. In infologs.txt I have no information about any error or stop. They appear loaded at the start in infolog.txt
another coffee & horror movie break
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: Chili exploration

Post by luckywaldo7 »

That looks like it gets the strategic icon of the unit to use in the tooltip:
screen00032.png
screen00032.png (70.74 KiB) Viewed 4406 times
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: Chili exploration

Post by EatMyShrapnel »

thx, with your help i fixed the problem :
Image

when I start the game some chili widgets are in yellow in the widget selector, if i click on to activate them they works. In infologs.txt I have no information about any error or stop. They appear loaded at the start in infolog.txt. I did some interesting test :
if I load any chili widget before Chili framework, the widget don't work, this is correct. I think I have to load the framework beofre any widget, but I don't know how to do that
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Chili exploration

Post by jK »

EatMyShrapnel wrote:when I start the game some chili widgets are in yellow in the widget selector, if i click on to activate them they works. In infologs.txt I have no information about any error or stop. They appear loaded at the start in infolog.txt. I did some interesting test :
if I load any chili widget before Chili framework, the widget don't work, this is correct. I think I have to load the framework beofre any widget, but I don't know how to do that
That's why chili needs currently a modified widgetHandler. Chili defines `api=true` in its GetInfo() and CA/ZK's widgetHandler loads those before all others.

(BTW the new widgetHandler will support a much more selective dependency method, similar to the one in gentoo's init.d scripts)
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: Chili exploration

Post by EatMyShrapnel »

I see :

Code: Select all

[f=0000000] Loaded API widget:  Shared Functions    <api_shared_functions.lua>
[f=0000000] Loaded API widget:  Modular Comm Info   <api_modularcomms.lua>
[f=0000000] Loaded API widget:  Chili Framework     <api_chili.lua>
[f=0000000] Loaded API widget:  Lups                <lups_wrapper.lua>
[f=0000000] Set UnitIconDist to 250
[f=0000000] Ground decals are enabled
[f=0000000] Advanced shading enabled
[f=0000000] Set maximum particles to: 20000
[f=0000000] Loaded widget:  EPIC Menu           <gui_epicmenu.lua>
but infologs doesn't tell me from which file you specify to load the framework before other widget. I tried to find api_chili.lua in any file but I failed. So please tell me how to say to spring to load the framework before widget
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Chili exploration

Post by jK »

I did.
EatMyShrapnel
Posts: 31
Joined: 25 Jun 2010, 20:16

Re: Chili exploration

Post by EatMyShrapnel »

if you mean i have to add api=true, it's already did since i copied the files from ZK, but that's not solve my problem. Maybe my english skill isn't good enough, so tell me more.

where can I follow the work on the new widget handler ? where can I get information on it, (like a doxygen). It's painfull to explore chili, no documentation, no readme, and as I said you must respect the sensitive case of files and folders names for linux users.
sunspot
Posts: 104
Joined: 09 Jun 2011, 12:17

Re: UI how to start ?

Post by sunspot »

EatMyShrapnel wrote:Guys,

first, please give me a link where I can found this ChiliUI. Even S44 don't want chili, for me that's can be a good start to see how stuff works. I search how to start an UI, I found threads related to ICEui, here people said forget it and use Chili, now you speak about new widgethandler.

second, tell me more about the new widgethandler, where i can get information, like a TODO, where i can get documentation how to use it (Doxygen or something like),...

third, it would be cool for people who can to write tutorials in the wiki :
- Hello world
- adding picture
- adding button
- link basic command to a button
- etc.
I'll write a tutorial once I have a firm grasp on how the stuff works i'm almost there !
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Chili exploration

Post by CarRepairer »

Hi. If you want a nice laugh, here is an old version of S44 when it briefly had some really oldskool Chili. Mixed up with some IceUI in there as well.

Image
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Chili exploration

Post by FLOZi »

Makes my eyes cry. Worst thing is, much of it hasn't moved on graphically since then.
sunspot
Posts: 104
Joined: 09 Jun 2011, 12:17

Re: Chili exploration

Post by sunspot »

basic tutorial is written btw

http://springrts.com/wiki/UI:Development
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Chili exploration

Post by smoth »

good on ya sunspot.
sunspot
Posts: 104
Joined: 09 Jun 2011, 12:17

Re: Chili exploration

Post by sunspot »

I've created the final lesson to create buttons for commands hope you find it usefull

http://springrts.com/wiki/UI:Development
Post Reply

Return to “Lua Scripts”