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

Expose EffectiveOwner to Lua API #14454

Merged
merged 1 commit into from Dec 16, 2017

Conversation

Projects
None yet
4 participants
@VanWardawg

VanWardawg commented Nov 30, 2017

This enables the LUA scripts to access the Effective owner of a disguised actor in the scripts. Resolves issue #14273.

@VanWardawg

This comment has been minimized.

Show comment
Hide comment
@VanWardawg

VanWardawg Nov 30, 2017

Testing Screenshot
image

VanWardawg commented Nov 30, 2017

Testing Screenshot
image

@VanWardawg

This comment has been minimized.

Show comment
Hide comment
@VanWardawg

VanWardawg Nov 30, 2017

will fix the spacing issue

VanWardawg commented Nov 30, 2017

will fix the spacing issue

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Nov 30, 2017

Member

Instead of hardcoding this for disguise, can you please expose this via Actor.EffectiveOwner as part of the BaseActorProperties?

Member

pchote commented Nov 30, 2017

Instead of hardcoding this for disguise, can you please expose this via Actor.EffectiveOwner as part of the BaseActorProperties?

@VanWardawg

This comment has been minimized.

Show comment
Hide comment
@VanWardawg

VanWardawg Nov 30, 2017

yes of course! :)

VanWardawg commented Nov 30, 2017

yes of course! :)

@penev92 penev92 changed the title from Addeffectiveownertodisguisedactors to Expose EffectiveOwner to Lua API Nov 30, 2017

@VanWardawg

This comment has been minimized.

Show comment
Hide comment
@VanWardawg

VanWardawg Dec 5, 2017

Can someone please approve?

VanWardawg commented Dec 5, 2017

Can someone please approve?

@GraionDilach

This comment has been minimized.

Show comment
Hide comment
@GraionDilach

GraionDilach Dec 5, 2017

Contributor

Needs squashing.

Contributor

GraionDilach commented Dec 5, 2017

Needs squashing.

@penev92

This comment has been minimized.

Show comment
Hide comment
@penev92

penev92 Dec 5, 2017

Member

Sorry for the delay.
Yes, please add an empty line between the two returns and squash the commits.

Member

penev92 commented Dec 5, 2017

Sorry for the delay.
Yes, please add an empty line between the two returns and squash the commits.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Dec 10, 2017

Member

@penev92 it might be helpful at this point for you to apply the fixups and then push over the branch/PR

Member

pchote commented Dec 10, 2017

@penev92 it might be helpful at this point for you to apply the fixups and then push over the branch/PR

@VanWardawg

This comment has been minimized.

Show comment
Hide comment
@VanWardawg

VanWardawg Dec 10, 2017

VanWardawg commented Dec 10, 2017

@penev92 penev92 added this to the Next release milestone Dec 11, 2017

@VanWardawg

This comment has been minimized.

Show comment
Hide comment
@VanWardawg

VanWardawg Dec 13, 2017

Sorry for the delay, I've added the space and squashed the commits. Can't wait to continue contributing :)

VanWardawg commented Dec 13, 2017

Sorry for the delay, I've added the space and squashed the commits. Can't wait to continue contributing :)

@penev92

This comment has been minimized.

Show comment
Hide comment
@penev92

penev92 Dec 13, 2017

Member

Looks good to me, thanks 👍
As a general rule of thumb you might want to reword the commit in order to remove the aggregate commit messages.

Member

penev92 commented Dec 13, 2017

Looks good to me, thanks 👍
As a general rule of thumb you might want to reword the commit in order to remove the aggregate commit messages.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Dec 16, 2017

Member

I have amended the commit message and force pushed the fixed commit to this PR.

Member

pchote commented Dec 16, 2017

I have amended the commit message and force pushed the fixed commit to this PR.

@pchote

pchote approved these changes Dec 16, 2017 edited

Works as advertised.

Testcase:

diff --git a/mods/ra/maps/allies-05a/allies05a.lua b/mods/ra/maps/allies-05a/allies05a.lua
index 113db284d5..8d843dd53a 100644
--- a/mods/ra/maps/allies-05a/allies05a.lua
+++ b/mods/ra/maps/allies-05a/allies05a.lua
@@ -349,6 +349,15 @@ InitObjectives = function()
        end)
 end
 
+Test = function()
+       Utils.Do(Map.ActorsInWorld, function(a)
+               if a.Type == "spy" then
+                       print(a.EffectiveOwner.Name)
+               end
+       end)
+       Trigger.AfterDelay(DateTime.Seconds(5), Test)
+end
+
 WorldLoaded = function()
        greece = Player.GetPlayer("Greece")
        ussr = Player.GetPlayer("USSR")
@@ -357,5 +366,7 @@ WorldLoaded = function()
        InitTriggers()
        SendSpy()
 
+       Trigger.AfterDelay(DateTime.Seconds(5), Test)
+
        Trigger.AfterDelay(DateTime.Seconds(3), ActivatePatrols)
 end

@pchote pchote merged commit 86f9b88 into OpenRA:bleed Dec 16, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment