Announcement

Collapse
No announcement yet.

[SOLVED] Activate / Call an Kismet Event from UnrealScript

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

    [SOLVED] Activate / Call an Kismet Event from UnrealScript

    Hello,
    As simply its, I want to activate / call an Kismet Event that contains few Matinee animations from UnrealScript.
    Here's my code from MyCustomPlayerInput.uc:
    Code:
    class MyCustomPlayerInput extends PlayerInput within MyCustomlayerController
    	config(Input);
    
    var() bool isPlayAnimation; // Shared with Kismet
    	
    simulated exec function PlayAnimation()
    {
    	isPlayAnimation = true;
    	// Activate Kismet Event
    }
    simulated exec function StopAnimation()
    {
    	isPlayAnimation = false;
    	// Deactivate Kismet Event
    }
    
    defaultproperties
    {
    	isPlayAnimation = false;
    }
    Best Regards,
    Georgian

    #2
    I solved this by myself. Maybe was a stupid idea to post here my question, before try to solve by myself and then post here.

    Comment


      #3
      Can you share your solution please...

      Comment


        #4
        frankit and others, this is a little bit hard to explain, but I'll try. I never wrote a tutorial.
        I'll write the tutorial in few days, if you have patience.

        Comment


          #5
          No rush thanks Georjack!

          Comment


            #6
            I took some time off. Here's my code!

            MyCustomGame.uc
            Code:
            class MyCustomGame extends UDKGame;
            
            defaultproperties
            {
                PlayerControllerClass=class'MyCustomPlayerController'
            }
            MyCustomPlayerController.uc
            Code:
            class MyCustomPlayerController extends UDKPlayerController;
            
            defaultproperties
            {
            	InputClass=Class'MyCustomPlayerInput'
            	SupportedEvents.Add(class'MyCustom_KeyEvent')
            }
            MyCustom_KeyEvent.uc
            Code:
            class MyCustom_KeyEvent extends SequenceEvent;
            
            defaultproperties
            {
            	ObjName="KeyEvent"
            	ObjCategory="My Kismet Events"
            	bPlayerOnly = false
            }
            MyCustomPlayerInput.uc
            Code:
            class MyCustomPlayerInput extends PlayerInput within MyCustomPlayerController
            	config(Input);
            	
            simulated exec function MyCustomFunction()
            {
            	TriggerGlobalEventClass(class'MyCustom_KeyEvent', Pawn);
            }
            
            defaultproperties
            {
            }
            DefaultInput.ini
            Find: "_Gamepad", and here at end of all bindings, above "; Game Controller Bindings", add the following line:
            Code:
            .Bindings=(Name="GBA_MyCustomFunction",Command="MyCustomFunction | onrelease MyCustomFunction | Axis aUp Speed=-1.0 AbsoluteAxis=100")
            You can remove "| onrelease MyCustomFunction", I used this for a Toggle.
            Then find: "; Game Keyboard/Mouse Bindings", and here at end of all bindings, above "; Editor Bindings", add the following line:
            Code:
            .Bindings=(Name="LeftShift",Command="GBA_MyCustomFunction")
            Now Click on UDK Editor and click on "Yes" to make re-compile of all uc files.

            If, compilation will succeed with no errors, open again UDK, select your custom type game and open Kismet Editor.
            Now, on events you can see "My Kismet Events" and inside "KeyEvent".
            Add "KeyEvent" and connect "Console Command" or a New Matinee, then run the game and hit LeftShift Key.

            Well that was it!

            Comment


              #7
              Cheers Georjack!

              Comment

              Working...
              X