Entity Mod JSON Format: Difference between revisions

From SkyCorp Global
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
|-
|-
|string
|string
|name
|'''name'''
Title of the item.
Title of the item.
|-
|-
|string
|string
|description
|'''description'''
Description of the item when looked at.
Description of the item when looked at.
|-
|-
|boolean
|boolean
|playerOnEnterRoom
|'''playerOnEnterRoom'''
Can be used to present some special text when player enters a room when this object is inside it.   
Can be used to present some special text when player enters a room when this object is inside it.   


Normally true.  If false, will prevent mapscene from doing further room processing (be sure to use a continue)
Normally true.  If false, will prevent mapscene from doing further room processing (be sure to use a continue scene)
|-
|-
|boolean
|boolean
|playerAttemptLeaveRoom
|'''playerAttemptLeaveRoom'''


Can be used to prevent  
Can be used to prevent player from leaving room when in same room as entity.
 
Normally true.  If false, will prevent mapscene from doing further room processing (be sure to use a continue scene)
|-
|-
|boolean
|boolean
|isExaminable
|'''isExaminable'''
Allow player to examine object?  (This is the page description is displayed on.  Otherwise will be invisible to player).
|-
|-
|boolean
|boolean
|isUseable
|'''isUseable'''
Display the 'use' button on the examine item page?
|-
|-
|boolean
|boolean
|doUse
|'''doUse'''
Action to do on using entity.
 
Usually should return true -- this will cause a continue scene after the text.
 
For a manual continue or a different scene change, return false.
|-
|-
|boolean
|boolean
|isPickupable
|'''isPickupable'''
Should a pick-up item be displayed on item page if item is in the world?
|-
|-
|boolean
|boolean
|playerAttemptPickupCheck
|'''playerAttemptPickupCheck'''
Player has opted to pick up the item (may output descriptive message to screen)
 
Returns if successful in pickup attempt.
|-
|-
|boolean
|boolean
|isDropable
|'''isDropable'''
Should a drop item be displayed on item page if item is in inventory?
|-
|-
|boolean
|boolean
|playerAttemptDropCheck
|'''playerAttemptDropCheck'''
Player has opted to drop the item.  Return if successful in drop attempt.
|-
|-
|void
|void
|inInventoryTick
|'''inInventoryTick'''
Called each turn the item exists in the player's inventory.
|-
|-
|void
|void
|inWorldTick
|'''inWorldTick'''
Called each turn the item exists on the map somewhere (may not be called if player is on a different map).
|-
|-
|void
|void
|notifyPlayerEnterRoom
|'''(TODO) notifyPlayerEnterRoom'''
|-
|-
|void
|void
|notifyPlayerEnterRoomPreScene
|'''(TODO) notifyPlayerEnterRoomPreScene'''
|-
|-
|void
|void
|notifyPlayerLeftRoom
|'''(TODO) notifyPlayerLeftRoom'''
|}
|}

Revision as of 06:32, 21 December 2017

Entity JSON supports a variety of parameters to create custom objects. JSON definitions can specify each as programmable (LUA) or literal values.

Return Type Parameter
string name

Title of the item.

string description

Description of the item when looked at.

boolean playerOnEnterRoom

Can be used to present some special text when player enters a room when this object is inside it.

Normally true. If false, will prevent mapscene from doing further room processing (be sure to use a continue scene)

boolean playerAttemptLeaveRoom

Can be used to prevent player from leaving room when in same room as entity.

Normally true. If false, will prevent mapscene from doing further room processing (be sure to use a continue scene)

boolean isExaminable

Allow player to examine object?  (This is the page description is displayed on. Otherwise will be invisible to player).

boolean isUseable

Display the 'use' button on the examine item page?

boolean doUse

Action to do on using entity.

Usually should return true -- this will cause a continue scene after the text.

For a manual continue or a different scene change, return false.

boolean isPickupable

Should a pick-up item be displayed on item page if item is in the world?

boolean playerAttemptPickupCheck

Player has opted to pick up the item (may output descriptive message to screen)

Returns if successful in pickup attempt.

boolean isDropable

Should a drop item be displayed on item page if item is in inventory?

boolean playerAttemptDropCheck

Player has opted to drop the item. Return if successful in drop attempt.

void inInventoryTick

Called each turn the item exists in the player's inventory.

void inWorldTick

Called each turn the item exists on the map somewhere (may not be called if player is on a different map).

void (TODO) notifyPlayerEnterRoom
void (TODO) notifyPlayerEnterRoomPreScene
void (TODO) notifyPlayerLeftRoom