Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SilverSpook on Thu 29/06/2017 03:53:48

Title: Interating through all Objects in game or in a room
Post by: SilverSpook on Thu 29/06/2017 03:53:48
Hi, is there a way to get an array of all of the objects in a room?  I know for characters you can use 'character[]' but I was wondering if there's a way to get all of the objects to perform a function on them, one by one.
Title: Re: Interating through all Objects in game or in a room
Post by: Gurok on Thu 29/06/2017 04:00:17
Yes, there is a corresponding object array that you can iterate through like so:

for(int i = 0; i < Room.ObjectCount; i++)
    DoSomethingTo(object[i]);