View Single Post
  #1  
Old 05-01-2006, 11:14 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
Avatar Regeneration

I have a problem with my avatars. What is happening is that I have my avatars walking toward a subject once i hit the 'a' key. I then proceed to shoot them and when the bullet hits them, they fall using the following code:
Code:
	info = viz.intersect(pos,futurePos)
	if info.intersected:
		print 'intersect point is',info.intersectPoint
		if info.object in characters:
			avatarsHit = avatarsHit + 1
			#intersectList.append(info.intersectPoint)
			#intersectList.append(info.intersectPoint)
			#print 'intersect list is',intersectlist
			viz.playsound('arrgh.wav')
			print 'Avatars hit: ', avatarsHit
			WaitThenFreeze = vizact.sequence( vizact.waittime(info.object.getduration(7)-0.12), 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 RemoveAvatarAction is as follows:
Code:
def RemoveAvatar(avatar):
	avatar.visible(0) #Hide avatar
	#avatar._face_.visible(0) #Hide face
	avatar.speed(1) #Restore speed
	characters.remove(avatar) #Remove from list
	waitlist.append(avatar) #Add to dead list
	waitlist[0].clear(viz.ACTION)
	waitlist[0].clear(viz.CURRENT_ACTION)
	StartAvatar(randint(0,2))
The problem is, once they "come back to life" I am not able to shoot them. The bullet still goes through them, but nothing happens. I'm not sure why. Please help.

Thanks,
Reply With Quote