Announcement

Collapse
No announcement yet.

Landmine

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

    Landmine

    I want to make a XMP style land mine for normal UT2004

    I am planning to use the translocator mesh as a basis and code extra stuff around that

    Does anyone know where you can get XMP .uc files??

    Thanks

    blip2

    #2
    I need the mine to blow up when a vehicle goes over it not just when a player goes over it (not in vehicle) Heres the code i've got to get it to blow up:

    function Touch(Actor Other)
    {
    if (Pawn(Other) != None)
    {
    Other.PendingTouch = self;
    PendingTouch = Other;
    }
    }

    function PostTouch(Actor Other)
    {
    local Pawn P;

    P = Pawn(Other);
    if (P != None)
    {
    PlaySound(BlowupSound,,3.0*TransientSoundVolume);
    spawn(BlowupEffect,,,P.Location - P.CollisionHeight * vect(0,0,1));
    P.AddVelocity(ChuckVelocity);
    P.Died(None, DamageType, P.Location);
    }
    }

    Any ideas on how to get anything to blow it up (weapons too?)

    blip2

    Comment


      #3
      What are you subclassing?


      My reccomendation check out the BioGlob, once all the stuff for varying saize and damage is remived, it blows up when you shoot it, runover it with anythingt...


      The whole thing is state based... (awlays fun for newer coders)

      The state you'r looking at is:
      sate onGround

      the funcitons:

      TakeDamage (this works as soon as bProjTarget = True)

      Will cause it to blow up when it's shot

      And:
      ProcessTouch(Actor Other, vector Hitlocation)

      is where you make it blow up when touched by anything you wnat it to blow up on

      Pawn(Other) will get all vecs and players (since vec's are pawns)

      Also if you wish to delay the explosion use a timer...

      Comment


        #4
        hmm i got the exploding bit working fine now by using some code from the deemer (random as hell)(p.s. it looks really good)

        i just can't get it to destroy it self once it blows up, but working on it

        blip2

        Comment


          #5
          In whatever functin blows it up make sure to call Self.Destroy() (after all damage and effects have been done)

          Comment


            #6
            right thanks that worked

            any ideas on how to stop it colliding with actors/playors/weapons even though it needs collision to trigger the explosion ?

            blip2 (signing off for the night)

            Comment


              #7
              Now that's weird that it would actually collide...

              What are you collisoin settings for it?

              Comment


                #8
                no its just vehicle weapons destroy it but normal weapons don't (explode early)

                blip2

                Comment


                  #9
                  Originally posted by blip2
                  no its just vehicle weapons destroy it but normal weapons don't (explode early)

                  blip2
                  So what are the collison settings on it (or what does it subclass)

                  Comment

                  Working...
                  X