Immovable flying structures

Immovable flying structures

Requests for features in the spring code.

Moderator: Moderators

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Immovable flying structures

Post by AF »

I'm curious, and please slap me if this is a silly thing everybody knows is obvious but..

Right now we have:
  • Immovable floating structure
  • Movable floating units
  • Immovable uw structure
  • Movable uw units
  • Immovable ground structures
  • Movable ground units
  • Movable flying units
What about immovable flying structures? Aka structures that do not sit on the ground or have a ground presence, but have a position and altitude and obey air based pathing rather than ground based pathing. The sort that would need anti air to shoot at, that could not be issued move commands, and had all the normal structure abilities like being a factory etc

Without needing the usual hacks of turning mobile units into factories and giving them a speed of zero, or having a ground structure that has a tiny footprint and a model that's shifted upwards to look like it's flying
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Immovable flying structures

Post by Beherith »

Correct me if I am wrong, but this can be done with th following:
Completely open yardmap
Raise structure in upspring, make sure to correct its center and radius
Animate building to float up and down a bit
Put it in category vtol (or whatever your mod uses for air, as toairweapon is deprecated)
Put the los emit height high up, along with radar emit height.
Turn off terrain flattening under building.

All the above should result in what you desire.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Immovable flying structures

Post by knorke »

throw your units in the air with MoveCtrl :shock:
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Immovable flying structures

Post by zwzsg »

Beherith wrote:All the above should result in what you desire.
No, instead of a structure that can only be hit by AA, you'd get a structure that cannot be hit.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Immovable flying structures

Post by Beherith »

