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 »

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.
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium »

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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Release: Picture-in-Picture

Post by knorke »

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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Release: Picture-in-Picture

Post by hoijui »

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
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium »

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)
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Release: Picture-in-Picture

Post by Jazcash »

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.
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium »

Updated widget to v1.1 with workaround for Spring crash in XTA.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Release: Picture-in-Picture

Post by Beherith »

This is absolutely fucking amazing!
Thank you very much for it.
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Re: Release: Picture-in-Picture

Post by Chojin »

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
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium »

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..
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Re: Release: Picture-in-Picture

Post by Chojin »

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.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Release: Picture-in-Picture

Post by very_bad_soldier »

Really stunning Nio!
TheEpicMang
Posts: 11
Joined: 05 Nov 2010, 20:07

Re: Release: Picture-in-Picture

Post by TheEpicMang »

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
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Release: Picture-in-Picture

Post by aegis »

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
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Release: Picture-in-Picture

Post by very_bad_soldier »

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?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Release: Picture-in-Picture

Post by aegis »

I'm making a wrapper around lualobby for sockets.
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: Release: Picture-in-Picture

Post by Niobium »

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?
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: Release: Picture-in-Picture

Post by very_bad_soldier »

Maybe auto-center on start position at game start?
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: Release: Picture-in-Picture

Post by KaiserJ »

neat idea!

i can't help but think the ability to bind the PIP window to a unit (scout for instance) might be useful
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Release: Picture-in-Picture

Post by aegis »

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
Post Reply

Return to “Lua Scripts”