Announcement

Collapse
No announcement yet.

Immobilising gun

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

    Immobilising gun

    Hi,

    I'm trying to make a modified version of the lightning gun which stops the target vehicle being able to move or use its weapons for a few seconds, but I'm not sure exactly how to go about doing so. I don't know what function(s) would be called when the vehicle is hit by weaponfire, so I'm not sure where I might be able to place my code to do this correctly.

    Would it be possible to trigger this effect via an extension of the DamageType class? I had a look at the DamageType class and it doesn't look capable of directly applying such special effects to the target, but I'm new to UnrealScript so maybe someone with more experience in unrealscript can suggest how this might be done.

    I've also had a peek at the SniperFire class, but it doesn't seem to do much other than draw the bolt of lightning and set some defaultproperties related to its damage, fire rate, etc.

    Any help would be appreciated.

    Thanks.

    #2
    In the SniperFire class (lightning gun fire class) it finds the thing it hit in the DoTrace function. If you look at this you will see a part about vehicles... if (Vehicle(Other) != None)... this means it hit a vehicle and this is where I would start if I was you.

    You can see how it makes Pawns take damage by simply calling the TakeDamage function of the hit pawn like so.. Other.TakeDamage. So if there are already existing functions or variables in the vehicle class that cause it to shutdown for a few seconds then this is how you would access them.

    For example.

    Code:
    //do trace code
    if (Vehicle(Other) != None)
    {
         Vehicle(Other).Occupied();
    }
    Your best bet is probably to eject the driver and lock the vehicle for a few seconds. You could give the vehicle an inventory item that could monitor the passage of time and unlock it after a few seconds.

    Comment


      #3
      Thanks; sounds like DoTrace is the function I was looking for. I'll check that out in the near future. Thanks for the advice.

      I would rather allow the driver to stay in the vehicle (or maybe even force them to stay in the vehicle), but be unable to steer or use weapons until the appropriate time has elapsed. So I'll need to find a way to disable use of the weapons and movement for the vehicle...

      Comment


        #4
        Originally posted by INIQUITOUS View Post
        Your best bet is probably to eject the driver and lock the vehicle for a few seconds.

        WailofSuicide's EONS EMP mine deployer does something like that:
        http://gearsforums.epicgames.com/sho...d.php?t=644348

        Although apparently you'd prefer to have the driver stay in the vehicle, I though I'd point you towards something that works like what INI suggested, so that you can at least take a look.

        Comment


          #5
          Originally posted by lilalurl View Post
          Although apparently you'd prefer to have the driver stay in the vehicle, I though I'd point you towards something that works like what INI suggested, so that you can at least take a look.
          Thanks for the link. I've been busy with other things recently but I'll take a look and try making my script when I get chance

          Comment

          Working...
          X