In my game I could create many object dinamicly (one, two, three,...) and this object have one function in the game. To create these objects my game read one xml file and I can insert more object in xml. one example (I have 1 player and 1 arrow that follow the player):
Entity* Arrow1;
Entity* player1;

action CPlayer
{
player1 = me;
my.invisible = on;
}

action ArrowAvatar1
{
ArrowAv1 = me;
my.invisible = on;
}

function ArrAv1Pos()
{
while(1)
{
if(player1 !=null)
{
ArrowAv1.x = player1.x ;
ArrowAv1.y = player1.y - 250;
}
wait(1);
}
}

If I create in xml other player and arrow I muss programming before the pointers for these two new object but I want that the function create this entity pointers automatically into the function.

How could I do?