Release: Picture-in-Picture

Release: Picture-in-Picture

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

Moderator: Moderators

User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Release: Picture-in-Picture

Post by Niobium » 06 Nov 2010, 09:52

Download link can be found here: http://widgets.springrts.de/index.php#180

[Screenshot]

Description (from link):
Provides a picture-in-picture type window that shows a location on the map and the units at that location.

In addition it allows you to control the units within the window, so you could for example watch and manage your base while simultaneously watching and microing your frontline (the primary focus of the widget).

What it does:
- Draws units and features
- Allows selection of units within window
- Supports most commands (issued onto the window or units within)
- Draws command queues within window (with shift held)
- Many miscellaneous toggles on buttons; tracking units, switching current view with pip view, drawing only blobs (for far zoom or slow computers), and some other things.

What it doesn't do:
- Anything advanced, i.e. custom formations, projectiles, selection rectangles etc. The goal of the widget is not to perfectly replicate spring, just simple viewing and minor unit management like queuing within a base.

What this thread is for:
- Comments, bugs, ideas for improvement, etc.
0 x

User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium » 06 Nov 2010, 10:07

One issue that I assume is really easy to solve is that I'm not able to remove the 'perspective' from :DrawScreen, in that translations in the z direction (in and out of the screen) cause the drawn unit to shift around in x/y depending on location of the window.

What I'm after is a top-down view everywhere (such that z translation does nothing), which would fix some of the minor oddities that exist atm.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Release: Picture-in-Picture

Post by knorke » 06 Nov 2010, 10:17

on enabling the widget spring hangs for 2 seconds then crashes:
http://pastebin.ca/1983496

/e
it also crashes when enabling the widget before a unit was spawned
Last edited by knorke on 06 Nov 2010, 10:42, edited 1 time in total.
0 x

User avatar
hoijui
Former Engine Dev
Posts: 4342
Joined: 22 Sep 2007, 09:51

Re: Release: Picture-in-Picture

Post by hoijui » 06 Nov 2010, 10:36

translated knorkes stack-trace. was not able to attach to forum thread, cause it is evil HTML (renaming to .txt neither works):
http://pastebin.com/jwCE2MiJ
0 x

User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium » 06 Nov 2010, 10:42

Code: Select all

for fDefID, fDef in pairs(FeatureDefs) do
    local fRad = fDef.radius
end
The above code alone causes spring to crash... (specifically the .radius line)
0 x

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

Re: Release: Picture-in-Picture

Post by Jazcash » 06 Nov 2010, 10:56

Very good idea, when this works I'll try it out and hopefully use it in place of my minimap or something seeing as I pretty much never use the minimap anyway.
0 x

User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium » 06 Nov 2010, 11:10

Updated widget to v1.1 with workaround for Spring crash in XTA.
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

Re: Release: Picture-in-Picture

Post by Beherith » 06 Nov 2010, 11:35

This is absolutely fucking amazing!
Thank you very much for it.
0 x

Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Re: Release: Picture-in-Picture

Post by Chojin » 06 Nov 2010, 13:42

Agreed! Very cool :)

There is some shifting of map & units at the moment. See this screenshot and compare the metal spot in the PIP to the real location on the main view: http://spring.develz.org/stuff/screensh ... _metal.png
0 x

User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium » 06 Nov 2010, 14:43

Chojin wrote:Agreed! Very cool :)

There is some shifting of map & units at the moment. See this screenshot and compare the metal spot in the PIP to the real location on the main view: http://spring.develz.org/stuff/screensh ... _metal.png
What map is that? In my testing I haven't been able to get things out of alignment. In addition, the button textures aren't transparent..
0 x

Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Re: Release: Picture-in-Picture

Post by Chojin » 06 Nov 2010, 16:40

Oh, right, not transparent - didn't see that yet. First I thought the rescaling of the screenshot messed it up, but here is a plain screenshot:
http://spring.develz.org/stuff/screensh ... etal_2.png

The map is called BarracudaBay and I tried with BA v7.19 and additionally have these slightly modified widgets running.
0 x

User avatar
very_bad_soldier
Posts: 1371
Joined: 20 Feb 2007, 01:10

Re: Release: Picture-in-Picture

Post by very_bad_soldier » 06 Nov 2010, 17:15

Really stunning Nio!
0 x

TheEpicMang
Posts: 11
Joined: 05 Nov 2010, 20:07

Re: Release: Picture-in-Picture

Post by TheEpicMang » 06 Nov 2010, 21:31

I don't like it much, I find it kind of distracting

I'd like it if you could make a bind to toggle it on and off because I am usually not using it and I dont want it in the way but on some occasions like if im microing a peewee in enemy base and I dont want to sit there watching it take ages to kill a lab I could just turn it on and then go do something else while keeping an eye on my peewee, make sure it doesnt get attacked
0 x

User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Release: Picture-in-Picture

Post by aegis » 06 Nov 2010, 22:09

and it crashes sometimes... needs group selection inside for me instead of dragging (could use middle click instead)

awesome widget though, it's inspiring me to do something similar... using sockets (I'll post if I can get it done this weekend)

Code: Select all

[   8471] gl.BeginEnd: error(2) = [string "LuaUI\Widgets\gui_pip.lua"]:488: GetUnitPosition(): Bad unitID: %i
[   8471] false
[   8471] Error in DrawScreen(): [string "LuaUI\Widgets\gui_pip.lua"]:488: GetUnitPosition(): Bad unitID: %i
[   8471] Removed widget: Picture-in-Picture
0 x

User avatar
very_bad_soldier
Posts: 1371
Joined: 20 Feb 2007, 01:10

Re: Release: Picture-in-Picture

Post by very_bad_soldier » 06 Nov 2010, 23:40

aegis wrote: awesome widget though, it's inspiring me to do something similar... using sockets (I'll post if I can get it done this weekend)
We have sockets now? How about that "minimap-on-second-monitor"-thingie?
0 x

User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Release: Picture-in-Picture

Post by aegis » 07 Nov 2010, 00:09

I'm making a wrapper around lualobby for sockets.
0 x

User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium » 07 Nov 2010, 04:18

Version 1.2 released !
- Fixed widget crashing on drawing odd commands (the one mentioned by aegis)
- Added minimize button (Note: Minimizes away from screen center)
- Added simple colors button (Works just like minimap simplecolors)
- Added tooltips to all buttons explaining what they do
- Added default commands (move/guard/attack/reclaim)

Chojin wrote:The map is called BarracudaBay and I tried with BA v7.19 and additionally have these slightly modified widgets running.
The misalignment is due to the map, it provides it's own minimap texture (which is what this widget uses) where the metal doesn't match up with the ground texture, you can see this if you maximize your minimap.

As for the texture issue, I still have no idea. Do they become transparent if you disable all other widgets?
0 x

User avatar
very_bad_soldier
Posts: 1371
Joined: 20 Feb 2007, 01:10

Re: Release: Picture-in-Picture

Post by very_bad_soldier » 07 Nov 2010, 16:01

Maybe auto-center on start position at game start?
0 x

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

Re: Release: Picture-in-Picture

Post by KaiserJ » 07 Nov 2010, 19:36

neat idea!

i can't help but think the ability to bind the PIP window to a unit (scout for instance) might be useful
0 x

User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Release: Picture-in-Picture

Post by aegis » 07 Nov 2010, 21:28

KaiserJ wrote:i can't help but think the ability to bind the PIP window to a unit (scout for instance) might be useful
you can, one of the buttons starts tracking whichever unit is currently selected
0 x

Post Reply

Return to “Lua Scripts”

cron