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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] Move Slide Care Package to new Position?

[Support] Move Slide Care Package to new Position?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
22 Posts 8 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sassundefined Offline
    Sassundefined Offline
    Sass Plutonium Staff
    replied to Ducxy on last edited by
    #10

    Ducxy This still doesn't move or replace the first crate, which is literally the question that was asked. But I guess you can go this way.

    1 Reply Last reply
    0
    • Radonundefined Offline
      Radonundefined Offline
      Radon
      replied to Rynoxar on last edited by
      #11

      @NOXSYS said in Move Slide Care Package to new Position?:

      How I can move my Slide Care Package to a new Position or delete the old Slide and Create a new one. So no one can abuse the Create Slide command?

      Just make a delete function which deletes the model and kills the thread. Then let the player spawn in a new one:

      self addTextOption(<menu>, "Bounce", self.hasBounce ? "^1Delete" : "^2Spawn", ::<functions>);
      

      Something like that

      1 Reply Last reply
      0
      • Soccer1978undefined Offline
        Soccer1978undefined Offline
        Soccer1978
        replied to Ducxy on last edited by
        #12

        Ducxy this code doesnt seem to work for me

        1 Reply Last reply
        0
        • Sassundefined Offline
          Sassundefined Offline
          Sass Plutonium Staff
          wrote on last edited by
          #13

          I came up with a new script. It's basically a "Create/Move Slide" function; it will spawn a slide the first time you use it, and move it if you use the function again. Slides spawns/moves wherever you place your crosshair. There's no delete function, but you can just move it out of the map if you want it off the way.

          • Call manageSlides in your menu.
          • Copy the following in your file :
          manageSlides()
          {
              self endon("death");
              self endon("disconnect");
          
              start = self getTagOrigin("tag_eye");
              end = anglestoforward(self getPlayerAngles()) * 1000000;
              slidePos = BulletTrace(start, end, true, self)["position"] + (0,0,15);
              slideAng = self getPlayerAngles();
          
              if(!isDefined(self.slide))
              {
                  self.slide = spawn("script_model", slidePos);
                  self.slide.angles = (0, slideAng[1] - 90, 70);
                  self.slide setModel("t6_wpn_supply_drop_trap");
              }
              else
              {
                  self.slide RotateTo((0, slideAng[1] - 90, 70), 0.1, 0, 0 );
                  self.slide MoveTo(slidePos, 0.1, 0, 0 );
                  self.slide notify("restartSlideThink"); // Killing thread so it doesn't duplicate
              }
              
              self.slide thread slideThink(slidePos,slideAng);
          }
          
          slideThink(origin, angles)
          {
              self endon("restartSlideThink");
          	
              for(;;)
              {
                  foreach(player in level.players)
                  {
                      if( distance(player.origin, origin) < 100 && player meleeButtonPressed() && player isMeleeing() && length(anglesXY(player getPlayerAngles() - angles)) < 90)
                      {
                          vec = anglesToForward(player.angles);
                          for(i = 0; i < 10; i++)
                          {
                              player setVelocity(player getVelocity() + ( vec[0]*(50) , vec[1]*(50), 200 ));
                              wait .01;
                          }
                      }
                  }
                  wait .1;
              }
          }
          
          anglesXY(angles)
          {
              return (angles[0], angles[1], 0);
          }
          
          Soccer1978undefined Rynoxarundefined kalazh441undefined 3 Replies Last reply
          0
          • Soccer1978undefined Offline
            Soccer1978undefined Offline
            Soccer1978
            replied to Sass on last edited by
            #14

            Sass Thanks, works great! Do u maybe know how i make the slides stronger?

            Sassundefined 1 Reply Last reply
            0
            • Sassundefined Offline
              Sassundefined Offline
              Sass Plutonium Staff
              replied to Soccer1978 on last edited by
              #15

              Soccer1978 You'll have to edit this line. Change both "50" to something higher :

              player setVelocity(player getVelocity() + ( vec[0]*(50), vec[1]*(50), 200 ));

              1 Reply Last reply
              0
              • Rynoxarundefined Offline
                Rynoxarundefined Offline
                Rynoxar Contributor
                replied to Sass on last edited by
                #16

                Sass said in Move Slide Care Package to new Position?:

                I came up with a new script. It's basically a "Create/Move Slide" function; it will spawn a slide the first time you use it, and move it if you use the function again. Slides spawns/moves wherever you place your crosshair. There's no delete function, but you can just move it out of the map if you want it off the way.

                • Call manageSlides in your menu.
                • Copy the following in your file :
                manageSlides()
                {
                    self endon("death");
                    self endon("disconnect");
                
                    start = self getTagOrigin("tag_eye");
                    end = anglestoforward(self getPlayerAngles()) * 1000000;
                    slidePos = BulletTrace(start, end, true, self)["position"] + (0,0,15);
                    slideAng = self getPlayerAngles();
                
                    if(!isDefined(self.slide))
                    {
                        self.slide = spawn("script_model", slidePos);
                        self.slide.angles = (0, slideAng[1] - 90, 70);
                        self.slide setModel("t6_wpn_supply_drop_trap");
                    }
                    else
                    {
                        self.slide RotateTo((0, slideAng[1] - 90, 70), 0.1, 0, 0 );
                        self.slide MoveTo(slidePos, 0.1, 0, 0 );
                        self.slide notify("restartSlideThink"); // Killing thread so it doesn't duplicate
                    }
                    
                    self.slide thread slideThink(slidePos,slideAng);
                }
                
                slideThink(origin, angles)
                {
                    self endon("restartSlideThink");
                	
                    for(;;)
                    {
                        foreach(player in level.players)
                        {
                            if( distance(player.origin, origin) < 100 && player meleeButtonPressed() && player isMeleeing() && length(anglesXY(player getPlayerAngles() - angles)) < 90)
                            {
                                vec = anglesToForward(player.angles);
                                for(i = 0; i < 10; i++)
                                {
                                    player setVelocity(player getVelocity() + ( vec[0]*(50) , vec[1]*(50), 200 ));
                                    wait .01;
                                }
                            }
                        }
                        wait .1;
                    }
                }
                
                anglesXY(angles)
                {
                    return (angles[0], angles[1], 0);
                }
                

                I LOVE YOU 😍

                1 Reply Last reply
                0
                • kalazh441undefined Offline
                  kalazh441undefined Offline
                  kalazh441
                  replied to Sass on last edited by
                  #17

                  Sass Thanks alot <333

                  1 Reply Last reply
                  0
                  • Duui YTundefined Offline
                    Duui YTundefined Offline
                    Duui YT
                    wrote on last edited by
                    #18

                    Sass how can i mind it bec when i do this it works but when they die they cant do it again

                    buttonMonitorSlides()
                    {
                        self endon("death");
                        self endon("disconnect");
                        
                        for(;;)
                        {
                            if(self getStance() != "prone" && self actionslotthreebuttonpressed())
                                self manageSlides();
                            wait .05;
                        }
                    } 
                    
                    Cahzundefined 1 Reply Last reply
                    0
                    • Cahzundefined Offline
                      Cahzundefined Offline
                      Cahz VIP
                      replied to Duui YT on last edited by
                      #19

                      Duui YT said in [Support] Move Slide Care Package to new Position?:

                      self endon("death");

                      self endon("death");

                      self endon("death");

                      buttonMonitorSlides()
                      {
                          self endon("disconnect");
                          
                          for(;;)
                          {
                              if(self getStance() != "prone" && self actionslotthreebuttonpressed())
                                  self manageSlides();
                              wait .05;
                          }
                      }
                      

                      Literally one line of code dude. Please read the code before posting on the forums 😞

                      Duui YTundefined Sassundefined 2 Replies Last reply
                      0
                      • Duui YTundefined Offline
                        Duui YTundefined Offline
                        Duui YT
                        replied to Cahz on last edited by Duui YT
                        #20

                        Cahz is it possible to make it spawn next to you intend at cross hair i cant finger it out

                        1 Reply Last reply
                        0
                        • Sassundefined Offline
                          Sassundefined Offline
                          Sass Plutonium Staff
                          replied to Cahz on last edited by
                          #21

                          The self endon("death"); is intentional. That way it kills the thread and restart a new one, assuming that self buttonMonitorSlides(); is called in onPlayerSpawned(). This prevents the function to restart over and over again.

                          1 Reply Last reply
                          1
                          • Duui YTundefined Offline
                            Duui YTundefined Offline
                            Duui YT
                            wrote on last edited by Duui YT
                            #22

                            Sass
                            so this (50) changes how for you go add this how high you go 200 but it dose not do anything when i make it higher or lower is there a different way to make it send me higher up

                            player setVelocity(player getVelocity() + ( vec[0]*(50) , vec[1]*(50), 200 )); 
                            
                            1 Reply Last reply
                            0

                            • 1
                            • 2
                            • Login

                            • Don't have an account? Register

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