Announcement

Collapse
No announcement yet.

The maximum safety for states

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

    The maximum safety for states

    Alright so, let's say for instance there is a state which is a state that is a state that you don't ever want to leave it, instance dead state, which you don't want pawns to ever leave it due to that you don't want ragdolls moving around or some like that, any way to say to your class, this state is permanent?
    Some cool unreal projects you may like!


    Developer of GOTA - Survivalism Gladiatorial game Buy the game google gladiators of the arena steam https://store.steampowered.com/app/7..._Of_The_Arena/

    Download the demo Download the demo
    external link Dropbox DropBox

    Become a c++ Professional now C++ Networking Tutorial

    #2
    As far as I'm aware, there should be no state changes called via native code, so only via unrealscript. So if it's leaving it's dead state, then that is essentially a bug in the code. Just drop some logging (and ScriptTrace()) in ExitState() and find where the bug is.

    I guess you could create your own _SetState() and replace all calls with that, then exit if it's in the dead state, but that feels like a hack rather than accounting for error calls elsewhere in script.
    Last edited by Coldscooter; 01-30-2020, 06:57 PM.

    Comment


      #3
      Thanks cold scooter for your help, sadly there is not such a thing Permanent states all one can do it's blank functions inside the states.
      GoToStateEatBanana(){
      self.GoToState('EatBanana')
      ;}
      state EatBanana
      {
      GoToStateEatBanana( ) {coolaccentLOG("PermaState becareful");}
      }
      Some cool unreal projects you may like!


      Developer of GOTA - Survivalism Gladiatorial game Buy the game google gladiators of the arena steam https://store.steampowered.com/app/7..._Of_The_Arena/

      Download the demo Download the demo
      external link Dropbox DropBox

      Become a c++ Professional now C++ Networking Tutorial

      Comment


        #4
        Neongho I may not be fully understanding, but in the EndState() function, you have NextStateName, so logging that would at least help you track down what's calling the new state change.

        I also believe you can just add:
        Code:
        event BeginState(name PreviousStateName)
        {
            super.BeginState(PreviousStateName);
        }
        event EndState(name NextStateName)
        {
            super.EndState(NextStateName);
        }
        outside of any state, and providing the state functions call the super function, these should be called. I haven't fully tested this though.

        Comment

        Working...
        X