REQ: Wind Speed

REQ: Wind Speed

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

Moderator: Moderators

User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

REQ: Wind Speed

Post by Jazcash »

Could somebody make a small and simple widget which displays the current wind speed? Would be much appreciated so then I know when to go in for the pow pow with mai Com.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: REQ: Wind Speed

Post by bobthedinosaur »

EDIT: I wish I knew what I was talking about.
Last edited by bobthedinosaur on 19 Jan 2010, 05:50, edited 1 time in total.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: REQ: Wind Speed

Post by Beherith »

Spring.GetWind

( ) -> number dirX, number dirY, number dirZ,
number strength, number normDirX, number normDirY, number normDirZ
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: REQ: Wind Speed

Post by manolo_ »

do u mean the current energy output made by a windmill (if yes look at iceui and windcheck ) or the windspeed (?)
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: REQ: Wind Speed

Post by Jazcash »

manolo_ wrote:do u mean the current energy output made by a windmill (if yes look at iceui and windcheck ) or the windspeed (?)
That's the average guess at the game start. I want a widget which shows the windspeed all the through the game updating in time with the windmills.
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: REQ: Wind Speed

Post by Pako »

If it's worth doing it's worth overdoing.

name = "Wind Helper",
desc =
Shows wind info and when to build wind.
The next wind vector turning point displays the immediate wind forecast.
Forecast text tells the forecast from integrated winds.
(current economy and wind mean affects what to build but not the forecasts)

The next spring version will break this widget.

Image
Image
Last edited by Pako on 19 Jan 2010, 17:13, edited 2 times in total.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: REQ: Wind Speed

Post by Jazcash »

Very nice, I like it. Although, my GUI is chunked up already with stuff so I'd appreciate just the figure of current windspeed with maybe a pic of a windmill next to it to indicate what it is.

If you want to make it more cool an all, making it moveable, resizeable and recolourable would be awesome :lol:
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: REQ: Wind Speed

Post by manolo_ »

upload it to widgetdb (marked as hidden)
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: REQ: Wind Speed

Post by JohannesH »

If you dont want to clog the interface an option is to just group 1 windmill to somewhere like 8-0, then checking it is just 1 keypress away. And its easy to ctrl-z from there to see your overall windmill count which is useful too.
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: REQ: Wind Speed

Post by Pako »

Of course it must be moveable, resizeable and recolourable, why didn't I think of that.

(recolour by scrolling over the resize button)
Last edited by Pako on 20 Jan 2010, 23:58, edited 1 time in total.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: REQ: Wind Speed

Post by Jazcash »

Again, a simple version with just the wind speed would be more fitting for me. Here, I even made an icon for you'z :P

Image
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: REQ: Wind Speed

Post by KaiserJ »

8) cool.

i often wished for this but imagined it too trivial to ask for.
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: REQ: Wind Speed

Post by Pako »

JAZCASH wrote:Again, a simple version with just the wind speed would be more fitting for me. Here, I even made an icon for you'z :P

Image
Just add following code to any widget that doesn't have widget:DrawScreen() function.

Code: Select all

function widget:DrawScreen()
gl.Color(1,1,1,1)
gl.Texture('LuaUI/Images/Windmill.png')
gl.TexRect(100,100,111,111)
gl.Texture(false)
local _,  _,  _,  wind = Spring.GetWind()
gl.Text(wind, 100, 100, 14, "ao")
end
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: REQ: Wind Speed

Post by Jazcash »

Pako wrote:
JAZCASH wrote:Again, a simple version with just the wind speed would be more fitting for me. Here, I even made an icon for you'z :P

Image
Just add following code to any widget that doesn't have widget:DrawScreen() function.

Code: Select all

function widget:DrawScreen()
gl.Color(1,1,1,1)
gl.Texture('LuaUI/Images/Windmill.png')
gl.TexRect(100,100,111,111)
gl.Texture(false)
local _,  _,  _,  wind = Spring.GetWind()
gl.Text(wind, 100, 100, 14, "ao")
end
Exactly what I wanted but with one decimal place instead of 13 or so :P Also, the windmill icon to the left of the text instead of above it would be epic winrar. Thanks for such win :-)
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: REQ: Wind Speed

Post by lurker »

I'm sure you can manage to adjust the locations yourself. To make it one decimal place, change the text line's 'wind' to 'string.format("%.1f",wind)'.
User avatar
Spawn_Retard
Posts: 1248
Joined: 21 Dec 2006, 14:36

Re: REQ: Wind Speed

Post by Spawn_Retard »

Pako wrote:If it's worth doing it's worth overdoing.

name = "Wind Helper",
desc = "Shows wind info and when to build wind.
The next wind vector turning point displays the immediate wind forecast.
Forecast text tells the forecast from integrated winds.\n(current economy and wind mean affects what to build but not the forecasts)",
Image
This widget is sex.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: REQ: Wind Speed

Post by smoth »

it is not going to BREAK anything, you just need to adjust your equation.
User avatar
Spawn_Retard
Posts: 1248
Joined: 21 Dec 2006, 14:36

Re: REQ: Wind Speed

Post by Spawn_Retard »

Pako wrote:If it's worth doing it's worth overdoing.

name = "Wind Helper",
desc =
Shows wind info and when to build wind.
The next wind vector turning point displays the immediate wind forecast.
Forecast text tells the forecast from integrated winds.
(current economy and wind mean affects what to build but not the forecasts)

The next spring version will break this widget.

Image
Image
please fix it so it wont break!

your widget is goddly.
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: REQ: Wind Speed

Post by Pako »

Spawn_Retard wrote: please fix it so it wont break!

your widget is goddly.
I'll see how the winds are blowing in few months from now and maybe fix then(I'm not sure how BA will accept so major change and developers aren't very sensitive for fixing things either).

Immediate wind forecast will be broken anyway because the wind change vector will be curved so the turning point would be too hard to detect.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: REQ: Wind Speed

Post by Jazcash »

Some graphical effects of wind would be nice. Like particles blowing into wind direction or maybe plasma blown by 0.009%.
Post Reply

Return to “Lua Scripts”