Not a member yet? Why not Sign up today
Create an account  

  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Simple fortress height script

#1
I just wanted my fortress to stay at the most fuel efficient height while building. And since Automated Control Block seem to be unable to control fortresses I wrote a simple script. In case anyone needs it:

Code:
function Update(I)
  centerheight = I:GetConstructCenterOfMass().y;
  if centerheight < -1 then
    -- too low, move up
    I:MoveFortress(Vector3(0,1,0));
  end
  if centerheight > 1 then
    -- too high, move down
    I:MoveFortress(Vector3(0,-1,0));
  end
end
Reply



Messages In This Thread
Simple fortress height script - by Mimos - 2016-05-07, 11:31 PM
RE: Simple fortress height script - by carmenara - 2016-05-12, 07:41 AM
RE: Simple fortress height script - by Pondafarr - 2016-05-13, 08:45 PM
RE: Simple fortress height script - by Normal69 - 2018-11-27, 04:53 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)