Announcement

Collapse
No announcement yet.

Weapon problem

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

    Weapon problem

    I'm trying to modify a shock rifle. Here's what I'm tryng to do with it:


    class ConcussionRifleFire extends ShockBeamFire;

    defaultproperties

    {
    Momentum=+500.0
    DamageMin=20
    DamageMax=30
    }

    if (EventInstigator.health 1)
    }
    Momentum=+500.0
    DamageMin=101
    DamageMax=101
    }


    If a player has only 1 health, I want it to deal 101 damage. I'd like to do this 100x so for each 1 health the player has -1 damage subtracts (100 health = 1 damage with a shock rifle). Why won't the above work?

    Thanks!

    #2
    Bump. I think this would pretty easy even for an noob programmer.

    Comment


      #3
      :bulb:

      Firstly you can't have:

      Code:
      defaultproperties
      {
      Momentum=+500.0
      DamageMin=20
      DamageMax=30
      }
      That would bring back an error or just not work.

      2nd.

      Code:
      if (EventInstigator.health 1)
      }
      Momentum=+500.0
      DamageMin=101
      DamageMax=101
      }
      Again won't work.

      Not real sure where you're putting these values, but you can't put code in the default properties just labels and values. If you elaborate where you’re putting these values then I can help.

      Comment


        #4
        The first piece of code I know it works. It's from one of the 3D Buzz tutorials. I tried playing with it set up the momentum to 5000 and, well, THAT WORKS.

        I did elaborate these values and I'm thinking here. Well, IF statement says that if the player has =1 health (Event.Instigator) then IT SHOULD set the values of the weapon to the below.

        I posed a different topic a week ago or something you weren't really nice too. I mean, if you do not agree with the official Unreal Script then what are you doing here????

        Comment


          #5
          Be polite. You're the one asking for advice. Morphias is trying to help, he has no obligation to be nice. Taking the time to respond is nice enough.

          What you may have seen from the 3dbuzz tutorials is something like

          Momentum += 500

          That would be Momentum = Momentum + 500. That would make more sense, but for something like this I think you'd be wiser to just use a variable with a constant default property.

          I share Morphias' confusion on exactly where you're putting this stuff. If you've tracked down the firing code, and put your health check in that function, what you describe might work...I haven't looked through that code, so I can't say for sure.

          You do, however, need an operator, your brackets are wrong, and you need to use semis.

          Replace...

          Code:
          if (EventInstigator.health 1)
          }
          Momentum=+500.0
          DamageMin=101
          DamageMax=101
          }
          with...

          Code:
          if (EventInstigator.health == 1)
          {
             Momentum=+500.0;
             DamageMin=101;
             DamageMax=101;
          }
          If you put that in the right spot, then it MIGHT work.

          Comment


            #6
            Thanks. Read left (under my name... Hehe)

            Comment


              #7
              OK, tried to comile the code. Here's what I got so far.

              class ConcussionRifleFire extends ShockBeamFire;

              defaultproperties

              {
              Momentum=+500.0;
              DamageMin=20;
              DamageMax=30;
              }


              if (EventInstigator.health == 1)
              {
              Momentum=+500.0;
              DamageMin=101;
              DamageMax=101;
              }

              It returns an error after I do compile it. It says:
              :Error, Unexpected "if"

              ^This is the same thing that I got an hour ago^

              Comment


                #8
                Originally posted by Krogen
                I posed a different topic a week ago or something you weren't really nice too. I mean, if you do not agree with the official Unreal Script then what are you doing here????
                Funny , I only remember http://www.ataricommunity.com/forums...hreadid=438681 - where I stated I would help you code that vehicle.

                Not helping you one bit now! and i know how to fix your problem.
                Hope you learm more then your manners.

                ******... is no excuse.

                Comment


                  #9
                  Well first your defualt properties should (have to be?) at the end.

                  Second your if statement needs to bein a function where it's going to get processed (i'm guessing if you extended the shockrifle DoFireEfftect would be a good place to stick it)

                  somethinglike so might work:

                  Code:
                  class myFire extends shockbeamfire;
                  
                  function DoFireEffect()
                  {
                      local int iOwnerhealth;
                  
                      if (Instigator.Health >= 101)
                          iOwnerHealth=100;
                      else
                          iOwnerHealth=Instigator.Health;
                  
                      DamageMin = (101-iOwnerHealth);
                      DamageMax = DamageMin;
                  
                      Super.DoFireEffect();
                  }

                  Comment


                    #10
                    Originally posted by Morphias
                    Funny , I only remember http://www.ataricommunity.com/forums...hreadid=438681 - where I stated I would help you code that vehicle.

                    Not helping you one bit now! and i know how to fix your problem.
                    Hope you learm more then your manners.

                    ******... is no excuse.
                    Thanks. You're a really nice person. A person that's trying to elaborate everything. :up: I know you did say that you will do the coding, and yeah, I replied with a thank you (Sorry for you if you didn't see that).

                    Edit. Sorry if you got me wrong but when a person says Nope. Won't do. Nope, won't work either. If I know the above works I know that something's wrong with the person. Basic weapon tutorial. BASIC. Very basic.

                    Comment


                      #11
                      Originally posted by Hsoolien
                      Well first your defualt properties should (have to be?) at the end.

                      Second your if statement needs to bein a function where it's going to get processed (i'm guessing if you extended the shockrifle DoFireEfftect would be a good place to stick it)

                      somethinglike so might work:

                      Code:
                      class myFire extends shockbeamfire;
                      
                      function DoFireEffect()
                      {
                          local int iOwnerhealth;
                      
                          if (Instigator.Health >= 101)
                              iOwnerHealth=100;
                          else
                              iOwnerHealth=Instigator.Health;
                      
                          DamageMin = (101-iOwnerHealth);
                          DamageMax = DamageMin;
                      
                          Super.DoFireEffect();
                      }
                      Thanks! That seems to do it!

                      Comment


                        #12
                        Do you understand why it is yours was not working?

                        Comment


                          #13
                          Not really It's ok though, I'll watch some tutorials and maybe in a month or two.... Hehe.

                          Comment

                          Working...
                          X