User Tools

Site Tools


set_entity_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
set_entity_script [2017/05/12 14:21] – external edit 127.0.0.1set_entity_script [2022/05/07 14:24] (current) justin
Line 2: Line 2:
 ---- ----
  
-Sets the script of the specified tile or object. An empty string value can be specified for the script name in order to remove the entity's script.+Sets the script of the specified [[tile]] or [[object]]. An empty [[string]] value can be specified for the [[script]] name in order to remove the [[entity|entity's]] [[script]]. The [[script]] name is case-sensitive.
  
 +====Signature:====
 <code python> <code python>
-set_entity_script(self"script_name")+set_entity_script(entity, script_name, trigger_type, triggerable_by_npc)
 </code> </code>
  
 ^Argument^Description^Type^Required^ ^Argument^Description^Type^Required^
-|self|Description.|[[String]]|Yes| +|entity|[[Entity]] to update the [[script]] for.|[[Entity]]|Yes| 
-"script_name"|Description.|[[String]]|Yes|+|script_name|Name of the new [[script]].|[[String]]|Yes
 +|trigger_type|When to trigger the [[script]]. This argument is only applicable to [[tile|tiles]] (possible values are ENTER_TILE, STOP_ON_TILE, and EXIT_TILE, with a default value of ENTER_TILE).|Trigger Type|No| 
 +|triggerable_by_npc|Determines whether or not [[npc|NPCs]] can trigger the [[script]].|[[Boolean]]|No|
  
 ====Example:==== ====Example:====
-<code python+<code bauxite
-set_entity_script(self, "script_name")+set_entity_script(entity["chest01"], "empty_chest");
 </code> </code>
-//Results://+//Results:// The [[script]] for [[entity]] "chest01" is removed and replaced with the "empty_chest" [[script]].
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Use the **Set Entity Script** function to ...+Use the **Set Entity Script** function to change the behavior of an [[object]] after it has been interacted with or to remove its [[script]] so it can no longer be interacted with, for example a door that the player cannot close once opened.
 </WRAP> </WRAP>
  
set_entity_script.1494624069.txt.gz · Last modified: 2017/05/12 14:21 by 127.0.0.1