#Embedded file name: carbon/common/script/zaction\MovementProcs.py
"""
Code required within Jessica to create and manage ActionProcs for movement system.
"""
import zaction
FollowMode = zaction.ProcTypeDef(isMaster=True, procCategory='Movement', properties=[zaction.ProcPropertyTypeDef('FOLLOW_RANGE', 'F', userDataType=None, isPrivate=True), zaction.ProcPropertyTypeDef('FOLLOW_TELEPORT_ON_STUCK', 'B', userDataType=None, isPrivate=True), zaction.ProcPropertyTypeDef('FOLLOW_MIN_RANGE', 'F', userDataType=None, isPrivate=True)])
IsInMovementMode = zaction.ProcTypeDef(isMaster=True, isConditional=True, procCategory='Movement', displayName='Is in movement mode', properties=[zaction.ProcPropertyTypeDef('evaluateTo', 'B', userDataType=None, isPrivate=True, displayName='Evaluate To True', default=True), zaction.ProcPropertyTypeDef('moveModeName', 'S', userDataType=None, isPrivate=True, displayName='Move Mode Name')], description='Validates if we are in a movement mode.')
TargetedJumpMode = zaction.ProcTypeDef(isMaster=True, procCategory='Movement', displayName='Targeted Jump', description='Initiates a targeted jump movement mode.')
HasTargetedJumpModeJumped = zaction.ProcTypeDef(isMaster=True, isConditional=True, procCategory='Movement', displayName='Has targeted jump mode jumped', properties=[zaction.ProcPropertyTypeDef('evaluateTo', 'B', userDataType=None, isPrivate=True, displayName='Evaluate To True', default=True)], description='Validates if the targeted jump mode has jumped.')
IsWaitingForMoveModeActivation = zaction.ProcTypeDef(isMaster=True, isConditional=True, procCategory='Movement', displayName='Is Wating For Move Mode Activation', properties=[zaction.ProcPropertyTypeDef('evaluateTo', 'B', userDataType=None, isPrivate=True, displayName='Evaluate To True', default=True)], description='Check to see if the current entity move mode manager needs to activate a move mode.')
exports = {'actionProcTypes.FollowMode': FollowMode,
 'actionProcTypes.IsInMovementMode': IsInMovementMode,
 'actionProcTypes.TargetedJumpMode': TargetedJumpMode,
 'actionProcTypes.HasTargetedJumpModeJumped': HasTargetedJumpModeJumped,
 'actionProcTypes.IsWaitingForMoveModeActivation': IsWaitingForMoveModeActivation}
Example #2
0
        return True

    def _PlayTutorialVoiceOver(self, messageKey):
        sm.GetService('tutorial').Action_Play_MLS_Audio(messageKey)
        return True


