WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-23-2008, 03:58 PM
TrashcanPatrol TrashcanPatrol is offline
Member
 
Join Date: Aug 2008
Posts: 43
Writing data more than once

Hi, I tried a script to write data to a file outside of Vizard.

Code:
import viz
viz.go()

room=viz.add('room.wrl')
viz.collision(viz.ON)
import vizcam
vizcam.FlyNavigate()
subject = viz.input('Who are you?')

scoreLabel.score = 0
RECT3_X = -2
RECT3_Z = -2
RECT3_WIDTH = 0.5
Readboard = False
#score_data = open('quest_data','a','U')
def handlemyhotspots(id,x,y,z):
	global Readboard

	if id == BOARD:
		Readboard = True
		print 'Board has been read. +1'
		data = 'Mr. ' + str(subject) + ' was given 1 point for reading the instructions. '
	score_data.write(data)
	score_data.flush()
viz.starthotspot(BOARD,viz.RECTANGLE_HOTSPOT_IN,RECT3_X,RECT3_Z,RECT3_WIDTH,1)
That's part of the code. I'm trying to add another portion where if the player selects an object, data is written to the file score_data to say "Mr. ____ selected Item."
I can't seem to combine the two, or even get the second part of it to work by itself. Can anyone help me fix the problem?
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
writing joystick position to a data file Saz Vizard 3 12-17-2008 05:18 AM
Crashing when I select Tracker option GoldenSun Vizard 4 07-01-2008 11:06 AM
Flagging the Data Elittdogg Vizard 5 04-11-2008 11:40 AM
Writing text files with executable adimov Vizard 1 03-21-2008 03:21 PM
tracking using quaternarion data jfreeman Vizard 2 06-01-2005 08:48 AM


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


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