zw is correct, I tried it and it didnt work :(
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Immovable flying structures

Post by Forboding Angel »

zwzsg wrote:
Beherith wrote:All the above should result in what you desire.
No, instead of a structure that can only be hit by AA, you'd get a structure that cannot be hit.
Put the structure in the vtol category (of whatever you use to define that this is an air unit that can or cannot be shot at by whatever).

Raise the model off of the ground in the script or in upspring.

Open yardmap.

Script move up and down a bit.

Set custom collision via unitdef.

I don't see the problem...

Example, Evolution RTS old ass versions (as in years ago... back before kaiserj came along) that had the central processing unit of spikeyness, bad particle effects and dewm.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Immovable flying structures

Post by Google_Frog »

You would not be able to place the construction blueprints on top of units and it would not construct if the destination is not clear.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Immovable flying structures

Post by Forboding Angel »

That's pretty minor...
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Immovable flying structures

Post by Beherith »

Forboding Angel wrote:Put the structure in the vtol category (of whatever you use to define that this is an air unit that can or cannot be shot at by whatever).
This part doesnt work, I tried it.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Immovable flying structures

Post by Forboding Angel »

Yeah it does. However, BA has too many categories, so until you fix that, your categories won't really work anyway (in infolog it tells you too many categories, etc etc etc).
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Immovable flying structures

Post by Anarchid »

Last time i heard, you could either attach facs to transports with normal transport loading code, or just movectl them to position.

If a mobile flying factory can be done like that, why can't an immobile one.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Immovable flying structures

Post by Beherith »

Forboding Angel wrote:Yeah it does. However, BA has too many categories, so until you fix that, your categories won't really work anyway (in infolog it tells you too many categories, etc etc etc).
Stop saying that BA has too many categories, as it is clearly false.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Immovable flying structures

Post by AF »

My question general, not BA specific

Things that would make sense for true flying structures:
  • Units could walk underneath it ( check yardmap )
  • Aircraft could fly underneath at lower altitudes
  • Given an arbitrary 3D building placement widget, several could be built at the same location but at different altitudes
  • It would not deform terrain or have any slope tolerances ( hackable via extremely leniant values but for a flying structure this would not be necessary or apply)
  • Could be built in the air, no rising from the ground stuff
From the responses here I guess it is not possible, and the engine does not allow it, but there are approximations, e.g. flying aircraft that have a speed of 0 or structures that look like they're flying but aren't.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: Immovable flying structures

Post by FLOZi »

Beherith wrote:
Forboding Angel wrote:Put the structure in the vtol category (of whatever you use to define that this is an air unit that can or cannot be shot at by whatever).
This part doesnt work, I tried it.
Sorry behe but if that doesn't work, doin' it wrong.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Immovable flying structures

Post by smoth »

Solution:

enter marvel universe

ask blob to get into aircraft.

oh wait you needed a structure, well shit son, I am stumped.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Immovable flying structures

Post by Pxtl »

Use 2 units?

One a immobilized air unit movectrled into the air, and one an untargetable open yardmap that just exists to block building more buildings on the spot?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Immovable flying structures

Post by AF »

smoth wrote:Solution:

enter marvel universe

ask blob to get into aircraft.

oh wait you needed a structure, well shit son, I am stumped.

I found the solution:

Code: Select all

hasSuperman=true
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Immovable flying structures

Post by smoth »

AF wrote:

Code: Select all

hasSuperman=true
Fuck.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Immovable flying structures

Post by knorke »

Since there is no urgent need, I guess the real question is can it be done with minimal effort.
you can move/create/damage units and if the factory thing is a problem you could replace it with a lua factory. Atm do not see the problem, guess it is "plausible"?
I had an idea but then my computer got ATIDS and minimal effort was exhausted.
Image
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Immovable flying structures

Post by knorke »

tl;dr goes to top of post
Image
normal flying units (like flying windmills or hover turrets) seem to be np, factories have with some quirks.

-------------
air unit with maxVelocity=0
-spawns at ground, then rises to its flightheight
-bops up and down a bit, as spring aircraft never like to sit 100% still
-when bumped, there is a chance that it will go flying in a random direction, off the map. (wut)
-builders can build under it
-aircrafts can not be a factory

------
unit script:

Code: Select all

function script.Create()
Spring.MoveCtrl.Enable (unitID)
local x,y,z = Spring.GetUnitPosition (unitID)
Spring.MoveCtrl.SetPosition (unitID, x,y+300,z)
now unit sits perfectly still at its position in the air.

aircraft:
-when bumped, moves a few pixels (hardly noticeable but interessting)
coud be avoided by reseting position now and then or maybe there is some function for that.

ground unit:
works too, not sure what happens on collision
(was hard to tell and cba to make a testunit with bigger colsphere)

buildings:
-ground still blocked by yardmap, builders refuse to builder under unit
-yardMap = "yyy yyy yyy", and ground is free, builders build
yardmap = "" does not work.

factory:
[GiveUnits] spawned 1 tpfactory2 unit(s) for team 0
[f=0013556] [string "scripts/tpfactory2.lua"]:64: Enable(): Bad unitID
[f=0013556] stack traceback:
[C]: in function 'Enable'
[string "scripts/tpfactory2.lua"]:64: in function 'fun'
[string "LuaGadgets/Gadgets/unit_script.lua"]:747: in function <[string "LuaGadgets/Gadgets/unit_script.lua"]:745>

(wut)

A wupget appears:

Code: Select all

local fly = {
--  [UnitDefNames["tpjeep"].id] = true,
  [UnitDefNames["tpsmallfac"].id] = true,
}
function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID)
	if fly[unitDefID] then
		Spring.MoveCtrl.Enable (unitID)
		local x,y,z = Spring.GetUnitPosition (unitID)
		Spring.MoveCtrl.SetPosition (unitID, x,y+200,z)
	end
end
Now the factory is in the air.
It builds, finished units appear at ground.
Problem:
build something under the factory and it can not build stuff.
(and builders will not begin construction under factory while it is building)
Problems seems to be that factory does not want to build if something is "in" in. Maybe solvable with different yardmap or moving the nanopiece elsewhere?

Funfact:
Flying factory on top of normal factory:
Image
Both can build, but only if the top factory is given the order first.

with all these variants, enemies will target the unit like before.
(this means moving your unit into the air does not make it targetable by AA weapons, you need to set categories)

:arrow: Need a way to make factories build even if their buildspot is blocked.
Post Reply

Return to “Feature Requests”