Announcement

Collapse
No announcement yet.

Enabling DynamicShadows via ConsoleCommand() function crashes the engine...?

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

    Enabling DynamicShadows via ConsoleCommand() function crashes the engine...?

    So i'm building my system settings menu, and I've found that whenever I call:
    Code:
    ConsoleCommand("SCALE SET DynamicShadows True");
    from unrealscript, it crashes the game. This error shows in the logs:
    Code:
    [0214.39] Critical: appError called: Rendering thread exception:
    The crazy thing is that if i type that command into the console while in the game, it works fine. This has to be one of those weird UDK quirks.

    Has anyone experienced this, or know how it can be resolved?

    Thanks in advance.

    #2
    What class do you call ConsoleCommand on? Is it self? What class is that or which stock UDK class does it extend from (I'm guessing Actor)?

    I cannot really say whether I have experienced this or a similar problem. But I might have had a couple of Rendering thread exceptions.

    If the command works when entered manually into the ingame console try to use Console::ConsoleCommand or GameViewportClient::ConsoleCommand instead of what you're using currently. You can get the GameViewportClient from the Engine class which you can access using class'Engine'.static.GetEngine(). From there you can just call ConsoleCommand on it or access the ViewportConsole and call ConsoleCommand on that if it's not none.

    Comment


      #3
      I remember having this some time ago and I remember fixing it but can't remember how

      I just checked my code and I still do ConsoleCommand("Scale set DynamicShadows false"); (and true) from the PlayerController.
      is there anything else you're doing on the same function? is the game paused? give more info and we can probably pinpoint it

      Comment


        #4
        @UnrealEverything @Chosker. Thanks for the help as always guys. So I tried as UnrealEverything suggested and made the call on ViewPortConsole:
        Code:
        class'Engine'.static.GetEngine().GameViewport.ViewportConsole.ConsoleCommand("SCALE SET DynamicShadows "$newVal);
        This works without crashing... Yet calling ConsoleCommand on the player controller crashes the engine. This is one of those really weird UDK things that I'll probably never understand. Oh well, at least I have something that works.

        Comment

        Working...
        X