New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ported first GDI mission to Lua #4386
Conversation
@@ -2,8 +2,7 @@ Reinforcements = { } | |||
|
|||
Reinforcements.Insert = function(owner, transportName, passengerNames, enterPath, exitPath) | |||
local facing = { Map.GetFacing(CPos.op_Subtraction(enterPath[2], enterPath[1]), 0), "Int32" } | |||
local altitude = { Rules.InitialAltitude(transportName), "Int32" } | |||
local transport = Actor.Create(transportName, { Owner = owner, Location = enterPath[1], Facing = facing, Altitude = altitude }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add local center = WPos.op_Addition(enterPath[1].CenterPosition, WVec.New(0, 0, Rules.InitialAltitude(transportName).Range))
and then CenterPosition = center
to Actor.Create.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still isn't right - you'll need to remove the .Range from here, and add it inside Rules.InitialAltitude instead.
"BUG: In order targeter - decided on Move but then didn't order" when attempting to move the gunboat. |
That is a trade off for a crash. Not sure how to fix |
Looks and plays good otherwise, great job! |
👍, pending any comments from @ScottNZ |
There are a couple of minor polish issues (gunboat will override any manually chosen targets, hovercraft renders above cargo and turns around instead of reversing), but these can be cleaned up in follow up patches. |
Fixed the hovercraft turning around. The original artwork fits better here. No idea on how to solve that offset problem. The gunboat ignoring manual targets may be bad, but it seems to know best how to clear the coast and it is better than having one that is idle and just gets destroyed so I am happy with it for now. |
{ | ||
this.unitType = unitType; | ||
var reject = self.TraitOrDefault<RejectsOrders>(); | ||
rejectMove = reject != null && !reject.Except.Contains("Move"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the self.AcceptsOrder helper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it in #4396
👍 |
I wouldn't be too concerned about this - we will be fixing that in the near future. |
There are a couple of crashes in the pr as-filed, but these are fixed in other PRs. |
Ported first GDI mission to Lua
my first attempts with the in-game Lua scripts. Improvements include a simpler victory check and the gunboat works properly now. Fixed some NREs related to
RejectsOrders
and made it shoot and move. Also fixedReinforcements.Insert
with the help of @phrohdoh.