Announcement

Collapse
No announcement yet.

"Trap": won't trigger

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

    #16
    Maybe not for you Wormbo. Beginners will have trouble. Especially with phrases like this floating around.

    Complication: Now that you can have functions (like "Touch") overridden in multiple states as well as in child classes, you have the burden of figuring out exactly which "Touch" function is going to be called in a specific situation. UnrealScript provides rules which clearly delineate this process, but it is something you must be aware of if you create complex hierarchies of classes and states.
    That is what I was talking about.

    I often think ahead and imagine circumstances the current coder might not be aware of or might have changed without mentioning it to us. As you can see I suggested the bWorldGeometry property several posts ago. And added the bCollideWorld as I had already came to the conclusion he was probably misplacing the actor in the editor (actually when I made my own version I created a test map and confirmed this). I hesitated whether to talk about Physics but at this early stage I thought it best not to confuse anymore than needed!

    Comment


      #17
      Originally posted by Wormbo View Post
      No, it's not. If an actor is in a state and that state contains a Touch() event, that one will be called instead of a non-state Touch().
      Thanks Wormbo, that's what I had assumed. I was slightly confused when iniquitous stated otherwise; no offence iniquitous, you've been very helpful

      Originally posted by INIQUITOUS

      Quote:
      Complication: Now that you can have functions (like "Touch") overridden in multiple states as well as in child classes, you have the burden of figuring out exactly which "Touch" function is going to be called in a specific situation. UnrealScript provides rules which clearly delineate this process, but it is something you must be aware of if you create complex hierarchies of classes and states.
      That is what I was talking about.
      I can see how some beginners may find the concept difficult to grasp if they have little or no programming experience, but fortunately as a programmer I am very familiar with overriding methods, so while I have never dealt with "states" before, it seemed logical that a state-specific function would be called in place of a non-state-specific one, if the object is in that state.

      Originally posted by Wormbo
      bWorldGeometry means the actor is world geometry. Falling through world geometry can only happen if the actor can move (e.g. Physice=PHYS_Falling) and does not bCollideWorld. It doesn't apply to immobile actors at all unless they are placed inside solid BSP.
      Thanks for the clarification. Given the result of setting bWorldGeometry=false, I assume that INI was correct about touch() not applying to world geometry?

      Comment


        #18
        As a side-question, I copied the syntax I used "Pawn(a)" from another method I saw in the source of a class; is this the UnrealScript standard for class casting? Could I, for example, use the following code to make my "trap" only be triggered by vehicles?

        Code:
        //...
        
        function touch(Actor a)
         {
         local Vehicle v;
         v=Vehicle(a);
         
         if(v==None)
          return;
         
         //... continue with method
         }
        
        //...
        Tried it; works. Clearly I was right

        Comment

        Working...
        X