General Category > AI War II - Modding

New Build Patterns


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?

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.

Is the mouse location (ArcenInput.MouseScreenX,ArcenInput.MouseScreenY)?

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).


[0] Message Index

Go to full version