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
    138
    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
    Supporting Member
    Join Date
    Oct 2020
    Posts
    198
    Post Thanks / Like
    Total Downloaded
    197.43 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 Sleepy_Fly; Sep-09-2021 at 14:40.
    "You can teach monkeys to fly better than that!"

    Win 11 Pro - I5-12600KF - 32GB Ram - RTX 3080 TI 12GB (non OC) - SSD Sata 970 GBB (System) - NVMe 980 GB (games storage) - Lenovo 27'' 144Hz - HP Reverb G2 v2 -
    WMR environment : Empty room (SkySpaces) - SteamVR resolution : 2192x2144 (48%)
    nVidia driver : 536.23

  3. Likes Marcost liked this post
  4. #3
    ATAG Member ATAG_Oskar's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    986
    Post Thanks / Like
    Total Downloaded
    908.31 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
    138
    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
  •