Research:Scripting: Difference between revisions
Jump to navigation
Jump to search
(New section on script global variables.) |
Capostrophic (talk | contribs) m (Update iMonthsToRespawn status) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:Research Navbox}} | |||
==Script commands== | ==Script commands== | ||
Line 20: | Line 23: | ||
|12.0 | |12.0 | ||
|rowspan="6"|Time system | |rowspan="6"|Time system | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|Year | |Year | ||
|427.0 | |427.0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|Month | |Month | ||
|7.0 | |7.0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|Day | |Day | ||
|17.0 | |17.0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|DaysPassed | |DaysPassed | ||
|1.0 | |1.0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|TimeScale | |TimeScale | ||
|30.0 | |30.0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|CharGenState | |CharGenState | ||
|0 | |0 | ||
|Character creation | |Character creation | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|MonthsToRespawn | |MonthsToRespawn | ||
|1.0 | |1.0 | ||
|Container respawning | |[[Research:World#Container_respawning|Container respawning]] | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|PCKnownWerewolf | |PCKnownWerewolf | ||
|0 | |0 | ||
|Werewolf transformation | |Werewolf transformation | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|WerewolfClawMult | |WerewolfClawMult | ||
|1.0 | |1.0 | ||
|Werewolf melee damage | |[[Research:Combat#Damage|Werewolf melee damage]] | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|CrimeGoldDiscount | |CrimeGoldDiscount | ||
|0 | |0 | ||
|rowspan="5"|[[Research:Dialogue_and_Messages#Dialogue_global_variables|Dialogue global variables]] | |rowspan="5"|[[Research:Dialogue_and_Messages#Dialogue_global_variables|Dialogue global variables]] | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|CrimeGoldTurnIn | |CrimeGoldTurnIn | ||
|0 | |0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|PCHasCrimeGold | |PCHasCrimeGold | ||
|0 | |0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|PCHasGoldDiscount | |PCHasGoldDiscount | ||
|0 | |0 | ||
| | |<font color="green">implemented</font> | ||
|- | |- | ||
|PCHasTurnIn | |PCHasTurnIn | ||
|0 | |0 | ||
| | |<font color="green">implemented</font> | ||
|} | |||
These defaults are engine defaults that have a lower priority than values read from data files. This means a new game will have the values from the base game data rather than these values. | |||
==Actor local variables== | |||
The engine exposes actor events and additional actor information through local script variables. | |||
===List of named locals=== | |||
{| class="wikitable" | |||
!ID | |||
!Type | |||
!Used in | |||
!Implementation status | |||
|- | |||
|Companion | |||
|short | |||
|rowspan="3"|Companions | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|stayOutside | |||
|short | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|minimumProfit | |||
|float | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|OnPCEquip | |||
|short | |||
|Set to 1 when an item is equipped | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|OnPCAdd | |||
|short | |||
|Set to 1 when an item is added to the inventory | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|OnPCHitMe | |||
|short | |||
|Set to 1 when the player attempts to damage an actor | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|OnPCDrop | |||
|short | |||
|Set to 1 when an item is dropped | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|OnPCRepair | |||
|short | |||
|Set to 1 when an item is repaired | |||
|{{StatusCol|green|implemented}} | |||
|- | |||
|OnPCSoulGemUse | |||
|short | |||
|Set to 1 when a soul gem is used (non-functional) | |||
|{{StatusCol|orange|unimplementable}} | |||
|- | |||
|PCSkipEquip | |||
|short | |||
|If set to 1, will prevent the equipping of an item | |||
|{{StatusCol|green|implemented}} | |||
|} | |} | ||
{{Template:Research Navbox}} |
Latest revision as of 17:16, 15 May 2019
Script commands
See Scripting (status).
Script global variables
Engine data exposed to scripts through script global variables, rather than accessor functions.
List of exposed globals
ID | Default value | Used in | Implementation status |
---|---|---|---|
GameHour | 12.0 | Time system | implemented |
Year | 427.0 | implemented | |
Month | 7.0 | implemented | |
Day | 17.0 | implemented | |
DaysPassed | 1.0 | implemented | |
TimeScale | 30.0 | implemented | |
CharGenState | 0 | Character creation | implemented |
MonthsToRespawn | 1.0 | Container respawning | implemented |
PCKnownWerewolf | 0 | Werewolf transformation | implemented |
WerewolfClawMult | 1.0 | Werewolf melee damage | implemented |
CrimeGoldDiscount | 0 | Dialogue global variables | implemented |
CrimeGoldTurnIn | 0 | implemented | |
PCHasCrimeGold | 0 | implemented | |
PCHasGoldDiscount | 0 | implemented | |
PCHasTurnIn | 0 | implemented |
These defaults are engine defaults that have a lower priority than values read from data files. This means a new game will have the values from the base game data rather than these values.
Actor local variables
The engine exposes actor events and additional actor information through local script variables.
List of named locals
ID | Type | Used in | Implementation status |
---|---|---|---|
Companion | short | Companions | implemented |
stayOutside | short | implemented | |
minimumProfit | float | implemented | |
OnPCEquip | short | Set to 1 when an item is equipped | implemented |
OnPCAdd | short | Set to 1 when an item is added to the inventory | implemented |
OnPCHitMe | short | Set to 1 when the player attempts to damage an actor | implemented |
OnPCDrop | short | Set to 1 when an item is dropped | implemented |
OnPCRepair | short | Set to 1 when an item is repaired | implemented |
OnPCSoulGemUse | short | Set to 1 when a soul gem is used (non-functional) | unimplementable |
PCSkipEquip | short | If set to 1, will prevent the equipping of an item | implemented |