Announcement

Collapse
No announcement yet.

Adrenaline Combo Questions

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

    Adrenaline Combo Questions

    Hello,

    I'm making an adrenaline Combo, called Megablast, and I encountered a few problems while making it.

    Lemme list what it does: ..

    - It has a Timer of 0.02 and lasts 2 secs in total
    - It checks for Players who are not behind an obstacle using an Iterator.
    - It checks if the player it found is a friendly or enemy Player
    - Gets the location of you, as well as the found player, and calculates an angle to aim to
    - Spawns a beam ( ShockBeamEffect ) towards the enemy player
    - Gives Damage to the enemy player
    - If no player is found OR a friendly player is found in that cycle, it will create a random firelocation and angle.
    - If no player is found OR a friendly player is found it will fire the beam to the random location (without damage ).

    So basicly it shoots every 0.02 a beam either to an enemy, or to a random location during 2 seconds, that explains the title "MegaBlast". It looks very cool, and the effect is short but effective.

    Now the problems I've encountered

    - Since I spawn a beam, and not a REAL shot, the target also dies if the shot was aimed wrong. This doesn't noticably happen, but's kinda sloppy anyway.
    - The Iterator also detects players who are in Spawn Protection, this is quite logical that he finds them, but I don't want it, since players in spawn protection can't die ( doh )
    - The Iterator also detects players who are dead, this could be logical I dunno, but I specified in the code that only when the found player has a health higher then 0 ( Targer.Health > 0 ) it shoudl fire at it ELSE choose a random location to shoot at. But it still shoots at dead body's :sulk:
    - The random beams fire straight through anything, they simply wont stop until they reached the (random)target location. This is actually quite logical since it has absolutely no checks on it of that kind at all.

    the 1st and the last problem can be solved by using REAL weapon fire ( I think ... ) , real weaponfire DOES have the geometry checks as far as I know, and it DOES do the damage itself, and not by a sideway.

    BUT !!!.....

    how can I call weaponfire from an adrenaline combo mutator ?!?!....


    I tried the Spawn function .. but that only works on Actors ( like the Beam I'm using at the moment ), and REAL weapon fire is NOT is an Actor ...

    please a little help on this one..I've been working 4 days on this thing ( actually my 1st unreal script I've started ) , and the last 2 days was trying to get some REAL ShockBeamFire :cry:

    The other 2 problems ( problem 2 and 3 ) I didn't really pay attention to yet, so if U accidently know the answers to those, go ahead, but they have no priority..

    thanks in advance

    -Xcal

    #2
    Spawning beam effect will show only visual effect. If you want it to inflict damage you need to perform trace and then apply damage to anything you want (that your trace finds of cource ).
    Check out InstantFire class.

    Comment


      #3
      I know that, I even explained that I know that ...

      What I don't know ( and what the question was ) is how to fire the shot. Thus the trace, thus the beam, thus the search what it hits, and if it should pass through it or not, thus to inflict damage to it or not ...

      All those things allready exist, there must be some way to use them ? Since that the use of OOP right ??

      I dont know where, but there allready even IS a class wich tells the ShockBeamFire class to start .. I need that ... then the trace, the visual effect, etc. will go automaticly.. since they are allready scripted.

      So, the actual question is (and was) :

      How can I run a WeaponFire class FROM a combo class ?

      -Xcal

      Comment


        #4
        You don't "run" classes. You may create instances of given classes and call their member functions. In your case you probably would like to run StartFire() function of Weapon class (ShockRifle). Since your "adrenaline combo" class is not weapon class it can't do that itself. I think most natural way would be to add this functionality yourself (but problem is quite sophisticated - shots should be made serverside to avoid desynchronization, etc. - you would need to duplicate most of weapon class).

        If you want a lazy way, I'm certain there are some more or less "non-elegant" solutions.
        For example you could define your own weapon class (let's say same as shockrifle but invisible (no mesh, no textures...) and then during your adrenaline combo you could spawn such weapons, make them shoot in given direction, and destroy them.

        What is sure - if you want easy way forget WeaponFire classes - they only describe the way weapon fires. Weapons do the firing.

        Or if you're really lazy, you may think of projectiles intead of "beams".

        Comment


          #5
          I think I'll choose one of the easier non-elegant ways since I'm very new to scripting and do NOT want to do TOO fancy stuff

          U say I could spawn an "invisible" weapon .. can I keep it at the Instigator position after spawning it ? as in, can it move with the intigator ?

          -Xcal

          Comment


            #6
            What would be simpler (and what I had in mind) was: spawn weapon, make it shoot, destroy weapon. if you need make beam again then repat this again - spawn weapon, make it shoot, destroy it...

            Comment


              #7
              ok, I'm trying to build it now so far so good, but I'm not far enough to take any conclusions ..

              When spawing something, ur able to give it a rotation right ?
              And how do I make the gun fire ..

              I know how I can get my current gun to fire, but a spawned gun is not really the current gun .. right ?

              Comment


                #8
                Try to call StartFire() function for your spawned gun to make it fire.
                For rotation check SetRotation() function.

                Comment


                  #9
                  What you need is to call the function Tracefire from the position
                  that caries the combo (problebly players lol),create some variables,(playerslocation etc) and call it.

                  Comment


                    #10
                    TraceFire is for ONS weapons .. but it looks like it does the same as DoTrace(Start, Direction) in the WeaponFire class...

                    anywayz, I know the directions, I know the locations( and I got the in variables ) , I think I know how to spawn ... don't quite get it yet why it does spawn a redeemer explosion and a weaponpickup, but not a weapon, or a ShockComboFlare ...

                    But I don't know how I can call to something that Spawned, as in ...

                    spawn(MegablastShooter, Instigator, 'MegablastFire', Instigator.Location, FireDirection);

                    assume this works and spawns a weapon in the correct direction .. with what command can I let it StartFire() :weird:

                    ( Sorry, I probably use wrong terms again, correct me if u see one )

                    -Xcal

                    Comment


                      #11
                      hm ,sorry m8 but my fealing is that your not sure what you are
                      talking about and i very strongly suggest to you to download
                      the sourcecode script from latest version and have a good
                      look in the most important objects (instantfire,xpawn,actor etc)
                      If you do that and just forget your project you are working on for
                      a moment then you ll learn more then asking questions in this forem,im not saying this to flame at you but to help you.
                      succes.

                      Comment


                        #12
                        What did I say .. ?

                        I only asked for a way to let the spawned weapon, fire ...

                        I agree I'm not a superbeeing presuming he knows everything, but may I remind u that out of the 5 questions I asked, only 1 reply was usefull, and then not to fix the problem, but shifting the problem to another phase of the Project. The other replies were merely a repeating to what I said

                        example:

                        I know how I can get my current gun to fire, but a spawned gun is not really the current gun .. right ?
                        answer:

                        Try to call StartFire() function for your spawned gun to make it fire.
                        I really appreciated this answer, but I allready knew how to fire a weapon .. I said it .. I just don't know how to fire it from another class after spawning the weapon who needs to fire it in the other class.

                        So thank u very much, U made me feel like ****

                        Comment


                          #13
                          Originally posted by xcalibur128

                          ...
                          example:

                          quote:I know how I can get my current gun to fire, but a spawned gun is not really the current gun .. right ?

                          answer:

                          quote:Try to call StartFire() function for your spawned gun to make it fire.


                          I really appreciated this answer, but I allready knew how to fire a weapon .. I said it .. I just don't know how to fire it from another class after spawning the weapon who needs to fire it in the other class.
                          This answer I gave you obviosusly relates to spawned weapon (yes spawned gun is not player's current gun - I thought it was retoric question).

                          I never did this but I would try this way:
                          spawnedweapon=Spawn(weapon class and whatever else parameters this functiom requires);
                          spawnedweapon.StartFire();

                          These are very basic questions you asking that mostly could be answered by analysing the original ut200x's utscript code, so nUTcase migh not be completely wrong .

                          Comment


                            #14
                            I'd go with Grzech's first posting. One custom adrenaline combo for ticking, one custom weapon class for shooting. Make the weapon a member of the combo, thus it has not to be recreated every tick. The weapon will adjust itself to the player's position. After 2 seconds and a bit, the combo ends, deleting the weapon with it.

                            Comment


                              #15
                              Grzech:

                              Sorry, I really didn't know, I was distracted by the spawntag ( 3rd parameter )

                              In the unreal editor when building maps, u can use Tags to activate things, example: A button with the event " lightknob " will trigger he light with the Tag "lightknob"

                              I just had no idea how to accomplish this in script ... after some looking at Wiki I figured it out, so yes, I should've and still have to spend more time.

                              I just wonder, why 1 guy ( other topic somewhere ) says, the best way to learn is to do it. While nUTcase liberatly drilled me down when I do so ....

                              Tardis:

                              U mean like updating the weapon location and rotation each 0.02 seconds ?? Or will it REALLY do it automaticly after u spawn it ?

                              Comment

                              Working...
                              X