Announcement

Collapse
No announcement yet.

Mutator makes my head hurt

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mutator makes my head hurt

    Ok, I'm beating my head against the wall on this one. I'm working on a mutator that spawns an actor at the beginning of any given level. Normal pickups/objects spawn just fine. However, if I try to spawn any subclass of ThieveryAI.TBot I receive the following errror and the game crashes.

    Critical Error

    ThieveryDeathMatchPlus TH-CountryAbode.ThieveryDeathMatchPlus0 (Function ThieveryMod.ThieveryDeathMatchPlus.AddToTeam:01B9) Runaway loop detected (over 10000000 iterations)

    History: FFrame::Serialize <- UObject:rocessEvent <- (TKnight TH-CountryAbode.TKnight0, Function ThieveryAI.TBot.PostBeginPlay) <- BeginPlay <- UGameEngine::LoadMap <- LocalMapURL <- UGameEngine::Browse <- ClientTravel <- UGameEngine::Tick <- UpdateWorld <- MainLoop

    I also notice the following lines in Thievery.log (from spawn event until end):

    ScriptLog: Successfully spawned bot
    ScriptLog: $ Chat logger started for this game at 22:9 30-4-2003
    ScriptWarning: ThieveryDeathMatchPlus TH-CountryAbode.ThieveryDeathMatchPlus0 (Function ThieveryMod.ThieveryDeathMatchPlus.InitGame:00B0) Accessed None
    ScriptLog: Initialising voice data for voice "ThieveryAISpeech.Benny".
    ScriptLog: 6 sound(s) not found.
    ScriptLog: Initialising voice data for voice "ThCountrysideGuard.Country".
    ScriptLog: 1 sound(s) not found.
    ScriptLog: [Tdmplus] Total loot on map=1360.000000
    ScriptLog: [Tdmplus] Total loot on map=1010.000000
    ScriptLog: Initialising voice data for voice "ThGermanGuard.German".
    ScriptLog: UdpServerQuery(crt): Port 7778 successfully bound.
    ScriptLog: DoUplink is not set. Not connecting to Master Server.
    ScriptLog: DoUplink is not set. Not connecting to Master Server.
    ScriptLog: DoUplink is not set. Not connecting to Master Server.
    ScriptWarning: TSoldier TH-CountryAbode.TSoldier0 (Function ThieveryAI.TBot.SaveStartupVars:009B) SaveStartupVars() called more than once.
    Critical: appError called:
    Critical: ThieveryDeathMatchPlus TH-CountryAbode.ThieveryDeathMatchPlus0 (Function ThieveryMod.ThieveryDeathMatchPlus.AddToTeam:01B9) Runaway loop detected (over 10000000 iterations)
    Critical: Windows GetLastError: The operation completed successfully. (0)
    Exit: Executing UObject::StaticShutdownAfterError
    Exit: Executing UWindowsClient::ShutdownAfterError
    Exit: UGalaxyAudioSubsystem::ShutdownAfterError
    Exit: UD3DRenderDevice::ShutdownAfterError
    Critical: FFrame::Serialize
    Critical: UObject:rocessEvent
    Critical: (TKnight TH-CountryAbode.TKnight0, Function ThieveryAI.TBot.PostBeginPlay)
    Critical: BeginPlay
    Critical: UGameEngine::LoadMap
    Critical: LocalMapURL
    Critical: UGameEngine::Browse
    Critical: ClientTravel
    Critical: UGameEngine::Tick
    Critical: UpdateWorld
    Critical: MainLoop
    Exit: Exiting.
    Uninitialized: Name subsystem shut down
    Uninitialized: Log file closed, 04/30/03 22:10:56

    Any idea what I'm doing wrong?

    Here is the code to the mutator:

    [code:1:f21cad2431]// The Haunting

    class THaunting expands Mutator;

    function PreBeginPlay() {

    local NavigationPoint CurrentNav, BestNav;
    local ThObjectHousehold ObjHouse;
    local int iMaxObjectCount, iObjectCount;

    foreach AllActors (class'NavigationPoint', CurrentNav) {

    iObjectCount = 0;

    foreach CurrentNav.RadiusActors (class'ThObjectHousehold', ObjHouse, 128.0) {

    iObjectCount++;

    }

    log ("NavigationPoint has " $ String (iObjectCount) $ " objects of class ThObjectHousehold nearby");

    if (iObjectCount > iMaxObjectCount) {

    iMaxObjectCount = iObjectCount;
    BestNav = CurrentNav;
    log ("NavigationPoint is currently the best candidate for spawn");

    }

    }

    if (Spawn (class'ThieveryAI.TSoldier',,, BestNav.Location) != None) {

    log ("Successfully spawned bot");

    } else {

    log ("Unable to spawn bot");

    }

    }[/code:1:f21cad2431]

  • #2
    As far as I can see, there's nothing wrong with your mutator. The problem seems to be with the TBot tho:
    History: FFrame::Serialize <- UObject:rocessEvent <- (TKnight TH-CountryAbode.TKnight0, Function ThieveryAI.TBot.PostBeginPlay) <- BeginPlay <- UGameEngine::LoadMap <- LocalMapURL <- UGameEngine::Browse <- ClientTravel <- UGameEngine::Tick <- UpdateWorld <- MainLoop
    It clearly says that it's ThieveryAI.TBot's PostBeginPlay function that is containing the runaway loop (you used the PreBeginPlay one anyway).
    For some reason I keep getting a protection fault when I try to open the TBot script, so I'm afraid I can't help you much on that matter.
    Only thing I can see as a potential problem about your mutator is the use of PreBeginPlay instead of PostBeginPlay. It just might so happen that when it tries to spawn a bot before the game has initialized, the bot creates an infinite loop due to a missing component or somesuch.

    That's my 2 loot.
    ]V[]V[

    Comment


    • #3
      I switched to PostBeginPlay and got the same results. UnrealEd didn't like TBot on my end either, but then I used ucc to extract all the classes anyway.

      Comment


      • #4
        One last thing:
        Both the ChaosUT mutator and my mutators use this piece of script at the beginning of PostBeginPlay:
        [code:1:350ee0aeb0]if (Initialized)
        return;
        Initialized = True;
        [/code:1:350ee0aeb0]
        I'm thinking it might be that PostBeginPlay and PreBeginPlay triggers multiple times, and in your case, spawns multiple AIs in exactly the same place. Try this:
        [code:1:350ee0aeb0]// The Haunting

        class THaunting expands Mutator;

        var bool Initialized;

        function PreBeginPlay() {

        local NavigationPoint CurrentNav, BestNav;
        local ThObjectHousehold ObjHouse;
        local int iMaxObjectCount, iObjectCount;

        if (Initialized)
        return;
        Initialized = True;

        foreach AllActors (class'NavigationPoint', CurrentNav) {

        iObjectCount = 0;

        foreach CurrentNav.RadiusActors (class'ThObjectHousehold', ObjHouse, 128.0) {

        iObjectCount++;

        }

        log ("NavigationPoint has " $ String (iObjectCount) $ " objects of class ThObjectHousehold nearby");

        if (iObjectCount > iMaxObjectCount) {

        iMaxObjectCount = iObjectCount;
        BestNav = CurrentNav;
        log ("NavigationPoint is currently the best candidate for spawn");

        }

        }

        if (Spawn (class'ThieveryAI.TSoldier',,, BestNav.Location) != None) {

        log ("Successfully spawned bot");

        } else {

        log ("Unable to spawn bot");

        }

        }[/code:1:350ee0aeb0]
        ]V[]V[

        Comment


        • #5
          Whew, I'm past that one now. Thanks. Read on for more fun though. :grin:

          Switching to PostBeginPlay with an initialization check didn't help either. I managed to work around the issue with the following steps:

          1. Mutator spawns a subclass of Actor
          2. New class, because it is an actor, takes advantage of states and preiodically checks for any objects of class ThieveryAI.ThieveryLastTeamStore
          3. Once this condition has been met the actual poltergeist is spawned

          Everything works great in single player mode (of course). However, I get a version mismatch error for my package when I connect to my own server (different machine). The .u and .int files are identical on both ends and all necessary EditPackages/ServerPackages entries are present on both ends. I have even tried deleting the package files on the client (development machine) and letting the server send them to me, but the same thing happens and I don't think the package is even transferred. I can run the TUT server and client simultaneously on my server machine with no mismatch problems, but if I try server + client on my development machine I get the version mismatch error again.

          Is there anything besides differing files that would cause this sort of behavior?

          Comment


          • #6
            Only thing I can imagine is that the machines have different versions of UT or TUT...
            ]V[]V[

            Comment


            • #7
              Ok, resolved now. I had a .utx file with the same name as my package. My bad. ops:

              Comment


              • #8
                thaz not good.

                people don't want to mess up my long column of post monopoly anymore? sad. :cry:
                "Just off the border of your waking mind there lies another time, where darkness and light are one. As you tread the halls of sanity, you feel so glad to be unable to go beyond. I have a message from another time."

                Comment

                Working...
                X