Aller au contenu

Photo

Assign Quickmove to all indexed creatures of an array


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
wyvern14

wyvern14
  • Members
  • 107 messages
Alright, here's the deal:


I have teams of NPCs to move, they each have the same # of waypoints to walk in each group, all placed in the area. I want them all to move to their final waypoints, following the route I have given them. Instead of calling them individually, cause that would be a pain, I'm trying to call one array per team to do a UT_QuickMove for each of their members.

So far, only 1 creature per team is doing what it's supposed to do. Help!


case STAGECALL_1:
           {
            object[] oTeam = GetTeam(10, OBJECT_TYPE_CREATURE);
            int nSize = GetArraySize(oTeam);
            int index;
            string sTeam = GetTag(oTeam[index]);

            for (index = 0; index < nSize; index++)
            {
                UT_QuickMove(sTeam, "4", FALSE, TRUE, TRUE, TRUE);
                Ambient_OverrideBehaviour(oTeam[index], 2, 3.5, -1);
            }
            break;
           }

I'm not sure what I need to change in this code, and I'm not all that familiar with arrays. It works if I ask something similar to this to, let's say, apply visual effects, but not to move along unique paths per person in the array.

#2
Uneedusman

Uneedusman
  • Members
  • 19 messages
I'm a programmer, but I haven't done any scripting in DA...
Shouldn't the "string sTeam = GetTag(oTeam[index]);" line be moved before the "UT_QuickMove(sTeam, "4", FALSE, TRUE, TRUE, TRUE);" line?  Otherwise, only the first creature in the team would always be one affected by the QuickMove.

Like this:

case STAGECALL_1:
{
object[] oTeam = GetTeam(10, OBJECT_TYPE_CREATURE);
int nSize = GetArraySize(oTeam);
int index;
string sTeam;
for (index = 0; index
{
sTeam = GetTag(oTeam[index]);
UT_QuickMove(sTeam, "4", FALSE, TRUE, TRUE, TRUE);
Ambient_OverrideBehaviour(oTeam[index], 2, 3.5, -1);
}
break;
}

Modifié par Uneedusman, 23 février 2010 - 07:43 .


#3
wyvern14

wyvern14
  • Members
  • 107 messages
I'll give it a shot :)

#4
Uneedusman

Uneedusman
  • Members
  • 19 messages
were you able to get this working?

#5
wyvern14

wyvern14
  • Members
  • 107 messages
Yup! I completely forgot to update you on it, but it definitely does! :)



Cookies for you!

#6
Uneedusman

Uneedusman
  • Members
  • 19 messages
Sweet! I might need to.. uh hum... "borrow" your code for something I'm trying. :)