Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. origins mud removal

origins mud removal

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
9 Posts 5 Posters 2.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Angry Cat Offline
    Angry Cat Offline
    Angry Cat
    wrote on last edited by Angry Cat
    #1
    init()
    {
    level.a_e_slow_areas = 0;
    }
    

    my first script ive ever made, i did this about a month ago with help (just compile the code above)

    JezuzLizard 1 Reply Last reply
    1
    • hindercanrun Offline
      hindercanrun Offline
      hindercanrun
      Contributor
      wrote on last edited by
      #2

      one line in init

      Angry Cat 1 Reply Last reply
      0
      • hindercanrun hindercanrun

        one line in init

        Angry Cat Offline
        Angry Cat Offline
        Angry Cat
        wrote on last edited by
        #3

        hindercanrun i barely even know how to code lol

        1 Reply Last reply
        0
        • Angry Cat Angry Cat
          init()
          {
          level.a_e_slow_areas = 0;
          }
          

          my first script ive ever made, i did this about a month ago with help (just compile the code above)

          JezuzLizard Offline
          JezuzLizard Offline
          JezuzLizard
          Plutonium Staff
          wrote on last edited by
          #4

          Angry Cat It would be more correct to do

          level.a_e_slow_areas = [];
          

          It just depends on whether foreach throws a script error if it tries to iterate over a non array.

          Script errors can cause instability in some cases, it's wise to write code that doesn't cause them.

          Angry Cat 1 Reply Last reply
          1
          • JezuzLizard JezuzLizard

            Angry Cat It would be more correct to do

            level.a_e_slow_areas = [];
            

            It just depends on whether foreach throws a script error if it tries to iterate over a non array.

            Script errors can cause instability in some cases, it's wise to write code that doesn't cause them.

            Angry Cat Offline
            Angry Cat Offline
            Angry Cat
            wrote on last edited by
            #5

            JezuzLizard ok thanks

            1 Reply Last reply
            0
            • Gabbyxo97 Offline
              Gabbyxo97 Offline
              Gabbyxo97
              Contributor
              wrote on last edited by
              #6

              Thanks for this! Useful for if I ever want to play Origins but just have a slightly easier less annoying time

              Angry Cat 1 Reply Last reply
              0
              • Gabbyxo97 Gabbyxo97

                Thanks for this! Useful for if I ever want to play Origins but just have a slightly easier less annoying time

                Angry Cat Offline
                Angry Cat Offline
                Angry Cat
                wrote on last edited by
                #7

                Gabbyxo97 no problem

                1 Reply Last reply
                0
                • JuiceTrailer62 Offline
                  JuiceTrailer62 Offline
                  JuiceTrailer62
                  wrote on last edited by
                  #8

                  if you want to turn the mud back on you can also do level.a_e_slow_areas = getentarray( "player_slow_area", "targetname" );

                  you can also target the mud and instead of disabling it you can increase or decrease the player movement speed in it. example

                  while( true ) {
                      ary = level.a_e_slow_areas;
                      num = getfirstarraykey( ary );
                      while( isdefined( num ) ) {
                          area = ary[ num ];
                          if( self istouching( area ) ) {
                              self setclientfieldtoplayer( "sndmudslow", 0 );
                              self notify( "mud_slowdown_cleared" );
                              continue;
                          }
                          else {
                              num = getnextarraykey( ary, num );
                          }
                      }
                      self setmovespeedscale( <speed> );
                      wait .05;
                  }
                  JuiceTrailer62 1 Reply Last reply
                  0
                  • JuiceTrailer62 JuiceTrailer62

                    if you want to turn the mud back on you can also do level.a_e_slow_areas = getentarray( "player_slow_area", "targetname" );

                    you can also target the mud and instead of disabling it you can increase or decrease the player movement speed in it. example

                    while( true ) {
                        ary = level.a_e_slow_areas;
                        num = getfirstarraykey( ary );
                        while( isdefined( num ) ) {
                            area = ary[ num ];
                            if( self istouching( area ) ) {
                                self setclientfieldtoplayer( "sndmudslow", 0 );
                                self notify( "mud_slowdown_cleared" );
                                continue;
                            }
                            else {
                                num = getnextarraykey( ary, num );
                            }
                        }
                        self setmovespeedscale( <speed> );
                        wait .05;
                    }
                    JuiceTrailer62 Offline
                    JuiceTrailer62 Offline
                    JuiceTrailer62
                    wrote on last edited by
                    #9

                    JuiceTrailer62 thinking about it that will probably crash, I don't know just made it up, but someone will get it and fix it probably

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Unread 0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Donate