User Interface - Display unit portrait using a custom camera

User Interface - Display unit portrait using a custom camera

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

Moderator: Moderators

Post Reply
super_g
Posts: 13
Joined: 12 Jan 2012, 04:10

User Interface - Display unit portrait using a custom camera

Post by super_g »

I am attempting to display a portrait of the currently selected units in a widget. I would to use a camera in front of the selected unit and display the resulting image from the camera on the user interface. This would allow me to reuse passive animations and not have to create portrait images.
If anyone knows if this is possible and if so how that would be great, thanks.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: User Interface - Display unit portrait using a custom camera

Post by knorke »

welcome :-)
There are Lua functions to draw unit models.
This widget is somewhat similiar:
http://code.google.com/p/xta-springrts/ ... _1_xta.lua
When you put units into groups, it draws a rotating 3d view things of the units on a button.
(if you want to test it, mind this bug: http://springrts.com/phpbb/viewtopic.php?f=11&t=27358)

I guess the unit could be made to move its pieces but not sure if you actually use existing unit scripts. (probally not)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: User Interface - Display unit portrait using a custom camera

Post by AF »

super_g wrote:I am attempting to display a portrait of the currently selected units in a widget. I would to use a camera in front of the selected unit and display the resulting image from the camera on the user interface. This would allow me to reuse passive animations and not have to create portrait images.
If anyone knows if this is possible and if so how that would be great, thanks.

How do you intend to deal with the selection of two types of units?
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Re: User Interface - Display unit portrait using a custom camera

Post by MidKnight »

AF wrote:
super_g wrote:I am attempting to display a portrait of the currently selected units in a widget. I would to use a camera in front of the selected unit and display the resulting image from the camera on the user interface. This would allow me to reuse passive animations and not have to create portrait images.
If anyone knows if this is possible and if so how that would be great, thanks.

How do you intend to deal with the selection of two types of units?
He could do it the same way *Craft does.
(Then the question becomes, what does *Craft do?)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: User Interface - Display unit portrait using a custom camera

Post by smoth »

most spring games have WAAAAAAAAAY more units than starcraft.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: User Interface - Display unit portrait using a custom camera

Post by Forboding Angel »

smoth wrote:most spring games have WAAAAAAAAAY more units than starcraft.
^^ This. The entire protoss tech tree (including units) is only 29 units.

Me and kaiser could have 2 factions easily by now if we followed starcrap.
super_g
Posts: 13
Joined: 12 Jan 2012, 04:10

Re: User Interface - Display unit portrait using a custom camera

Post by super_g »

AF wrote:
super_g wrote:I am attempting to display a portrait of the currently selected units in a widget. I would to use a camera in front of the selected unit and display the resulting image from the camera on the user interface. This would allow me to reuse passive animations and not have to create portrait images.
If anyone knows if this is possible and if so how that would be great, thanks.

How do you intend to deal with the selection of two types of units?
I am planning to display a portrait of each type of unit selected and a list of attributes/stats for that unit type.

I am having trouble displaying the information on the same plane as the built in mini-map.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: User Interface - Display unit portrait using a custom camera

Post by knorke »

do you so far have any code to show?
or do you need an idea how to start?
with so few informations its hard to help..
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: User Interface - Display unit portrait using a custom camera

Post by luckywaldo7 »

MidKnight wrote:
AF wrote:
super_g wrote:I am attempting to display a portrait of the currently selected units in a widget. I would to use a camera in front of the selected unit and display the resulting image from the camera on the user interface. This would allow me to reuse passive animations and not have to create portrait images.
If anyone knows if this is possible and if so how that would be great, thanks.

How do you intend to deal with the selection of two types of units?
He could do it the same way *Craft does.
(Then the question becomes, what does *Craft do?)
Image

There is a unit list that shows all individual units (colored according to hp level, with some addition blue square things for protoss shields). If there are too many units to fit on one page, they overflow onto additional 'pages' that you can flip through.

Additionally there is a unit portrait, that is 90% decoration. There is only enough space on the action menu to show special actions for 1 type of unit at a time, the unit that gets shown in the portrait. In this case, the portrait is showing a sentry, and the special sentry spells of force field, sentry shield, and hallucination.

You can use tab to flip through unit types to show their special actions. Suppose you also had some high templar selected, you could press tab and the portrait would switch to a high templar, and the special unit actions would switch to feedback and storm.
Attachments
sc2interface.jpeg
(387.35 KiB) Downloaded 3 times
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: User Interface - Display unit portrait using a custom camera

Post by gajop »

Forboding Angel wrote:
smoth wrote:most spring games have WAAAAAAAAAY more units than starcraft.
^^ This. The entire protoss tech tree (including units) is only 29 units.

Me and kaiser could have 2 factions easily by now if we followed starcrap.
And in my oppinion, maybe you should've done that.
Can't comment on evo, but I find zero-k a bit intimidating due to a lot of early build options and a relatively short tech tree, in contrast to starcraft 1, where you can build only 1 attack unit when you build your first 'factory'.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: User Interface - Display unit portrait using a custom camera

Post by smoth »

Starcraft is a smaller scale etc this has already been discussed slamming one set of features from one game type into another is not always going to end well. Good day.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: User Interface - Display unit portrait using a custom camera

Post by Forboding Angel »

gajop wrote:
Forboding Angel wrote:
smoth wrote:most spring games have WAAAAAAAAAY more units than starcraft.
^^ This. The entire protoss tech tree (including units) is only 29 units.

Me and kaiser could have 2 factions easily by now if we followed starcrap.
And in my oppinion, maybe you should've done that.
Can't comment on evo, but I find zero-k a bit intimidating due to a lot of early build options and a relatively short tech tree, in contrast to starcraft 1, where you can build only 1 attack unit when you build your first 'factory'.
Nah, I don't agree. The only thing that keeps sc2 from being a snoozefest is the fact that you have to micro EVERYTHING.

For example, the pages of units are done that way deliberately so that unit numbers are hard to count. Then the fact that you have to cycle through them with tab in order to use abilities. In Evo, you have a mass of units selected, it shows you how many and of what type, and all of their special abilities can be triggered without cycling. This is FAR superior. Evo has a total of 55 units for Outer Colonies iirc.

In evo you have these distinctions of units built in the factories labeled as such: All-Terrain, Hovers, Amphibious, Aircraft.

If you build an aircraft factory, it's a decent bet that you'll end up with aircraft, likewise, if you build an All-Terrain factory, it stands to reason that units built from that factory will probably be able to go anywhere.

ZK is a bit confusing at first, I completely agree. But they are trying to (in certain ways) mimic TA's style of tech tree (sort of, not really the tree so much as the interactions), which with TA+CC had like 350+ units in it. So it stands to reason that you're probably going to need to spend quite a few games getting comfortable with it and learning the units. It's not like any of us knew everything there was to know about TA within a day. In the few times I've played ZK, I was hopelessly lost. That isn't the ZK guys' fault. It's mine for not learning the game.


The main point is, there is no RTS game that you will be able to just pick up and run with. I started playing Nuclear Dawn about 2 weeks or so ago. Even I with all my RTS experience had to spend a little time getting used to the Commanding part (Actually, the power setup is REALLY similar to how Evo's resourcing works). I don't understand where people around Spring get this idea that you should be able to pick up any new RTS game and completely understand it within 30 minutes. That's ridiculous!

Sorry for the derail.
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: User Interface - Display unit portrait using a custom camera

Post by KingRaptor »

Is there a (hopefully not too hard way) to fulfill the original request? Specifically, I'm looking to do a PiP for a certain flight sim.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: User Interface - Display unit portrait using a custom camera

Post by Beherith »

If I recall correctly, VBS did a widget that allowed a full map view in PIP
Post Reply

Return to “Lua Scripts”