Announcement

Collapse
No announcement yet.

Custom animation notify

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

    Custom animation notify

    I've added my own Animation Notify class to my mod:
    Code:
    class ProjectXAnimNotify_SwordBlur extends AnimNotify_Scripted;
    
    event Notify( Actor Owner )
    {
    	assert( Owner != None );
    	assert( Owner.IsA('ProjectXPawn') );
    
    	if( Owner.IsA('ProjectXPawn') )
    	{
    		ProjectXPawn(Owner).AnimNotifyWeaponBlur();
    	}
    }
    I add the notifies to my animation data via UnrealEd and save it as Julie_v03.ukx. I immediately run my mod and the notify appears to work fine.

    However when I recompile my mod's script code, I get an assert from UCC.exe (during the importing phase) when it tries to import the UC file that has a reference to Julie_v03 as a mesh:

    Assertion failed: FriendlyName!=NAME_None [File:.\UnClass.cpp] [Line: 684]

    History: UStruct::Serialize <- (Class Julie_v03.ProjectXAnimNotify_SwordBlur0) <- UState::Serialize <- UClass::Serialize <- (Class Julie_v03.ProjectXAnimNotify_SwordBlur0) <- LoadObject <- (Class Julie_v03.ProjectXAnimNotify_SwordBlur0 442900==442900/1343385 442895 1) <- ULinkerLoad::Preload <- PreLoadObjects <- UObject::EndLoad <- UObject::StaticLoadObject <- (Engine.SkeletalMesh Julie_v03.Julie_v04 NULL) <- UObjectProperty::ImportText <- (ObjectProperty Engine.Actor.Mesh) <- ImportProperties <- ImportPropertiesScripts <- ImportPropertiesScripts <- ImportPropertiesScripts <- ImportPropertiesScripts <- ImportPropertiesScripts <- DoScripts <- UEditorEngine::MakeScripts <- UMakeCommandlet::Main


    Where Julie_v03 is my .ukx animation file. It appears to not like my animation notify in my Julie_v03.ukx file. Note that the ProjectXAnimNotify_SwordBlur class has not been changed.
    I do use the new UT2004 mod directory structure and run both ucc.exe make -MOD=ProjectX and unrealed.exe -MOD=ProjectX. Where ProjectX is my mod's directory name.

    Anyone have a similar problem?

    #2
    Hello!

    I just encountered this problem today. The exact same thing, the notify works but I can't recompile after adding it.

    I wonder if you ever found out why this was happening?! I know you posted this message a longgg time ago, and probably forgot about it, BUT yours was the only message I could find addressing this issue!

    If you can help in any way, I would be really grateful!

    Thanks!

    Comment


      #3
      Rather than making your own subclass of AnimNotify, why not use the existing AnimNotify_Script to call a function within your actor (that's what the NotifyName parameter is used for, providing a function name to call within the actor that is playing the animation) and use that to do what you want?

      *noting that all of the AnimNotify_xxx in my game except for AnimNotify_Trigger are all native .. and i've never seen AnimNotify_Trigger used.. so i have no idea if that works*

      Comment


        #4
        Hey Blade.

        Mostly, for convenience.
        I have about 6 different skeletal meshes (with a custom xpawn class for each), with about 8 custom animations each. They all have to play sounds and do other stuff. I could write custom functions (and call them) for each one of them, but that is not as dynamic as I would want.

        So I made a especial playsound notify, for instance. That notify has just a Enum to select the type of sound (attack, die, etc), and a lot more like sound radius, etc, etc. This notify class, when triggered, is responsible for finding out what kind of xpawn is this, and call the specific actions/sounds on that class (That changes from one to the other).
        It does actually work! BUT the problem is that you can't recompile the code after adding a custom notify on the skeletal mesh. You have to do it after compiling. If you delete the notify, it works again.

        There are ways around it, like you said. I'm probably gonna call a script then, and perhaps make the function on a base class for my custom pawns (and then getting the class type there).

        Thanks for the replay. I was just trying a different approach, that almosttt worked!

        Comment


          #5
          Strangely enough, I also noticed that it happens when I try to add a custom emitter to the Notify_Emitter! Using regular stock emitters works, but the second I subclass one of them and add with a Notify_Effect, the code doesn't compile any more (even if the emitter works). The exact same thing happens.

          Comment

          Working...
          X