1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Ignoring States

Discussion in 'Programming' started by RestInPieces, Sep 23, 2001.

  1. RestInPieces

    RestInPieces New Member

    Joined:
    Sep 20, 2001
    Messages:
    65
    Likes Received:
    0
    hi everybody, ive got a litte prob.
    I want to code a weapon which freezes all enemies in a certain radius. These enemies will then go to a state called "frozen".
    I want them to stay in this state, so i wanted to ignore all other states like this:

    state Frozen
    {
    ignores Attacking,...// all the states i want ignored
    }

    But then the compiler said: Attacking is not a function.
    Can't i ignores states? Is there any possibiliy to ignore states? Did i make a syntax mistatke?
     
  2. usaar33

    usaar33 Un1337

    Joined:
    Mar 25, 2000
    Messages:
    808
    Likes Received:
    0
    Ignore states?
    What do you mean by that?

    If you want to freeze them, just change their physics, set their accel to (0,0,0), disable tick, and freeze their animation.
     
  3. Bytekeeper

    Bytekeeper Last of the Brunnen G

    Joined:
    Jul 15, 2001
    Messages:
    181
    Likes Received:
    0
    You can't "ignore" states,
    Just ignore or overwrite the functions which would leave your state...
    Those are mainly events like Timer(), Tick(), Touch() etc.
     
  4. RestInPieces

    RestInPieces New Member

    Joined:
    Sep 20, 2001
    Messages:
    65
    Likes Received:
    0
    Well, actually, thats what i did, but i thought ignoring the states, meaning the ignored states cannont be called on the pawn who ist in the state frozen, would be a "cleaner" solution...
    Well, at least no i know that it doesn't work, thanX
     
  5. ca

    ca CHiMERiC Grandmaster

    Joined:
    Oct 11, 1999
    Messages:
    84
    Likes Received:
    0
    Ignore doesn't work with states, and it only works with certain (ai-related) functions. If you want a function to not be called just override it:

    state Iced
    {
    function DoSomething()
    {
    }

    function DoSomethingElse();
    }

    ... etc
     
  6. Bytekeeper

    Bytekeeper Last of the Brunnen G

    Joined:
    Jul 15, 2001
    Messages:
    181
    Likes Received:
    0
    It actually work with all functions :)
    But ignores are not inherited: if you overwrite the state you kill the old ignores, therefore most code which is meant to be inherited doesn't use ignore but overwrite the old functions with empty new ones ( like ie. engine.weapon does )

    @Restinpeaces:
    You can use a "trick" to "ignore" other states. Everytime a state is about be be left, endstate() is called, so you just put a gotostate in your state.endstate function to redirect to your state again.
     
  7. RestInPieces

    RestInPieces New Member

    Joined:
    Sep 20, 2001
    Messages:
    65
    Likes Received:
    0
    Cooooooool

    This is cool
    Thanks !
     
  8. ca

    ca CHiMERiC Grandmaster

    Joined:
    Oct 11, 1999
    Messages:
    84
    Likes Received:
    0
    No, ignore is broken - try ignoring Fire() in a weapon state and it'll call the global version instead of not calling the function. Steve has confirmed that this is broken behaviour...
     
  9. RestInPieces

    RestInPieces New Member

    Joined:
    Sep 20, 2001
    Messages:
    65
    Likes Received:
    0
    Err,.... anyone can tell me how to freeze an anim? :(
     
  10. Bytekeeper

    Bytekeeper Last of the Brunnen G

    Joined:
    Jul 15, 2001
    Messages:
    181
    Likes Received:
    0
    Yeap @ ca, I had some weird problems with my dying state for bots. At first it didn't ignore anything, then I copied the line out of bots, and even then some functions where called :( Which I then have overwritten. So I don't use ignore anymore if I can ;)
     
  11. usaar33

    usaar33 Un1337

    Joined:
    Mar 25, 2000
    Messages:
    808
    Likes Received:
    0
    wow, it always.... seemed... to work for me :)
     
  12. RestInPieces

    RestInPieces New Member

    Joined:
    Sep 20, 2001
    Messages:
    65
    Likes Received:
    0
    or can't anims be "frozen"?
     
  13. trasko

    trasko New Member

    Joined:
    Sep 28, 2001
    Messages:
    7
    Likes Received:
    0
    blah

    sorry i can't help -- i know this sounds sort of hard since bots are heavily AI driven. but, i'd imagine there is some way to interrupt all that to freeze the animation.

    i'll keep my eye peeled.

    trasko
     
  14. RestInPieces

    RestInPieces New Member

    Joined:
    Sep 20, 2001
    Messages:
    65
    Likes Received:
    0
    YIPIIIIIIIIIIIIIIIIIIIEEEEE! found it out!
    AnimRate=0;
    thats all you have to do in order to freeze the anim :cool:
    Thanks to everybody who helped me with my States/Anim problem!
     

Share This Page