Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 8:44 am
All times are UTC + 0
Garrisoned Guard Tower
Moderators: Global Moderators, OpenRA Moderators
Post new topic   Reply to topic Page 1 of 1 [3 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
CabalCore
Cyborg Soldier


Joined: 23 Oct 2013

PostPosted: Tue May 23, 2017 8:02 am    Post subject:  Garrisoned Guard Tower
Subject description: need correct port offsets
Reply with quote  Mark this post and the followings unread

I got the idea to make the Guard Tower in TD a garrisoned defense. The idea came from the pillbox in RA.

I tried doing a copy and paste from the pillbox and it worked fine for the most part. The problem I'm having is trying to get the port offsets, port yaws and port cones correct for 8 facings rather than 6 facings that the pillbox uses.

Would someone be able to help me out with this?

Back to top
View user's profile Send private message
pchote
Rocket Infantry


Joined: 06 Feb 2015

PostPosted: Thu May 25, 2017 9:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm going to assume 4 ports so that I can outline the procedure off the top of my head without having to calculate or test anything.

The default weapon armament defines a local offset of 256,0,256, so you can find the PortOffsets by rotating this around the 4 facings:

PortOffsets: 256,0,256, 0,-256,256, -256,0,256, 0,256,256

For 8 ports you just need to insert the intermediate rotations with sqrt(2)*256 on the x and y.

The port yaws are measured with 1024 units per rotation, so you should have each port facing outwards:

PortYaws: 0, 256, 512, 768

For 8 ports you'll have 128, 384, and so on.

The PortCones define the angle that each port can fire through. It should be set slightly larger than the angle between ports.  1024 / 4 / 2 = 128, so

PortCones: 130, 130, 130, 130

For 8 ports you'll want to halve these.

You can turn on "Show Combat Geometry" in the debug options to have the game draw the resulting cones.

Back to top
View user's profile Send private message
CabalCore
Cyborg Soldier


Joined: 23 Oct 2013

PostPosted: Fri May 26, 2017 6:29 am    Post subject: Reply with quote  Mark this post and the followings unread

Did some experimenting first to make sure I got it down.

Code:

GTWR:
   Inherits: ^Defense
   Valued:
      Cost: 600
   Tooltip:
      Name: Guard Tower
   Buildable:
      BuildPaletteOrder: 40
      Prerequisites: pyle, ~techlevel.lowest
      Queue: Defence.GDI
      BuildDuration: 1440
      BuildDurationModifier: 40
      Description: Basic defensive structure.\n  Strong vs Infantry\n  Weak vs Tanks
   Building:
   Health:
      HP: 400
   RevealsShroud:
      Range: 7c0
   Bib:
      HasMinibib: Yes
   Cargo:
      Types: Infantry
      MaxWeight: 1
      PipCount: 1
      InitialUnits: e1
   -EmitInfantryOnSell:
   AttackGarrisoned:
      Armaments: garrisoned
      PortOffsets: 256,0,256, 0,-256,256, -256,0,256, 0,256,256
      PortYaws: 0, 256, 512, 768
      PortCones: 130, 130, 130, 130
   -QuantizeFacingsFromSequence:   
   BodyOrientation:
      QuantizedFacings: 8
   DetectCloaked:
      Range: 3c0
   Turreted:
      TurnSpeed: 255
   Power:
      Amount: -10


It has a single firing muzzle flash pointing up, right, down and left. though when firing diagonally, I see dual muzzle flashes as though it were firing twice.

So basically I have to go halfway between the portoffsets, portyaws and portcones. So it would be something like.

PortYaws: 0, 128, 256, 384, 512, 768, 896, 1024
PortCones: 65, 65, 65, 65,  65, 65, 65, 65

Thanks to your reply, I think I have the PortYaws and PortCones done. Though I'm still having slight difficulty for the PortOffsets. I'm guessing I'd go halfway between them.

And also, is the firing sequence in a clockwise rotation?

EDIT: this is what I did.

Code:

PortOffsets: 256,0,256, 128,-128,256, 0,-256,256, -128,-128,256, -256,0,256, -128,128,256, 0,256,256, 128,128,256
PortYaws: 0, 128, 256, 384, 512, 640, 768, 896
PortCones: 65, 65, 65, 65, 65, 65, 65, 65


The garrisoned guard tower fires in 8 facings in an octagonal pattern.

EDIT: Is there a way to replicate RA2's battle fortress behavior? And what I mean by that is to have a vehicle with an initial primary weapon and add additional weapons with garrisoned infantry?

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1519s ][ Queries: 11 (0.0099s) ][ Debug on ]