Create a nanoframe with lua

Create a nanoframe with lua

Requests for features in the spring code.

Moderator: Moderators

Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Create a nanoframe with lua

Post by Google_Frog »

Setting a finished unit to build < 1 does not turn it into a nano frame. I think this is an engine bug.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Create a nanoframe with lua

Post by Tobi »

For now just remove the unit and replace it with a nanoframe.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Create a nanoframe with lua

Post by Google_Frog »

Tobi wrote:For now just remove the unit and replace it with a nanoframe.
How? Spring.CreateUnit creates fully built units.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Create a nanoframe with lua

Post by Google_Frog »

I found out about the secret 5th param that makes nanoframes. When was the wiki last updated?
Wiki wrote:Spring.CreateUnit note: offmap positions are clamped! (you still can use MoveCtrl todo so)

( string "defName" | number unitDefID,
number x, number y, number z,
(number facing | string "facing"),
number teamID ) -> number unitID
Still, < 1 build progress is a bit of a bug. The 5th param shouldn't be needed.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Create a nanoframe with lua

Post by Tobi »

Just added it to wiki ;-)

You can see in the history when it was last updated.

And yeah, it is a bug, and yeah, it isn't really easy to solve. (Need to make sure all the state transitions that happen when unit finished building are put together, and make new code that can do the reverse transition.)
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Create a nanoframe with lua

Post by SirMaverick »

Tobi wrote:And yeah, it is a bug, and yeah, it isn't really easy to solve. (Need to make sure all the state transitions that happen when unit finished building are put together, and make new code that can do the reverse transition.)
Doesn't that already exist with gradual reclaim?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Create a nanoframe with lua

Post by SirMaverick »

Tobi wrote:And yeah, it is a bug, and yeah, it isn't really easy to solve. (Need to make sure all the state transitions that happen when unit finished building are put together, and make new code that can do the reverse transition.)
Btw: It is useful to have a Callin for that. Basically the reverse of UnitFinished.
Last edited by SirMaverick on 08 Dec 2009, 15:34, edited 1 time in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Create a nanoframe with lua

Post by FLOZi »

And what if nanoframes are turned off? Current method is probably better.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Create a nanoframe with lua

Post by SirMaverick »

FLOZi wrote:And what if nanoframes are turned off?
Why do you care about a feature that you won't use? Why do you set build percentage when you disabled nanoframes?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Create a nanoframe with lua

Post by Tobi »

Because you may still want to put the building in 'being built' state?

(Which is the only thing that is being done here; the nanoframe is just a side effect.)
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Create a nanoframe with lua

Post by FLOZi »

Tobi wrote:Because you may still want to put the building in 'being built' state?

(Which is the only thing that is being done here; the nanoframe is just a side effect.)
Exactly.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Create a nanoframe with lua

Post by AF »

Nanoframes should be moved to lua anyway, its a TA specific mechanism thats sitting in a general RTS engine.

Doing so would also make it easier to do things like showing the reverse of the build animation on features being reclaimed
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Create a nanoframe with lua

Post by lurker »

How does that make anything easier?
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Create a nanoframe with lua

Post by Regret »

AF wrote:Nanoframes should be moved to lua anyway, its a TA specific mechanism thats sitting in a general RTS engine.

Doing so would also make it easier to do things like showing the reverse of the build animation on features being reclaimed
Maybe you haven't noticed but spring is mainly used by TA mods (over 90% of all game-time), meaning removing TA-specific features (without providing a 100% functional replacement beforehand) is a completely retarded idea.

Especially when the removal won't actually provide anything useful.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Create a nanoframe with lua

Post by smoth »

Regret wrote:[ meaning removing TA-specific features (without providing a 100% functional replacement beforehand) is a completely retarded idea.
moving it to lua isn't removal it adds flexibility.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Create a nanoframe with lua

Post by Regret »

smoth wrote:moving it to lua isn't removal it adds flexibility.
No it does not.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Create a nanoframe with lua

Post by smoth »

how so?
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Create a nanoframe with lua

Post by Regret »

smoth wrote:how so?
Because it wouldn't add anything that isn't already possible with Lua, it would just remove a feature.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Create a nanoframe with lua

Post by smoth »

Why have it as part of the core engine? Seems needless.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Create a nanoframe with lua

Post by Regret »

smoth wrote:Why have it as part of the core engine? Seems needless.
Because nobody made a fully working replacement for it and it is non-sense to remove such a fundamental part of the engine that is used so vastly.

Countless mods/games use the feature. Even if it was remade it would be ridiculous to remove engine support of it as it would most surely cause a damn heck of a lot of new problems causing needless chaos and patching for all involved projects.

Unless you have a replacement ready there is no use even arguing it's removal.
Last edited by Regret on 09 Dec 2009, 00:26, edited 1 time in total.
Post Reply

Return to “Feature Requests”