WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #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
  #2  
Old 05-01-2006, 03:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

When you start an avatar do you add it back into the characters list?
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 06:47 AM.


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