WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #31  
Old 03-21-2006, 09:26 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
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
The RemoveAvatar function is:
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 tried using the len(avatars) modulus division but it still gives me the same traceback error.

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)
but that didn't work either.

Last edited by betancourtb82; 03-21-2006 at 09:35 AM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:34 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC