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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] How do i delete bounces?

[Support] How do i delete bounces?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
7 Posts 4 Posters 236 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.
  • ImVeryTwistedundefined Offline
    ImVeryTwistedundefined Offline
    ImVeryTwisted
    wrote on last edited by Mr. Android
    #1

    Here's my bounce code:

    bounce()
    {
    trampoline = spawn( "script_model", self.origin );
    trampoline setmodel( "t6_wpn_supply_drop_ally" );
    foreach( player in level.players )
    {
    player iPrintln("Bounce Created By: ^2" + self.name);
    player thread monitortrampoline( trampoline );
    }

    }

    monitortrampoline( model )
    {
    self endon( "disconnect" );
    level endon( "game_ended" );
    for(;;)
    {
    if( distance( self.origin, model.origin ) < 85 )
    {
    if( self isonground() )
    {
    self setorigin( self.origin );
    }
    self setvelocity( self getvelocity() + ( 0, 0, 999 ) );
    }
    wait 0.01;
    }

    }

    I just need a function that deletes all the bounces by that player . Sorry if it seems like a lot, having issues getting it to work

    Sassundefined 1 Reply Last reply
    0
    • ImVeryTwistedundefined ImVeryTwisted

      Here's my bounce code:

      bounce()
      {
      trampoline = spawn( "script_model", self.origin );
      trampoline setmodel( "t6_wpn_supply_drop_ally" );
      foreach( player in level.players )
      {
      player iPrintln("Bounce Created By: ^2" + self.name);
      player thread monitortrampoline( trampoline );
      }

      }

      monitortrampoline( model )
      {
      self endon( "disconnect" );
      level endon( "game_ended" );
      for(;;)
      {
      if( distance( self.origin, model.origin ) < 85 )
      {
      if( self isonground() )
      {
      self setorigin( self.origin );
      }
      self setvelocity( self getvelocity() + ( 0, 0, 999 ) );
      }
      wait 0.01;
      }

      }

      I just need a function that deletes all the bounces by that player . Sorry if it seems like a lot, having issues getting it to work

      Sassundefined Offline
      Sassundefined Offline
      Sass
      Plutonium Staff
      wrote on last edited by Sass
      #2

      You can't do that with the function you have, because it doesn't link "trampoline" to a player entity. Use something like self.trampoline[i] so you can manage them better. i would be an incremented integer.

      loop_undefined 1 Reply Last reply
      0
      • Sorexundefined Offline
        Sorexundefined Offline
        Sorex
        Contributor
        wrote on last edited by
        #3

        You can but,,,
        You need another function to end the Thread and to move the bounce in another position if u can't delete the entity

        1 Reply Last reply
        0
        • Sassundefined Sass

          You can't do that with the function you have, because it doesn't link "trampoline" to a player entity. Use something like self.trampoline[i] so you can manage them better. i would be an incremented integer.

          loop_undefined Offline
          loop_undefined Offline
          loop_
          Banned
          wrote on last edited by
          #4

          Sass your a fucking bitch lol, if (sass;bitch)

          Sassundefined 1 Reply Last reply
          0
          • loop_undefined loop_

            Sass your a fucking bitch lol, if (sass;bitch)

            Sassundefined Offline
            Sassundefined Offline
            Sass
            Plutonium Staff
            wrote on last edited by
            #5

            loop_ This isn't even correct lmao

            ImVeryTwistedundefined 1 Reply Last reply
            0
            • Sassundefined Sass

              loop_ This isn't even correct lmao

              ImVeryTwistedundefined Offline
              ImVeryTwistedundefined Offline
              ImVeryTwisted
              wrote on last edited by
              #6

              Sass once i do that do you do

              if (self.numberOfBounces > 0)
              {
              for(i = 0; i < self.numberOfBounces ; i++)
              {
              self.bounce[i] destroy();
              self.numberOfBounces -= 1;
              wait .01;
              }
              }

              because that doesn't work for me

              Sassundefined 1 Reply Last reply
              0
              • ImVeryTwistedundefined ImVeryTwisted

                Sass once i do that do you do

                if (self.numberOfBounces > 0)
                {
                for(i = 0; i < self.numberOfBounces ; i++)
                {
                self.bounce[i] destroy();
                self.numberOfBounces -= 1;
                wait .01;
                }
                }

                because that doesn't work for me

                Sassundefined Offline
                Sassundefined Offline
                Sass
                Plutonium Staff
                wrote on last edited by
                #7

                This snippet looks good to me

                1 Reply Last reply
                0
                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
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Donate