![]() |
|
#1
|
|||
|
|||
Hi,
That means you are trying to index into the avatar list with a value greater than the size of the list. Are you deleting items from the avatar list after you create it? If so then you need to change the way you increment to the next avatar: Code:
nextAvatar = (nextAvatar + 1) % len(avatars) |
#2
|
|||
|
|||
I'm still getting the same error. I'm not sure what is causing it. When a bullet "hits" or intersects an avatar, the following code is called:
Code:
if info.intersected: if info.object in avatars: WaitThenFreeze = vizact.sequence( vizact.waittime(info.object.getduration(7)-0.005), vizact.speed_node(0) ) info.object.execute(7) info.object.clear(viz.ALL) info.object.clear(viz.CURRENT_ACTION) info.object.add(WaitThenFreeze) #Add the action to the avatar RemoveAvatarAction = vizact.call(RemoveAvatar,info.object) info.object.add(RemoveAvatarAction) #Add action to remove avatar Code:
def RemoveAvatar(avatar): avatar.visible(0) #Hide avatar avatar.speed(1) #Restore speed avatars.remove(avatar) #Remove from list dead_list.append(avatar) #Add to dead list I also tried: Code:
if len(avatars) != NUM_AVATARS: avatar = dead_list[nextAvatar] nextAvatar = nextAvatar + 1 % len(dead_list) else: avatar = avatars[nextAvatar] nextAvatar = (nextAvatar + 1) % len(avatars) walkAvatar(avatar) Last edited by betancourtb82; 03-21-2006 at 09:35 AM. |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|