View Single Post
Old 11-28-2007, 01:09 PM
Elittdogg Elittdogg is offline
Join Date: Aug 2007
Posts: 77
This is the code I have: (Oh and by the way...I don't know how to make it into the [code]/[code] make it come out like it shows up in Vizard).

import viz
import math
import whrandom
import string


# Get subject number from prompt box
promptMesg = viz.get(viz.INITMESG)
if promptMesg == "":
Subnum = 999
Trial = 100

text = string.split(promptMesg)
Subnum = int(text[0])
Trial = int(text[1])

print "Subnum =", Subnum
print "Trial =", Trial

tex1 = viz.add('3d-room.jpg')
quad = viz.add(viz.TEXQUAD)
quad.scale(12.8, 10.24)

def WriteFlag():
# write the flag in the data file
print "Movement Transition Made"

movetime = [0.05, 0.25, 0.5, 1, 2]
sequences = []
for time in movetime:
MoveRoom = vizact.sequence(vizact.move(0,0,(0.12/time),time), vizact.move(0,0,(-0.12/time),time), int(30/time))
sequences.append( WriteFlag ) )
sequences.append( WriteFlag3) )

MovingRoom = vizact.sequence(sequences, 1)

def WriteFlag2():
#write the flag2 in the data file
print "Participant Noticed Movement"

def timer1():
print 'Elapsed time:',viz.elapsed(), 'seconds'

def onkeydown(key):
if key == ' ':


And the computer's frame rate is 60Hz.

So with the object that I'm using I can't use the viz.tick; I get this error message:
Traceback (most recent call last):
File "<string>", line 12, in ?
File "MOVING ROOM (FINAL).py", line 51, in ?
startTime = viz.tick()
AttributeError: 'module' object has no attribute 'tick'

Anyway, I ran it again, but it still doesn't come out to every minute. I don't know. Maybe I'm doing something wrong elsewhere in the code?
Reply With Quote