WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-18-2006, 03:23 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
You could add the box objects to a list and then do “if info.object in boxList:” to check if a box has been hit.

It looks like you would want to call enable(viz.COLLISION) in your RestoreAvatar() function.
Reply With Quote
  #2  
Old 05-19-2006, 10:02 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
I tried doing that, but unfortunately the enable command comes back too quickly. If I just disable the collisions then it works but if I try to enable them again in RestoreAvatar, then I am still able to get multiple shots on the avatars before they "die". Is there anyway I can delay the enabling of the collisions until they walk out again?
Reply With Quote
  #3  
Old 05-19-2006, 10:19 AM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
I see a few solutions. Pick the best for your code structure: 1.) Simply call enable(viz.COLLISION), in whatever code tells the avatar to “walk out again.” 2.) Leave enable(viz.COLLISION) in the RestoreAvatar function and call RestoreAvatar when you want the character to walk out again. 3.) You could delete the object (I assume it is a bullet?) that is intersecting with the character with bullet.remove() in your intersection handling function.
Reply With Quote
  #4  
Old 05-19-2006, 10:34 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
Worked Great! I used your first suggestion. THANKS A BUNCH!!!
Reply With Quote
  #5  
Old 05-23-2006, 12:02 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
I have a question that is related to this topic. Each avatar that enters the room is holding one of three objects (a gun, a camera, or a phone). When I define the avatar, I put in a function called getWeapon
Code:
def getWeapon(avatar,number):
 global link
 if number == 0:
  link = viz.add(viz.GROUP) 
  myphone = link.add(objects[0])
  myphone.scale(.001,.001,.001)
  avatar.linkbone(link,'skel_HandR')
 elif number == 1:
  link = viz.add(viz.GROUP) 
  myphone = link.add(objects[1])
  myphone.scale(.0005,.0005,.0005)
  myphone.translate(0,-.25,.17)
  myphone.rotate(180)
  male.linkbone(link,'skel_Neck')
 else:
  link = viz.add(viz.GROUP) 
  myphone = link.add(objects[2])
  myphone.scale(.0008,.0008,.0008)
  myphone.rotate(66.51,151.49,86.01)
  myphone.translate(-0.02,0.04,0.02)
  male.linkbone(link,'skel_HandRF')
I'm thinking of making the avatar run through the getWeapon function each time they go through RestoreAvatar, however I'm not sure how to get them to "drop" the object they are holding when they get shot. I tried unlink() but I am unsure where and how to use it. Any ideas?
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 12:51 AM.


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