def generate(self): """ This method is called when the object is generated: when it manifests for the first time on a particular client, or when it is pulled out of the cache after a previous manifestation. At the time of this call, the object has been created, but its required fields have not yet been filled in. """ # Always call up to parent class DistributedNode.generate(self)
def generate(self): self.assign(render.attachNewNode('DistributedElectionCamera')) DistributedNode.generate(self) self.camera = loader.loadModel('phase_4/models/events/election_tvCamera') self.camera.reparentTo(render) self.camera.setScale(0.25) propJoint = self.camera.find('**/hat') self.camBody = self.camera.find('**/camera_body') prop = BattleProps.globalPropPool.getProp('propeller') prop.reparentTo(propJoint) prop.setZ(1) prop.loop('propeller', fromFrame=0, toFrame=8) self.idleInterval = None
def generate(self): self.assign(render.attachNewNode('DistributedElectionCamera')) DistributedNode.generate(self) self.camera = loader.loadModel( 'phase_4/models/events/election_tvCamera') self.camera.reparentTo(render) self.camera.setScale(0.25) propJoint = self.camera.find('**/hat') self.camBody = self.camera.find('**/camera_body') prop = BattleProps.globalPropPool.getProp('propeller') prop.reparentTo(propJoint) prop.setZ(1) prop.loop('propeller', fromFrame=0, toFrame=8) self.idleInterval = None
def generate(self): DistributedNode.generate(self) self.cart = loader.loadModel(self.cartModelPath) self.cart.reparentTo(self) self.cart.setH(180) heads = [] for head in CIGlobals.SuitBodyData.keys(): if CIGlobals.SuitBodyData[head][0] != 'B': heads.append(head) head = random.choice(heads) suitType = CIGlobals.SuitBodyData[head][0] suitDept = CIGlobals.SuitBodyData[head][1] self.suitInCar = Suit() self.suitInCar.generateSuit(suitType, head, suitDept, 137, 0, False) self.suitInCar.loop('sit') self.suitInCar.disableRay() self.suitInCar.setScale(0.7) self.suitInCar.setH(180) self.suitInCar.setPos(0, -1, -1.5) self.suitInCar.reparentTo(self.cart.find('**/seat1')) self.soundEngineLoop = base.audio3d.loadSfx('phase_6/audio/sfx/KART_Engine_loop_0.wav') base.audio3d.attachSoundToObject(self.soundEngineLoop, self) base.playSfx(self.soundEngineLoop, looping=1) self.soundDriveByHorn = base.audio3d.loadSfx(self.honkSfxPath) base.audio3d.attachSoundToObject(self.soundDriveByHorn, self) self.soundDriveBy = base.audio3d.loadSfx('phase_14/audio/sfx/cogtropolis_citycar_driveby.mp3') base.audio3d.attachSoundToObject(self.soundDriveBy, self) sphere = CollisionSphere(0, 0, 0, 2.5) sphere.setTangible(0) node = CollisionNode(self.uniqueName('cartSphere')) node.setCollideMask(CIGlobals.WallBitmask) node.addSolid(sphere) self.collNodePath = self.attachNewNode(node) self.collNodePath.setZ(1.5) self.collNodePath.setSy(2.0) self.collNodePath.setSx(1.75)
def generate(self): DistributedNode.generate(self) self.cart = loader.loadModel(self.cartModelPath) self.cart.reparentTo(self) self.cart.setH(180) plans = [] for plan in SuitBank.getSuits(): if plan.getSuitType() != SuitType.B: plans.append(plan) plan = random.choice(plans) self.suitInCar = Suit() self.suitInCar.level = 0 self.suitInCar.generate(plan, Variant.NORMAL) self.suitInCar.loop('sit') self.suitInCar.disableRay() self.suitInCar.setScale(0.7) self.suitInCar.setH(180) self.suitInCar.setPos(0, -1, -1.5) self.suitInCar.reparentTo(self.cart.find('**/seat1')) self.suitInCar.show() self.soundEngineLoop = base.audio3d.loadSfx('phase_6/audio/sfx/KART_Engine_loop_0.ogg') base.audio3d.attachSoundToObject(self.soundEngineLoop, self) base.playSfx(self.soundEngineLoop, looping = 1) self.soundDriveByHorn = base.audio3d.loadSfx(self.honkSfxPath) base.audio3d.attachSoundToObject(self.soundDriveByHorn, self) self.soundDriveBy = base.audio3d.loadSfx('phase_14/audio/sfx/cogtropolis_citycar_driveby.ogg') base.audio3d.attachSoundToObject(self.soundDriveBy, self) sphere = CollisionSphere(0, 0, 0, 2.5) sphere.setTangible(0) node = CollisionNode(self.uniqueName('cartSphere')) node.setCollideMask(CIGlobals.WallBitmask) node.addSolid(sphere) self.collNodePath = self.attachNewNode(node) self.collNodePath.setZ(1.5) self.collNodePath.setSy(2.0) self.collNodePath.setSx(1.75)
def generate(self): DistributedNode.generate(self) self.cart = loader.loadModel(self.cartModelPath) self.cart.reparentTo(self) self.cart.setH(180) heads = [] for head in CIGlobals.SuitBodyData.keys(): if CIGlobals.SuitBodyData[head][0] != 'B': heads.append(head) head = random.choice(heads) suitType = CIGlobals.SuitBodyData[head][0] suitDept = CIGlobals.SuitBodyData[head][1] self.suitInCar = Suit() self.suitInCar.generateSuit(suitType, head, suitDept, 137, 0, False) self.suitInCar.loop('sit') self.suitInCar.disableRay() self.suitInCar.setScale(0.7) self.suitInCar.setH(180) self.suitInCar.setPos(0, -1, -1.5) self.suitInCar.reparentTo(self.cart.find('**/seat1')) self.soundEngineLoop = base.audio3d.loadSfx('phase_6/audio/sfx/KART_Engine_loop_0.ogg') base.audio3d.attachSoundToObject(self.soundEngineLoop, self) base.playSfx(self.soundEngineLoop, looping = 1) self.soundDriveByHorn = base.audio3d.loadSfx(self.honkSfxPath) base.audio3d.attachSoundToObject(self.soundDriveByHorn, self) self.soundDriveBy = base.audio3d.loadSfx('phase_14/audio/sfx/cogtropolis_citycar_driveby.ogg') base.audio3d.attachSoundToObject(self.soundDriveBy, self) sphere = CollisionSphere(0, 0, 0, 2.5) sphere.setTangible(0) node = CollisionNode(self.uniqueName('cartSphere')) node.setCollideMask(CIGlobals.WallBitmask) node.addSolid(sphere) self.collNodePath = self.attachNewNode(node) self.collNodePath.setZ(1.5) self.collNodePath.setSy(2.0) self.collNodePath.setSx(1.75)
def generate(self): DistributedNode.generate(self)
def generate(self): DistributedNode.generate(self)
def generate(self): DistributedNode.generate(self) InteractiveBase.generate(self) DistributedLocatableObject.generate(self)
def generate(self): DistributedNode.generate(self) self.load()
def generate(self): DistributedNode.generate(self) self.load()
def generate(self): DistributedNode.generate(self) self.trolleyStation = self.cr.getCurrentHood().geom.find('**/*trolley_station*') self.trolleyCar = self.trolleyStation.find('**/trolley_car')