def SetCapturedAnimation(self, file, mode=VRScript.Core.PlayMode.Once, preAngles=[0, 0, 0], preScale=VRScript.Math.Vector(1, 1, 1)): self.capturedFBX = Animation.AnimationMeta(self.name + "_discovered", file, mode, preScale, preAngles)
def SetCapturedAnimation(self, file, mode=VRScript.Core.PlayMode.Once, preAngles=[0, 0, 0], preScale=[1, 1, 1]): self.capturedFBX = Animation.AnimationMeta( self.name + "_discovered", JasperConfig.MonstersDir + file, mode, preScale, preAngles, self)
def SetDiscoveredAnimation(self, file, mode=VRScript.Core.PlayMode.Loop, preAngles=[0, 0, 0], preScale=VRScript.Math.Vector(1, 1, 1)): self.discoveredFBX = Animation.AnimationMeta(self.name + "_discovered", file, mode, preScale, preAngles) print("Set discovery anim for " + str(self) + " to " + file)
def SetDiscoveredAnimation(self, file, mode=VRScript.Core.PlayMode.Loop, preAngles=[0, 0, 0], preScale=[1, 1, 1]): self.discoveredFBX = Animation.AnimationMeta( self.name + "_discovered", JasperConfig.MonstersDir + file, mode, preScale, preAngles, self) print("Set discovery anim for " + str(self) + " to " + file)
def __init__(self, name, sMeshName, location, discoverCommand, initState=ParanormalState.Hiding, captureCommand="CLICK", preRotate=None, preScale=[1, 1, 1]): if ("fbx" in sMeshName or "FBX" in sMeshName): # hiding mesh is also FBX; load a placeholder for the mesh self.hidingIsFBX = True mesh = JasperConfig.MonstersDir + "placeholder.ive" self.hidingFBX = Animation.AnimationMeta( name + "_hiding", JasperConfig.MonstersDir + sMeshName, VRScript.Core.PlayMode.Loop, preScale, preRotate) else: self.hidingIsFBX = False mesh = JasperConfig.MonstersDir + sMeshName self.hidingFBX = None # animation file for discovery state lel_common.GenericObject.__init__(self, name, mesh, location, True, True, "Concave", True, "Static") self.discoverCommand = discoverCommand # command(s) that will discover this paranormal self.captureCommand = captureCommand # command(s) that will capture this paranormal self.type = "paranormal" # human-friendly name for this type self.discoveredFBX = None # animation file for discovery state self.discoveredAudio = None # audio to play when discovered self.capturedFBX = None # animation file for captured state self.capturedAudio = None # audio to play when captured self.animObjHid = None # animation object to hold hiding animation self.animObjDis = None # animation object to hold discovered animation self.animObjCap = None # animation object to hold captured animation self.hidingAnimPlaymode = VRScript.Core.PlayMode.Loop self.discoveredAnimPlaymode = VRScript.Core.PlayMode.Loop # how discovered animation should be played self.capturedAnimPlaymode = VRScript.Core.PlayMode.Once # how captured animation should be played self.userDist = 0 # distance from user self.userProxTrigger = -1 # longest distance from user that will trigger OnUserProximity() self.isStaring = False # set to True if paranormal should always rotate to face user self.userDir = None # stores last user direction self.state = ParanormalState.Hiding # starting state of this paranormal self.preRotate = preRotate # rotate paranormal when loading self.preScale = preScale self.initState = initState print(self.name + " initialized. Current state=" + str(self.state))