Example #1
0
    def load(self):
        EntityAI.load(self)

        entname = self.getEntityValue("targetEnt")
        self.targetEnt = self.bspLoader.getPyEntityByTargetName(entname)
        if not self.targetEnt:
            self.notify.error("target entity `{0}` not found!".format(entname))
        elif not isinstance(self.targetEnt, BaseNPCAI):
            self.notify.error(
                "target entity `{0}` is not an NPC!".format(entname))

        nextName = self.getEntityValue("nextScript")
        if len(nextName) > 0:
            self.nextScript = self.bspLoader.getPyEntityByTargetName(nextName)

        self.entryAnimation = Activities.getActivityByName(
            self.getEntityValue("entryAnimation"))
        self.actionAnimation = Activities.getActivityByName(
            self.getEntityValue("actionAnimation"))
        self.exitAnimation = Activities.getActivityByName(
            self.getEntityValue("exitAnimation"))

        self.loopAction = self.getEntityValueBool("loopAction")

        # Should we move to the location of this entity before performing the scripted sequence?
        self.moveToPosition = self.getEntityValueBool("moveToPosition")
    def unload(self):
        for suit in self.spawned:
            if not suit.isDeleted():
                suit.requestDelete()
        self.spawned = None

        EntityAI.unload(self)
Example #3
0
    def load(self):
        EntityAI.load(self)
        self.enableThink()
        self.accept('goonie_die', self.handleDie)

        ssName = self.getEntityValue("spawnScript")
        if len(ssName):
            self.spawnScript = self.bspLoader.getPyEntityByTargetName(ssName)
Example #4
0
 def unload(self):
     self.ignore('goonie_die')
     self.spawnScript = None
     self.numSpawned = None
     self.maxSpawned = None
     self.lastSpawnTime = None
     self.spawnIval = None
     self.startedSpawning = None
     EntityAI.unload(self)
Example #5
0
 def unload(self):
     self.Stop()
     del self.ivalMin
     del self.ivalMax
     del self.maxBatchMin
     del self.maxBatchMax
     del self.batchSize
     del self.ival
     del self.looping
     EntityAI.unload(self)
Example #6
0
 def load(self):
     EntityAI.load(self)
     self.ivalMin = self.getEntityValueFloat("ivalMin")
     self.ivalMax = self.getEntityValueFloat("ivalMax")
     self.maxBatchMin = self.getEntityValueInt("maxBatchMin")
     self.maxBatchMax = self.getEntityValueInt("maxBatchMax")
     self.looping = bool(self.getEntityValueInt("looping"))
     
     if bool(self.getEntityValueInt("startNow")):
         self.Start()
Example #7
0
    def __init__(self, air=None, dispatch=None):
        EntityAI.__init__(self, air, dispatch)

        self.numSpawned = 0
        self.maxSpawned = 5
        self.startedSpawning = False
        self.lastSpawnTime = 0.0
        self.spawnIval = 0.0

        self.spawnScript = None
Example #8
0
 def load(self):
     EntityAI.load(self)
     self.ivalMin = self.getEntityValueFloat("ivalMin")
     self.ivalMax = self.getEntityValueFloat("ivalMax")
     self.maxBatchMin = self.getEntityValueInt("maxBatchMin")
     self.maxBatchMax = self.getEntityValueInt("maxBatchMax")
     self.looping = bool(self.getEntityValueInt("looping"))
     
     self.accept('suitDied', self.__handleSuitDied)
     
     if bool(self.getEntityValueInt("startNow")):
         self.Start()
Example #9
0
 def __init__(self, air = None, dispatch = None):
     EntityAI.__init__(self, air, dispatch)
     
     self.ivalMin = 5.0
     self.ivalMax = 10.0
     self.maxBatchMin = 4
     self.maxBatchMax = 8
     
     self.batchSize = 0
     self.ival = 0.0
     
     self.looping = True
Example #10
0
    def load(self):
        EntityAI.load(self)

        self.speech = self.getEntityValue("speech")
        self.targetEnt = self.bspLoader.getPyEntityByTargetName(
            self.getEntityValue("targetEntity"))

        talkToStr = self.getEntityValue("talkTo")
        if len(talkToStr) > 0:
            if talkToStr == "!player":
                self.talkTo = base.localAvatar
            else:
                self.talkTo = self.bspLoader.getPyEntityByTargetName()
Example #11
0
    def __init__(self, air=None, dispatch=None):
        EntityAI.__init__(self, air, dispatch)

        self.targetEnt = None
        self.nextScript = None

        self.entryAnimation = None
        self.actionAnimation = None
        self.loopAction = False
        self.exitAnimation = None
        self.moveToPosition = True

        self.shouldRestartAI = True

        self.seq = None
Example #12
0
    def unload(self):
        if self.seq:
            self.seq.pause()
        self.seq = None

        self.targetEnt = None
        self.nextScript = None
        self.entryAnimation = None
        self.actionAnimation = None
        self.loopAction = None
        self.exitAnimation = None
        self.moveToPosition = None
        self.shouldRestartAI = None

        EntityAI.unload(self)
 def unload(self):
     del self.speech
     del self.targetEnt
     EntityAI.unload(self)
    def load(self):
        EntityAI.load(self)

        self.speech = self.getEntityValue("speech")
        self.targetEnt = self.bspLoader.getPyEntityByTargetName(
            self.getEntityValue("targetEntity"))
 def __init__(self, air=None, dispatch=None):
     EntityAI.__init__(self, air, dispatch)
     self.speech = None
     self.targetEnt = None
Example #16
0
 def load(self):
     EntityAI.load(self)
     
     ssName = self.getEntityValue("spawnScript")
     if len(ssName):
         self.spawnScript = self.bspLoader.getPyEntityByTargetName(ssName)
Example #17
0
 def __init__(self, air = None, dispatch = None):
     EntityAI.__init__(self, air, dispatch)
     self.spawned = []
     self.spawnScript = None
 def load(self):
     EntityAI.load(self)