View Full Version : Accesing ObjectLists from Script
research
02-20-2010, 10:09 PM
I have multiple ObjectLists defined in Kismet, and I need to search for an object stored in one of those lists, through script.
Is it possible to use some iterator function like foreach AllActors(...) etc. for Kismet Objects?
I can't seem to find any iterators in the parent classes for SeqVar_ObjectList, as all the iterators seem to be in Actors.uc only - none of which refer to accessing of objects.
Could someone please tell if this is possible?
Thanks
Eliot
02-20-2010, 10:25 PM
look inside SequenceOp there is this iterator
native noexport final iterator function LinkedVariables(class<SequenceVariable> VarClass, out SequenceVariable OutVariable, optional string InDesc);
and this function
native final function GetLinkedObjects( out array<SequenceObject> out_Objects, optional class<SequenceObject> ObjectType, optional bool bRecurse );
and you could actually just iterate yourself through the arrays found in that class with foreach like this
foreach ObjList( ... )
{
// do stuff
}
or
local int i;
for( i = 0; i < ObjList.Length; ++ i )
{
if( ObjList[i].IsA('Something' )
{
// do stuff...
}
}
research
02-20-2010, 10:57 PM
Thanks for the reply.
The problem is that these functions only iterate through objects that I connect to the SequenceAction. I need a way to access those ObjectLists that are present in the same Kismet Sequence, but linked to another Sequence Action.
Yes, I could re-link all the objects with Named variables into my new Sequence Action, but there are too many of them, and I was looking for a quick way to access all SeqVar_ObjList variables in the whole kismet sheet. Is there a way to do that, or will I have to do the Named Variables linkage?
research
02-21-2010, 01:29 AM
I found an array that references all sequence Objects in the current sequence
/** List of all scripting objects contained in this sequence */
var const export array<SequenceObject> SequenceObjects;
The only problem is that this is in Sequence.uc, which means I have to extend Sequence class, and not SequenceAction, which is what I need.
Is there a way to get this variable defined in Sequence.uc into my class which extends SequenceAction, as extending from 2 classes is not possible.
Eliot
02-21-2010, 02:11 AM
nope, you'll have to construct yourself the array list or unless there's some array i didn't see.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.