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
Add Lua Scripting for Carryall. #19312
Conversation
There are a couple of issues here, demonstrated with a testcase:
The first problem is that this this generates target lines, whereas the standard behaviour for scripted activities (whether we like it or not - this isn't the place to argue it) is to hide them by passing The second problem is that the Can we please also call the Lua APIs for these |
I'm not quite sure what the suggestion here is. Having the checks at all seems unnecessary. (And shouldn't be worked around in Lua code using |
Updated. Fixed the first and 3rd points as PChote said. I removed the checks as abcdefg30 said, but haven't checked/updated the activities to properly check them. I have some questions first, will handle that along with them.
|
|
Updated with the point 2. Activities already seem to be properly ignoring the Pickup/Deliver order if they are already Full/Empty. You can see with this version of the testcase PChote posted above. WorldLoaded = function()
Multi = Player.GetPlayer("Multi0")
local carryall = Actor.Create("TRNSPORT", true, { Owner = Multi, Location = Actor615.Location })
local apc = Actor.Create("APC", true, { Owner = Multi, Location = Actor615.Location + CVec.New(3, 3) })
local bike = Actor.Create("BIKE", true, { Owner = Multi, Location = Actor615.Location + CVec.New(0, 3) })
carryall.PickupCarryable(apc)
carryall.PickupCarryable(bike)
carryall.DeliverCarryable(Actor615.Location - CVec.New(3, 3))
carryall.DeliverCarryable(Actor615.Location + CVec.New(3, 3))
end |
This has been sitting for a while, i would like to note again that this was updated and the label is inaccurate. I can't edit labels anymore. |
This has compiler errors once you rebase. |
56470c1
to
ed0655e
Compare
Rebased and updated. |
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.
LGTM with one small fix request
87cab3c
to
d9bf227
Compare
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.
👍
I changed the Carryalls in SP to actually use Carryall logic. The shellmap had some carryall stuff, which we didn't support yet for the actual Carryall logic. This PR adds functions for Picking Up and Dropping the carried unit for Carryalls. Altho i'm not sure if what i did for ignoring the Pickup/Deliver if the Carryall is already Full/Empty is the best way of doing it.