Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Custerly on Sat 13/01/2024 04:09:36

Title: How to Cycle Through Characters in Script
Post by: Custerly on Sat 13/01/2024 04:09:36
Hi all,

I want to be able to move a dynamic selection of characters by their ID to a certain room via scripting.

In the past, I did this with labels using this code
for (int i = 0;  i < gDialogue.ControlCount;  i++)
{
  Label *theLabel = gDialogue.Controls[i].AsLabel;
  ...
so I am hoping there is a way to do something similar, but with characters.
Title: Re: How to Cycle Through Characters in Script
Post by: Crimson Wizard on Sat 13/01/2024 09:18:28
Yes of course:
https://adventuregamestudio.github.io/ags-manual/GlobalArrays.html
Title: Re: How to Cycle Through Characters in Script
Post by: Custerly on Sat 13/01/2024 16:00:12
Thanks a bunch @Crimson Wizard. I didn't know they were called global arrays, so I couldn't find them in the AGS manual.

If there's ever anything I can do to return the favor for all of the help you've provided me over the past few weeks/months, please let me know.