Results 1 to 4 of 4

Thread: AiActor[] AiAirport.QueueTakeoff() doesn't return actor?

  1. #1
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    128
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    AiActor[] AiAirport.QueueTakeoff() doesn't return actor?

    As title, asking for .Name for actors in this array seems to return AiAirGroup name and not AiActor name?

    e.g. AiActor.Name() returns

    BoB_LW_ZG2_I.21

    not

    BoB_LW_ZG2_I.200
    BoB_LW_ZG2_I.201
    ...etc


    Code:
        public void Takeoff()
        {
            if (homeBase != null)
            {
                foreach (AiActor takeoffActor in homeBase.QueueTakeoff())
                {
    
                    if (takeoffActor != null)
                    {
                        string name = takeoffActor.Name().ToString();
                        GamePlay.gpLogServer("***********Actor in takeoff stack  = " + name);
                    }
                }
            }
        }
    Thanks

    M
    Last edited by Marcost; Sep-09-2021 at 12:17.

  2. #2
    Student Pilot
    Join Date
    Oct 2020
    Posts
    18
    Post Thanks / Like
    Total Downloaded
    119.02 MB

    Re: AiActor[] AiAirport.QueueTakeoff() doesn't return actor?

    Do you know the type of objects in the collection ?
    Maybe a mismatch object type ?

    AiAirGroup can be a AiGroup who can be a AiActor

    Can you try this ? (not tested)

    Code:
    public void Takeoff()
        {
            if (homeBase != null)
            {
                foreach (AiGroup takeoffGroup in homeBase.QueueTakeoff())
                {
                    foreach(AiActor takeoffActor in takeoffGroup.GetItems())
                    {
                        if (takeoffActor != null)
                        {
                            string name = takeoffActor.Name().ToString();
                            GamePlay.gpLogServer("***********Actor in takeoff stack  = " + name);
                        }
                    }
                }
            }
        }
    Last edited by OBT~Eazy; Sep-09-2021 at 14:40.
    "You can teach monkeys to fly better than that!"

    Obviously the Best Team.

  3. Likes Marcost liked this post
  4. #3
    Team Fusion ATAG_Oskar's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    753
    Post Thanks / Like
    Total Downloaded
    835.09 MB

    Re: AiActor[] AiAirport.QueueTakeoff() doesn't return actor?

    That call is returning maddox.game.world.AiActorImpl objects which implement the AiActor interface. They are actually instances of AirGroup which are also AiActors.

  5. Likes Marcost liked this post
  6. #4
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    128
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: AiActor[] AiAirport.QueueTakeoff() doesn't return actor?

    Hi & thanks for your replies...

    @ OBT~Eazy it works perfectly, thank you!!!

    @ Oskar, thank you for the confirmation of 'why'. I've learnt something new.

    Best regards,

    M
    Last edited by Marcost; Sep-10-2021 at 03:25.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •