Page 1 of 2

Immovable flying structures

Posted: 14 May 2012, 14:53
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

Re: Immovable flying structures

Posted: 14 May 2012, 15:01
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.

Re: Immovable flying structures

Posted: 14 May 2012, 15:34
by knorke
throw your units in the air with MoveCtrl :shock:

Re: Immovable flying structures

Posted: 14 May 2012, 19:38
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.

Re: Immovable flying structures

Posted: 14 May 2012, 22:36
by Beherith
zw is correct, I tried it and it didnt work :(

Re: Immovable flying structures

Posted: 15 May 2012, 08:45
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.

Re: Immovable flying structures

Posted: 15 May 2012, 09:43
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.

Re: Immovable flying structures

Posted: 15 May 2012, 10:56
by Forboding Angel
That's pretty minor...

Re: Immovable flying structures

Posted: 15 May 2012, 11:12
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.

Re: Immovable flying structures

Posted: 15 May 2012, 12:06
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).

Re: Immovable flying structures

Posted: 15 May 2012, 12:08
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.

Re: Immovable flying structures

Posted: 15 May 2012, 12:20
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.

Re: Immovable flying structures

Posted: 15 May 2012, 13:44
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.

Re: Immovable flying structures

Posted: 15 May 2012, 18:34
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.

Re: Immovable flying structures

Posted: 15 May 2012, 18:41
by smoth
Solution:

enter marvel universe

ask blob to get into aircraft.

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

Re: Immovable flying structures

Posted: 15 May 2012, 19:06
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?

Re: Immovable flying structures

Posted: 16 May 2012, 22:16
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

Re: Immovable flying structures

Posted: 16 May 2012, 22:18
by smoth
AF wrote:

Code: Select all

hasSuperman=true
Fuck.

Re: Immovable flying structures

Posted: 16 May 2012, 23:27
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

Re: Immovable flying structures

Posted: 25 May 2012, 06:08
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.