html-like in-game help widget beta 2 - Page 2

html-like in-game help widget beta 2

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

Moderator: Moderators

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

Post by Forboding Angel »

Quantums is way the heck over the top. THis widget is simple and much mroe along the lines of what I wanted.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

I don't think it's caused by svn version. I checked my code and if you don't call Script.LuaUI.setPageOptions(newOptions), no options are set and voila there's your error. It's a bug in the widget becouse default option should be used if nothing is set. Anyway, easiest way to fix it is calling Script.LuaUI.setPageOptions(nil).
Let me know if it helped.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

I have no idea what that means nor how to fix it :/
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Post by Noruas »

Could someone please fix it?

Where do i find it?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

BigHead wrote: I don't think it's caused by svn version. I checked my code and if you don't call Script.LuaUI.setPageOptions(newOptions), no options are set and voila there's your error. It's a bug in the widget becouse default option should be used if nothing is set. Anyway, easiest way to fix it is calling Script.LuaUI.setPageOptions(nil).*edits* instead of Script.LuaUI.setPageOptions(newOptions)
Let me know if it helped.
he is saying try this.

Either comment out the line:
Script.LuaUI.setPageOptions(newOptions)

or try:
calling Script.LuaUI.setPageOptions(nil). instead of Script.LuaUI.setPageOptions(newOptions)

if that doesn't fix it let him know.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

8)

My English is worse than I've thought.
You need to call
Script.LuaUI.setPageOptions(newOptions or nil)
before
Script.LuaUI.displayPage(page)

setPageOptions can be used to modify widget size, colors, font and many other things.
There are some default options and newOptions override them. If newOptions is nil, nothing is overrided and defaultOptions are used (options = defaultOptions).
However if you don't call setPageOptions method no options are initialized (options = nil) and you get the error.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

I can promise you I cannot speak your language at all. So you are doing better then me bighead!
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

and what file is that line in?

I have looked to no avail
Last edited by Forboding Angel on 02 Dec 2007, 11:44, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

what a smart assed thing to do. You know, it isn't like I refuse to help you all the time. Cute that you posted a whole code block.

I can do that to.

Gui_Example_help.lua

Code: Select all

  Script.LuaUI.setPageOptions(options)
  Script.LuaUI.displayPage("unit-guide/some-unit")
OH LAWD
Last edited by smoth on 02 Dec 2007, 09:08, edited 1 time in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Pastebins people!!!
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Btw this is code for another widget I wrote:

Code: Select all

BFBOC (Big Fucking Block of Code)
Ok, so let's all just edit our posts and make them way shorter 8)
Last edited by BigHead on 02 Dec 2007, 12:35, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

LULZ bighead, I just wanna say you are a cool dude.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

smoth wrote:LULZ bighead, I just wanna say you are a cool dude.
That wasn't from the same file smoth. I posted the code block so that you might be arsed to look at it. I didn't know if you have the widget downloaded or not. Also, If I pastebinned it, would you be arsed to click the link?

Or omg, the widget could be updated on UF so that it works with the current spring version *gasped*!

The lua shit is spring is becoming more and more like the spring code every week. NEEDS MORE DOCUMENTATION!
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Uhm ... could anyone please reupload this widget to UF 8)
Edit: Never mind, it's still there ...

Forboding Angel: Were you able to fix your problem? I think you don't understand how this widget works. It's not a standalone help anymore. It only provides you with API (=functions that you can call) that displays your page. In order to use those functions you must create your own widget. See gui_example_help.lua for that. It's disabled by default so you need to enable it to see it.
The easiest way to display your page is calling:

Code: Select all

Script.LuaUI.setPageOptions(nil)
Script.LuaUI.displayPage(path-to-your-page)
I hope it helps ...
Wasp
Posts: 67
Joined: 06 Feb 2006, 08:36

Post by Wasp »

Forboding, you may want to check this out, the list isn't entirely complete but it has enough to get you going.

C:\Program Files\Spring\LuaUI\API.txt
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

Bighead, thanks for that clarification.

I was under the impression that it was still a stand alone thing, which is why I couldn't find that line. I was looking in the wrong place.

Yes I have fixed the issue, thanks for the help!

@wasp thanks dude. I Have gone over the wiki, but the wiki isn't a guide so much as it is a list, which to someone who doesn't know lua might as well be written in latin.

@smoth I asked a simple question and didn't understand the answer, so I responded with information about what I was looking at. THere is no point to deride me like that. I had no idea what was going on because it hadn't been explained in a manner that I could understand. Not everyone here knows 50 different languages like you (and that prolly isn't much of an exaggeration), so be a little more patient please.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

mods are sleeping. I will do my part.
Last edited by smoth on 03 Dec 2007, 07:50, edited 1 time in total.
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

not fill bigheads thread with drama
Post Reply

Return to “Lua Scripts”