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.
Assign Quickmove to all indexed creatures of an array
Débuté par
wyvern14
, févr. 23 2010 05:56
#1
Posté 23 février 2010 - 05:56
#2
Posté 23 février 2010 - 06:48
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;
}
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
Posté 23 février 2010 - 01:40
I'll give it a shot
#4
Posté 24 février 2010 - 07:46
were you able to get this working?
#5
Posté 24 février 2010 - 08:47
Yup! I completely forgot to update you on it, but it definitely does! 
Cookies for you!
Cookies for you!
#6
Posté 25 février 2010 - 05:47
Sweet! I might need to.. uh hum... "borrow" your code for something I'm trying.





Retour en haut






