Author Topic: New Build Patterns  (Read 4933 times)

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
New Build Patterns
« on: May 31, 2017, 08:05:51 pm »
It occurs to me that something like "Basic Turretry" would be more useful if it built around a point you chose instead of just  " ArcenPoint formationCenterPoint = BuildingEntity.WorldLocation;"

Is there a way to get "Next place the mouse is clicks on" in external code?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: New Build Patterns
« Reply #1 on: May 31, 2017, 08:24:16 pm »
Not yet, but support could be added.

Though perhaps it's better to just have the script use the point currently under the mouse cursor, which you could do now (though you may not know how to get that point), then the pattern would be triggered by the keyboard and targeted by the mouse. Though naturally what you describe is the better long-term UX because people expect to be able to use it entirely via the mouse.

You can also have a pattern place turrets around each wormhole (all in one pattern triggering), or all wormholes that border a non-human planet, weighted based on some threat evaluation you code in, etc.

Basically you can do whatever, it's just a question of determining what you want.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: New Build Patterns
« Reply #2 on: May 31, 2017, 08:28:41 pm »
Is the mouse location (ArcenInput.MouseScreenX,ArcenInput.MouseScreenY)?

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: New Build Patterns
« Reply #3 on: May 31, 2017, 09:22:07 pm »
In screen coordinates, yes, but that won't help you if you try to pass that into the placement position. It would wind up way out where you'd never see or interact with it.

I thought there was a field you could pull to get the sim coordinates under the cursor but there's not actually right now (in any reasonable way, anyhow), so I'll add it for the next release.

It will be: ArcenInput_AIW2.LastSimPointForPlacementPurposes

And it will be == ArcenPoint.ZeroZeroPoint if it's not valid, and something else if it is valid. If it's valid you can just use it as-is as a placement point within the ring (if the mouse is outside the ring, the point is "moved" towards the gravwell center until it is inside the ring).
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!