Calling Kismet From Scaleform

I posted this function in my latest video “UDK Tutorial: Scaleform Menu“, but it’s quite useful so I just thought I’d put it here as well. If you’ve ever tried to call a Kismet Remote Event from Scaleform, you’ll realize that it doesn’t work (at least for May 2011 and prior…I’m not sure about the later builds). The answer is to add this function to your custom GFxMoviePlayer class:

function TriggerRemoteKismetEvent( name EventName )
{
 local array<SequenceObject> AllSeqEvents;
 local Sequence GameSeq;
 local int i;
 GameSeq = GetPC().WorldInfo.GetGameSequence();
 if(GameSeq != None)
 {
  GameSeq.FindSeqObjectsByClass(class'SeqEvent_RemoteEvent', true, AllSeqEvents);
  for(i = 0; i < AllSeqEvents.Length; i++)
  {
   if(SeqEvent_RemoteEvent(AllSeqEvents[i]).EventName == EventName)
    SeqEvent_RemoteEvent(AllSeqEvents[i]).CheckActivate(GetPC().WorldInfo, None);
  }
 }
}

Then, calling a Remote Event such as “Open_Menu” is as easy as doing TriggerRemoteKismetEvent(“Open_Menu”)!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s