Instant Action Creation Functions

PRActionCreateChangeLayer(layerName)

Description

Creates and returns an action of type PRACTION_TYPE_CHANGE_LAYER. When an oPRAction-derived object instance plays this action, the instance will move to the new layer with the given name in layerName.

Parameters
  • layerName String

The name of the layer to move the instance to.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateChangeSprite(spriteIndex, imageIndex)

Description

Creates and returns an action of type PRACTION_TYPE_CHANGE_SPRITE. When an oPRAction-derived object instance plays this action, the instance's sprite_index and/or image_index will be changed to the new given values. Pass noone if no change is desired.

Parameters
  • spriteIndex Sprite ID

The ID of the sprite to change to, or noone for no change.

  • imageIndex Real

The new sprite frame to change to, or noone for no change.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateDepthBy(depthBy)

Description

Creates and returns an action of type PRACTION_TYPE_DEPTH_BY. When an oPRAction-derived object instance plays this action, the instance's depth property will change by the amount given in depthBy.

Parameters
  • depthBy Real

The amount to change the depth by.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateDepthTo(depthTo)

Description

Creates and returns an action of type PRACTION_TYPE_DEPTH_TO. When an oPRAction-derived object instance plays this action, the instance's depth property will change to the new given value.

Parameters
  • depthTo Real

The new depth to change to.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateDestroyObject(instanceOpt)

Description

Creates and returns an action of type PRACTION_TYPE_DESTROY_OBJECT. When an oPRAction-derived object instance plays this action, the object instance specified in instanceOpt (or self if not provided) will immediately be destroyed. You may instead provide an object index in instanceOpt to destroy all instances of that object.

Parameters
  • instanceOpt Instance/Object ID - OPTIONAL

An object instance or object index. Defaults to self.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateGotoRoom(roomId)

Description

Creates and returns an action of type PRACTION_TYPE_GOTO_ROOM. When an oPRAction-derived object instance plays this action, the given room number will run.

Parameters
  • roomId RoomID

The room to run.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateHide()

Description

Creates and returns an action of type PRACTION_TYPE_HIDE. When an oPRAction-derived object instance plays this action, that instance will be made invisible.

Parameters
  • None
Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreatePlayAction(action, instanceOpt)

Description

Creates and returns an action of type PRACTION_TYPE_PLAY_ACTION. When an oPRAction-derived object instance plays this action, the given action will immediately be played by the given instance in instanceOpt, if one was provided. If not provided, self will be assumed.

Parameters
  • action PRAction Struct

The action to play.

  • instanceOpt Instance ID - OPTIONAL

The object instance that will play the given action. Defaults to self.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreatePlaySound(soundId, priorityOpt, loopsOpt)

Description

Creates and returns an action of type PRACTION_TYPE_PLAY_SOUND. When an oPRAction-derived object instance plays this action, the given sound will be played with the given priority and will loop play if loops is true.

Parameters
  • soundId Sound ID

The ID of the sound to play.

  • priorityOpt Real - OPTIONAL

The channel priority. Can be 0 to 1, or 1 to 100. Defaults to 100.

  • LoopsOpt Bool - OPTIONAL

Loops the sound if true, no loop play if false. Defaults to false.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateRunScript(scriptId, arg1, arg2, arg3, ..., arg8)

Description

Creates and returns an action of type PRACTION_TYPE_RUN_SCRIPT. When an oPRAction-derived object instance plays this action, the given script will be run passing it the given optional arguments. Up to 8 arguments can be supplied.

Parameters
  • scriptId Script ID

The script to run.

  • arg1 Any - OPTIONAL

The 1st argument passed to the script.

  • arg2 Any - OPTIONAL

The 2nd argument passed to the script.

  • arg3 Any - OPTIONAL

The 3rd argument passed to the script.

  • arg4 Any - OPTIONAL

The 4th argument passed to the script.

  • arg5 Any - OPTIONAL

The 5th argument passed to the script.

  • arg6 Any - OPTIONAL

The 6th argument passed to the script.

  • arg7 Any - OPTIONAL

The 7th argument passed to the script.

  • arg8 Any - OPTIONAL

The 8th argument passed to the script.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateCallFunction(functionId, arg1, arg2, arg3, ..., arg8)

Description

Creates and returns an action of type PRACTION_TYPE_CALL_FUNCTION. When an oPRAction-derived object instance plays this action, the given function or method will be called passing it the given optional arguments. Up to 8 arguments can be supplied.

Parameters
  • functionId Function ID

The function/method to call.

  • arg1 Any - OPTIONAL

The 1st argument passed to the function/method.

  • arg2 Any - OPTIONAL

The 2nd argument passed to the function/method.

  • arg3 Any - OPTIONAL

The 3rd argument passed to the function/method.

  • arg4 Any - OPTIONAL

The 4th argument passed to the function/method.

  • arg5 Any - OPTIONAL

The 5th argument passed to the function/method.

  • arg6 Any - OPTIONAL

The 6th argument passed to the function/method.

  • arg7 Any - OPTIONAL

The 7th argument passed to the function/method.

  • arg8 Any - OPTIONAL

The 8th argument passed to the function/method.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateRunUserEvent(eventNumber)

Description

Creates and returns an action of type PRACTION_TYPE_RUN_USER_EVENT. When an oPRAction-derived object instance plays this action, the instance's user event with number eventNumber will be run.

Parameters
  • eventNumber Int

The event to run.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateSetVariable(variableName, value)

Description

Creates and returns an action of type PRACTION_TYPE_GOTO_ROOM. When an oPRAction-derived object instance plays this action, that instance's variable identified by the name in variableName will be set to the given value.

Parameters
  • variableName String

The variable to set.

  • value Any

The value to set in the variable.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateStopAction(slotOrName, instanceOpt)

Description

Creates and returns an action of type PRACTION_TYPE_STOP_ACTION. When an oPRAction-derived object instance plays this action, the action identified by slotOrName currently being played by the object instance instanceOpt (or self if not provided) will immediately stop playing.

Parameters
  • slotOrName Int/String

The action's slot index or name to stop playing.

  • instanceOpt Instance ID - OPTIONAL

The object instance that will stop the given action. Defaults to self.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateStopAllActions(instanceOpt)

Description

Creates and returns an action of type PRACTION_TYPE_STOP_ALL_ACTIONS. When an oPRAction-derived object instance plays this action, all actions currently being played by the object instance instanceOpt (or self if not provided) will immediately stop playing.

Parameters
  • instanceOpt Instance ID - OPTIONAL

The object instance that will be bound to this action.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateStopAllSounds()

Description

Creates and returns an action of type PRACTION_TYPE_STOP_ALL_SOUNDS. When an oPRAction-derived object instance plays this action, all playing sounds will stop.

Parameters
  • None
Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateStopSound(soundIndex)

Description

Creates and returns an action of type PRACTION_TYPE_STOP_SOUND. When an oPRAction-derived object instance plays this action, the sound identified by soundIndex (returned by the audio_play_sound function) will stop playing.

Parameters
  • soundIndex Int

Sound index of the playing sound, returned by the audio_play_sound function.

Returns
PRAction Struct

An action that can be played by a PRAction-derived object.

PRActionCreateUnhide()

Description

Creates and returns an action of type PRACTION_TYPE_HIDE. When an oPRAction-derived object instance plays this action, that instance will be made visible.

Parameters
  • None
Returns
PRAction Struct

An action that can be played by a PRAction-derived object.


© 2021 Prismatic Realms, Inc. Contact

Green Hosting Badge