exports = {
    'actionProcTypes.PerformPythonUICallback':
    zaction.ProcTypeDef(
        isMaster=True,
        procCategory='UI',
        properties=[
            zaction.ProcPropertyTypeDef('callbackKey',
                                        'S',
                                        userDataType=None,
                                        isPrivate=True)
        ],
        description=
        'Performs a UI callback (opens a UI window, etc.). These are set per-game.'
    ),
    'actionProcTypes.PlayEntityAudio':
    zaction.ProcTypeDef(
        isMaster=True,
        procCategory='Audio',
        properties=[
            zaction.ProcPropertyTypeDef('audioName',
                                        'S',
                                        userDataType=None,
                                        isPrivate=True,
                                        displayName='Audio Name'),
Example #3
0
        locatorList.append((loc.GetName(), loc.GetName(), ''))

    return locatorList


exports = {
    'actionProperties.MotionState': ('list', MotionStateList),
    'actionProperties.TargetTypeList': ('list', TargetTypeList),
    'actionProperties.LocatorList': ('listMethod', CreateLocatorList),
    'actionProcTypes.SetEntityPosition':
    zaction.ProcTypeDef(
        isMaster=True,
        procCategory='Entity',
        properties=[
            zaction.ProcPropertyTypeDef('MotionState',
                                        'I',
                                        userDataType='MotionState',
                                        isPrivate=True)
        ],
        description=
        'Sets the requesting entity\'s position. This uses the ALIGN_POSITION and ALIGN_ROTATION properties right now, though could be altered to use specified properties. The "MotionState" corresponds to move modes -- Keyframe and Character.'
    ),
    'actionProcTypes.GetEntitySceneID':
    zaction.ProcTypeDef(
        isMaster=True,
        procCategory='Entity',
        description=
        'Gets the entity scene ID of the entity performing this action.'),
    'actionProcTypes.GetBonePosRot':
    zaction.ProcTypeDef(
        isMaster=True,
        procCategory='Entity',
Example #4
0
                    quat = geo2.QuaternionRotationSetYawPitchRoll(
                        row.rotY, row.rotX, row.rotZ)
                    pos = (row.posX, row.posY, row.posZ)
                    exits.append({'pos': pos, 'rot': quat})

        return exits


exports = {
    'actionProcTypes.UseActionObject':
    zaction.ProcTypeDef(
        isMaster=True,
        procCategory='ActionObject',
        properties=[
            zaction.ProcPropertyTypeDef('Distance',
                                        'F',
                                        userDataType=None,
                                        isPrivate=False)
        ],
        description='Set the ActionObject in use by the requesting entity.'),
    'actionProcTypes.StopUsingActionObject':
    zaction.ProcTypeDef(
        isMaster=True,
        procCategory='ActionObject',
        description=
        'Set the ActionObject as no longer in use by the requesting entity.'),
    'actionProcTypes.IsActionObjectActionAvailable':
    zaction.ProcTypeDef(
        isMaster=True,
        isConditional=True,
        procCategory='ActionObject',
        properties=[
Example #5
0
                            if 'Tr2PyBindingSentinelVector2' == typename and len(prop) >= 2:
                                binding.sourceObject.value = prop[:2]
                            elif 'Tr2PyBindingSentinelVector3' == typename and len(prop) >= 3:
                                binding.sourceObject.value = prop[:3]
                            elif 'Tr2PyBindingSentinelVector4' == typename and len(prop) >= 4:
                                binding.sourceObject.value = prop[:4]
                            else:
                                self.LogWarn('Found Tr2PyBindingSentinel for a particle effect and matching list property, but types or list lengths do not match!', binding.sourceObject.name, typename, type(prop))
                        else:
                            self.LogWarn('Found Tr2PyBindingSentinel for a particle effect and matching property, but types do not match!', binding.sourceObject.name, typename, type(prop))
                    else:
                        self.LogWarn('Found Tr2PyBindingSentinel for a particle effect and no matching attribute or property!', binding.sourceObject.name, typename)
                    removableBindings.append(binding)

            curveSet.Update()
            for binding in removableBindings:
                curveSet.bindings.remove(binding)


exports = {'actionProcTypes.ApplyParticleEffect': zaction.ProcTypeDef(isMaster=True, procCategory='Graphics', displayName='Apply Particle Effect', properties=[zaction.ProcPropertyTypeDef('redFile', 'S', userDataType=None, isPrivate=True, displayName='Red File'),
                                         zaction.ProcPropertyTypeDef('duration', 'I', userDataType=None, isPrivate=True, displayName='Duration (milliseconds)'),
                                         zaction.ProcPropertyTypeDef('boneName', 'S', userDataType=None, isPrivate=True, displayName='Bone Name'),
                                         zaction.ProcPropertyTypeDef('xOffset', 'F', userDataType=None, isPrivate=True, displayName='X Offset'),
                                         zaction.ProcPropertyTypeDef('yOffset', 'F', userDataType=None, isPrivate=True, displayName='Y Offset'),
                                         zaction.ProcPropertyTypeDef('zOffset', 'F', userDataType=None, isPrivate=True, displayName='Z Offset'),
                                         zaction.ProcPropertyTypeDef('yawOffset', 'F', userDataType=None, isPrivate=True, displayName='Yaw Offset (deg)'),
                                         zaction.ProcPropertyTypeDef('pitchOffset', 'F', userDataType=None, isPrivate=True, displayName='Pitch Offset (deg)'),
                                         zaction.ProcPropertyTypeDef('rollOffset', 'F', userDataType=None, isPrivate=True, displayName='Roll Offset (deg)'),
                                         zaction.ProcPropertyTypeDef('ignoreTransform', 'B', userDataType=None, isPrivate=True, displayName='Ignore Effect Transform'),
                                         zaction.ProcPropertyTypeDef('effectIDProp', 'S', userDataType=None, isPrivate=True, displayName='Effect ID Storage Property')], description='Creates a particle effect on the entity. Effect will offset from entity position if Bone Name is omitted.'),
 'actionProcTypes.RemoveParticleEffect': zaction.ProcTypeDef(isMaster=True, procCategory='Graphics', displayName='Remove Particle Effect', properties=[zaction.ProcPropertyTypeDef('effectIDProp', 'S', userDataType=None, isPrivate=True, displayName='Effect ID Storage Property')], description='Removes a particle effect on the entity. This uses a previously stored effect ID in the specified property.')}
Example #6
0
    return retList


exports = {
    'actionProperties.AICandidate': ('listMethod', GetAICandidateList),
    'actionProperties.AIConfidence': ('listMethod', GetAIConfidenceList),
    'actionProperties.AISubject': ('listMethod', GetAISubjectList),
    'actionProperties.AIStimType': ('listMethod', GetAIStimTypeList),
    'actionProcTypes.DropStimulus':
    zaction.ProcTypeDef(
        isMaster=False,
        procCategory='AI',
        properties=[
            zaction.ProcPropertyTypeDef('StimType',
                                        'I',
                                        userDataType='AIStimType',
                                        isPrivate=True,
                                        displayName='Stimulus type'),
            zaction.ProcPropertyTypeDef('Range',
                                        'F',
                                        userDataType=None,
                                        isPrivate=True,
                                        displayName='Range (-1 for default)'),
            zaction.ProcPropertyTypeDef('SwapTarget',
                                        'B',
                                        userDataType=None,
                                        isPrivate=True,
                                        displayName='Drop from target')
        ])
}
Example #7
0
        return True

    def _SetClientPrefBoolTasklet(self, Name, Value):
        prefs.SetValue(Name, Value)

    def _ClientPrefEqualsBool(self, Name, Value):
        prefVal = prefs.GetValue(Name, None)
        if prefVal is None:
            return False
        return prefVal == Value

    def _SetCharacterPrefBool(self, Name, Value):
        uthread.worker('_SetCharacterPrefBool', self._SetCharacterPrefBoolTasklet, Name, Value)
        return True

    def _SetCharacterPrefBoolTasklet(self, Name, Value):
        settings.char.zaction.Set(Name, Value)

    def _CharacterPrefEqualsBool(self, Name, Value):
        prefVal = settings.char.zaction.Get(Name, None)
        if prefVal is None:
            return False
        return prefVal == Value


exports = {'actionProcTypes.SetClientPrefInt': zaction.ProcTypeDef(isMaster=True, procCategory='Client Preferences', properties=[zaction.ProcPropertyTypeDef('Name', 'S', userDataType=None, isPrivate=True, displayName='Pref Name'), zaction.ProcPropertyTypeDef('Value', 'I', userDataType=None, isPrivate=True, displayName='Value')], description='Sets a client preference (integer value).'),
 'actionProcTypes.ClientPrefEqualsInt': zaction.ProcTypeDef(isMaster=True, procCategory='Client Preferences', isConditional=True, properties=[zaction.ProcPropertyTypeDef('Name', 'S', userDataType=None, isPrivate=True, displayName='Pref Name'), zaction.ProcPropertyTypeDef('Value', 'I', userDataType=None, isPrivate=True, displayName='Value')], description='Tests a client pref against a value (integer).'),
 'actionProcTypes.SetClientPrefBool': zaction.ProcTypeDef(isMaster=True, procCategory='Client Preferences', properties=[zaction.ProcPropertyTypeDef('Name', 'S', userDataType=None, isPrivate=True, displayName='Pref Name'), zaction.ProcPropertyTypeDef('Value', 'B', userDataType=None, isPrivate=True, displayName='Value')], description='Sets a client preference (boolean value).'),
 'actionProcTypes.ClientPrefEqualsBool': zaction.ProcTypeDef(isMaster=True, procCategory='Client Preferences', isConditional=True, properties=[zaction.ProcPropertyTypeDef('Name', 'S', userDataType=None, isPrivate=True, displayName='Pref Name'), zaction.ProcPropertyTypeDef('Value', 'B', userDataType=None, isPrivate=True, displayName='Value')], description='Tests a client pref against a value (boolean).'),
 'actionProcTypes.SetCharacterPrefBool': zaction.ProcTypeDef(isMaster=True, procCategory='Client Preferences', properties=[zaction.ProcPropertyTypeDef('Name', 'S', userDataType=None, isPrivate=True, displayName='Pref Name'), zaction.ProcPropertyTypeDef('Value', 'B', userDataType=None, isPrivate=True, displayName='Value')], description='Sets a character preference (boolean value).'),
 'actionProcTypes.CharacterPrefEqualsBool': zaction.ProcTypeDef(isMaster=True, procCategory='Client Preferences', isConditional=True, properties=[zaction.ProcPropertyTypeDef('Name', 'S', userDataType=None, isPrivate=True, displayName='Pref Name'), zaction.ProcPropertyTypeDef('Value', 'B', userDataType=None, isPrivate=True, displayName='Value')], description='Tests a character pref against a value (boolean).')}
Example #8
0
        retList.append(
            (name, target[const.aiming.AIMING_VALID_TARGETS_FIELD_ID], ''))

    return retList


exports = {
    'actionProperties.AITarget': ('listMethod', GetAITargetList),
    'actionProcTypes.TargetSelect':
    zaction.ProcTypeDef(
        isMaster=False,
        procCategory='AI',
        properties=[
            zaction.ProcPropertyTypeDef('Target',
                                        'I',
                                        userDataType='AITarget',
                                        isPrivate=True,
                                        displayName='Set Target'),
            zaction.ProcPropertyTypeDef('Candidate',
                                        'I',
                                        userDataType='AICandidate',
                                        isPrivate=True,
                                        displayName='From Candidate List'),
            zaction.ProcPropertyTypeDef('Subject',
                                        'I',
                                        userDataType='AISubject',
                                        isPrivate=True,
                                        displayName='Where Subject is'),
            zaction.ProcPropertyTypeDef('Confidence',
                                        'I',
                                        userDataType='AIConfidence',