Libraries.Interface.Controls.Scenes.Blueprints.CustomModelBlueprint Documentation

The CustomModelBlueprint class is an ItemBlueprint that takes an input file to load a custom asset, specifically it loads models which are 3D objects.

Inherits from: Libraries.Interface.Controls.Scenes.Blueprints.ItemBlueprint, Libraries.Language.Object, Libraries.Interface.Controls.Scenes.Blueprints.CustomItemBlueprint, Libraries.Interface.Controls.Scenes.Blueprints.ModelBlueprint

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetColor()

This action returns the color of this model.

Return

Libraries.Game.Graphics.Color: The color set for the editor of this model

GetDepth()

This action returns the depth of the model.

Return

number: The depth of the model

GetDescription()

This action returns the text description of the blueprint.

Return

text: The description of this blueprint

GetFile()

This action returns the file object pointing to the custom asset.

Return

Libraries.System.File: The file for the custom asset

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetHeight()

This action returns the height of the model.

Return

number: The height of the model

GetModelFile()

This action returns the file object pointing to the model.

Return

Libraries.System.File: The file for the model

GetModelType()

Model type refers to the type of shape the model is. The editor will mainly check that this value is not negative because negative values are invalid. 0 is an accepted value which means custom. Here are other accepted values for models taken from the SceneProperties class: BOX = 1, CYLINDER = 2, SPHERE = 3, PLANE = 4

Return

integer: The type of model

GetName()

This action returns the name of the blueprint.

Return

text: The name of this blueprint

GetPaletteCrop()

This action returns how much to crop the palette image so it can be fitted into an icon properly.

Return

number: A number representing how much to crop the icon

GetPaletteIcon()

This action returns the texture to be used as an icon in a palette

Return

Libraries.Game.Graphics.TextureRegion: A texture for an icon for this model

GetPaletteScale()

This action returns the scale of the icon so the icon can be sized properly when in a palette.

Return

number: The scale to be used in a palette

GetPitch()

This action returns the pitch of the model in degrees.

Return

number: The pitch of the model in degrees

GetResponsiveness()

This action returns the responsiveness field of this blueprint.

Return

integer: The responsiveness field

GetRoll()

This action returns the roll of the model in degrees.

Return

number: The roll of the model in degrees

GetScaleX()

This action returns the scale of the model on the x-axis.

Return

number: The scale of the model on the x-axis

GetScaleY()

This action returns the scale of the model on the y-axis.

Return

number: The scale of the model on the y-axis

GetScaleZ()

This action returns the scale of the model on the z-axis.

Return

number: The scale of the model on the z-axis

GetWidth()

This action returns the width of the model.

Return

number: The width of the model

GetYaw()

This action returns the yaw of the model in degrees.

Return

number: The yaw of the model in degrees

IsFileValid(Libraries.System.File file)

Returns true if the given file is of a valid file type for this blueprint, or false otherwise. Since this is a model blueprint this action will check for .obj and .g3db files since those are currently supported by the system.

Parameters

Return

boolean:

IsPhysicsEnabled()

This action returns the physics enabled field of this blueprint.

Return

boolean: The physics enabled field

SetColor(Libraries.Game.Graphics.Color color)

This action sets the color of the model from a Color object.

Parameters

SetColor(number red, number green, number blue, number alpha)

This action sets the color of the model from 4 values.

Parameters

  • number red: The red value of the color of this model
  • number green: The green value of the color of this model
  • number blue: The blue value of the color of this model
  • number alpha: The alpha value of the color of this model

SetDepth(number depth)

This action sets the depth of the model.

Parameters

  • number depth: The depth of the model

SetDescription(text description)

This action sets the text description of the blueprint.

Parameters

  • text description: The new description of this blueprint

SetDimensions(number width, number height, number depth)

This action sets the dimensions of the model. This is like the SetSize action of 2D objects but models being 3D means that 3 values are needed to set a size.

Parameters

  • number width: The width of the model
  • number height: The height of the model
  • number depth: The depth of the model

SetFile(Libraries.System.File file)

This action returns the file object pointing to the custom model.

Parameters

SetHeight(number height)

This action sets the height of the model.

Parameters

  • number height: The height of the model

SetModelFile(Libraries.System.File file)

This action set the file object pointing to the custom model.

Parameters

SetModelType(integer modelType)

This action sets the Model type which refers to the type of shape the model is. 0 is an accepted value which means custom. Here are other accepted values for models taken from the SceneProperties class: BOX = 1, CYLINDER = 2, SPHERE = 3, PLANE = 4

Parameters

  • integer modelType

SetName(text name)

This action sets the name of the blueprint.

Parameters

  • text name: The new name of this blueprint

SetPaletteCrop(number paletteCrop)

This action sets how much to crop the palette image so it can be fitted into an icon properly.

Parameters

  • number paletteCrop: The amount to crop the palette icon

SetPaletteIcon(Libraries.Game.Graphics.TextureRegion paletteIcon)

This action sets the texture to be used as an icon in a palette

Parameters

SetPaletteScale(number paletteScale)

This action sets the scale of the icon so the icon can be sized properly when in a palette.

Parameters

  • number paletteScale: The scale to be used in a palette

SetPhysicsEnabled(boolean enabled)

This action sets the physics enabled field of this blueprint.

Parameters

  • boolean enabled: If true this blueprint has physics enabled by default for this item

SetPitch(number pitch)

This action sets the pitch of the model which affects rotation.

Parameters

  • number pitch: The pitch of the model in degrees

SetResponsiveness(integer responsive)

This action sets the responsiveness field of this blueprint.

Parameters

  • integer responsive: An integer for how this item will respond to other physics objects

SetRoll(number roll)

This action sets the roll of the model which affects rotation.

Parameters

  • number roll: The roll of the model in degrees

SetRotation(number yaw, number pitch, number roll)

This action sets the rotation of the model using three values

Parameters

  • number yaw: The yaw of the model
  • number pitch: The pitch of the model
  • number roll: The roll of the model

SetScale(number x, number y, number z)

This action sets the scale of the model on all 3 axes.

Parameters

  • number x: The scale of the model on the x-axis
  • number y: The scale of the model on the y-axis
  • number z: The scale of the model on the z-axis

SetScaleX(number scaleX)

This action sets the scale of the model on the x-axis.

Parameters

  • number scaleX: The scale of the model on the x-axis

SetScaleY(number scaleY)

This action sets the scale of the model on the y-axis.

Parameters

  • number scaleY: The scale of the model on the y-axis

SetScaleZ(number scaleZ)

This action sets the scale of the model on the z-axis.

Parameters

  • number scaleZ: The scale of the model on the z-axis

SetWidth(number width)

This action sets the width of the model.

Parameters

  • number width: The width of the model

SetYaw(number yaw)

This action sets the yaw of the model which affects rotation.

Parameters

  • number yaw: The yaw of the model in degrees