Template:ScriptSpawnItem: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(Created page with "The entity class script is loaded from <code>graph/obj3d/interactive/items/<script>.asl</code>. If the filename component of the script path starts with <code>gold_coin</code> gold coin then the item will be treated as a gold coin which means that it will be added to the player's purse when the player interacts with it or when it would be added to the player inventory. Gold coins also somewhat act like stacks but use the Script:setprice|...")
 
mNo edit summary
 
Line 1: Line 1:
The entity class script is loaded from <code>graph/obj3d/interactive/items/<script>.asl</code>.
The entity class script is loaded from <code>graph/obj3d/interactive/items/{{{name|<script>}}}.asl</code>.


If the filename component of the script path starts with <code>gold_coin</code> gold coin then the item will be treated as a gold coin which means that it will be added to the [[player]]'s purse when the player interacts with it or when it would be added to the player inventory. Gold coins also somewhat act like [[Script:playerstacksize|stacks]] but use the [[Script:setprice|price]] in place of the [[Script:setcount|count]] and have the icon automatically selected based on the price.
If the filename component of the script path starts with <code>gold_coin</code> gold coin then the item will be treated as a gold coin which means that it will be added to the [[player]]'s purse when the player interacts with it or when it would be added to the player inventory. Gold coins also somewhat act like [[Script:playerstacksize|stacks]] but use the [[Script:setprice|price]] in place of the [[Script:setcount|count]] and have the icon automatically selected based on the price.
Line 5: Line 5:
If the script path contains the string <code>movable</code> then the item cannot be added to inventories and is dropped in front of the player instead whenever it would be.
If the script path contains the string <code>movable</code> then the item cannot be added to inventories and is dropped in front of the player instead whenever it would be.


The initial mesh of the item will be <code>graph/obj3d/interactive/items/<script>.teo</code> with the cooked mesh loaded from <code>game/graph/obj3d/interactive/items/<script>.ftl</code>. Either the raw mesh, cooked mesh or entity class script file must exist or the item will not be created.
The initial mesh of the item will be <code>graph/obj3d/interactive/items/{{{name|<script>}}}.teo</code> with the cooked mesh loaded from <code>game/graph/obj3d/interactive/items/{{{name|<script>}}}.ftl</code>. Either the raw mesh, cooked mesh or entity class script file must exist or the item will not be created.


The initial icon of the item will be <code>graph/obj3d/interactive/items<script>[icon]</code> if it exists or <code>graph/interface/misc/default[icon]</code> otherwise. The icon size determines how many slots the item takes up in inventories except for movable items (which have no icon) and gold coins (where the icon depends on the price).
The initial icon of the item will be <code>graph/obj3d/interactive/items{{{name|<script>}}}[icon]</code> if it exists or <code>graph/interface/misc/default[icon]</code> otherwise. The icon size determines how many slots the item takes up in inventories except for movable items (which have no icon) and gold coins (where the icon depends on the price).


{{Notice|In version before {{Changelog|1.3}} the icon file at the default path must also exist or the item will not be created, even for gold coins, movable items or items that change the icon in the {{Event|load}} event.}}
{{Notice|In version before {{Changelog|1.3}} the icon file at the default path must also exist or the item will not be created, even for gold coins, movable items or items that change the icon in the {{Event|load}} event.}}

Latest revision as of 12:45, 19 June 2022

The entity class script is loaded from graph/obj3d/interactive/items/<script>.asl.

If the filename component of the script path starts with gold_coin gold coin then the item will be treated as a gold coin which means that it will be added to the player's purse when the player interacts with it or when it would be added to the player inventory. Gold coins also somewhat act like stacks but use the price in place of the count and have the icon automatically selected based on the price.

If the script path contains the string movable then the item cannot be added to inventories and is dropped in front of the player instead whenever it would be.

The initial mesh of the item will be graph/obj3d/interactive/items/<script>.teo with the cooked mesh loaded from game/graph/obj3d/interactive/items/<script>.ftl. Either the raw mesh, cooked mesh or entity class script file must exist or the item will not be created.

The initial icon of the item will be graph/obj3d/interactive/items<script>[icon] if it exists or graph/interface/misc/default[icon] otherwise. The icon size determines how many slots the item takes up in inventories except for movable items (which have no icon) and gold coins (where the icon depends on the price).

ℹ️  In version before Arx Libertatis 1.3 the icon file at the default path must also exist or the item will not be created, even for gold coins, movable items or items that change the icon in the load event.