XCRs Bitch (talk | contribs) No edit summary |
(Category, Tableification) |
||
Line 1: | Line 1: | ||
Sinfar uses a custom system by which you can assign default scripts to a monster then use variables to inject a script and its behavior onto the monster based on the event. | Sinfar uses a custom system by which you can assign default scripts to a monster then use variables to inject a script and its behavior onto the monster based on the event. | ||
[[File:Scripts Onto Monsters.png|thumb|Screenshot of what the script and save scriptset/load script set buttons look like in the toolset underneath the 'scripts' tab on creature editors.]] | |||
The default scripts are as following: | The default scripts are as following: | ||
{| class="wikitable" border=1 | |||
!Field!!Default Script | |||
OnBlocked | |- | ||
|OnBlocked||nw_c2_defaulte | |||
OnDamaged | |- | ||
|OnDamaged||nw_c2_default6 | |||
OnDeath | |- | ||
|OnDeath||nw_c2_default7 | |||
OnConversation | |- | ||
|OnConversation||nw_c2_default4 | |||
OnDisturbed | |- | ||
|OnDisturbed||nw_c2_default8 | |||
OnCombatRoundEnd | |- | ||
|OnCombatRoundEnd||nw_c2_default3 | |||
OnHeartbeat | |- | ||
|OnHeartbeat||nw_c2_default1 | |||
OnPhysicalAttacked | |- | ||
|OnPhysicalAttacked||nw_c2_default5 | |||
OnPerception | |- | ||
|OnPerception||nw_c2_default2 | |||
OnRested | |- | ||
|OnRested||x2_def_rested | |||
OnSpawn | |- | ||
|OnSpawn||nw_c2_default9 | |||
OnSpellCast | |- | ||
|OnSpellCast||nw_c2_defaultb | |||
OnUserDefined | |- | ||
|OnUserDefined||x2_def_userdef | |||
|} | |||
- The only script that isn't defined by Sinfar edits is OnUserDefined (as far as I know). | - The only script that isn't defined by Sinfar edits is OnUserDefined (as far as I know). | ||
- It is recommended you create a monster and assign the default scripts to it in the toolset, and 'save the script set' and inject it to all monsters hereon. This way you can use 'load script' to inject all the code at once. | - It is recommended you create a monster and assign the default scripts to it in the toolset, and 'save the script set' and inject it to all monsters hereon. This way you can use 'load script' to inject all the code at once. | ||
=== The variables === | |||
=== The variables | [[File:Image.png|thumb|Example of the EVENT_AI_DEATH use]] | ||
The variables in bold are what you would use to put on your monster. | The variables in bold are what you would use to put on your monster. | ||
<div style="clear: right;"> | |||
{| class="wikitable" border=1 | |||
!Script!!Script description!!Event Name String!!Pre-event description | |||
|- | |||
nw_c2_default1 | |nw_c2_default1||On Heartbeat event||'''EVENT_AI_HEARTBEAT''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default2 | |nw_c2_default2||On Perception event||'''EVENT_AI_PERCEPTION''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default3 | |nw_c2_default3||On Combat Round End event||'''EVENT_AI_ENDCOMBATROUND''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default4 | |nw_c2_default4||On Conversation event||'''EVENT_AI_CONVERSATION''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default5 | |nw_c2_default5||On Attacked event||'''EVENT_AI_ATTACKED''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default6 | |nw_c2_default6||On Damaged event||'''EVENT_AI_DAMAGED''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default7 | |nw_c2_default7||On Death event||'''EVENT_AI_DEATH''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default8 | |nw_c2_default8||On Disturbed event||'''EVENT_AI_DISTURBED''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_default9 | |nw_c2_default9||On Spawned event||'''EVENT_AI_SPAWN''' (string)||Script name for pre-event use. | ||
|- | |||
nw_c2_defaultb | |nw_c2_defaultb||On Spell Cast At event||'''EVENT_AI_CASTAT''' (string)||Script name for pre-event use. | ||
|- | |||
|nw_c2_defaulte||On Blocked event||'''EVENT_AI_BLOCKED''' (string)||Script name for pre-event use. | |||
|} | |||
</div> | |||
[[File:OnUserDefinedScreenshot.png|thumb|At the very bottom, you would hardcode and directly use the script name on the OnUserDefined event.]]For OnUserDefined functions, you would apply the script '''directly''' onto the monster. | |||
Note : nw_c2_default9 uses the variable ENTIRE_APPEARANCE2 already | |||
You can also register these events dynamically using [[Variable Based Events]]. | |||
[[Category:Builders Tools]] | |||
[[ |
Latest revision as of 22:10, 17 January 2024
Sinfar uses a custom system by which you can assign default scripts to a monster then use variables to inject a script and its behavior onto the monster based on the event.
The default scripts are as following:
Field | Default Script |
---|---|
OnBlocked | nw_c2_defaulte |
OnDamaged | nw_c2_default6 |
OnDeath | nw_c2_default7 |
OnConversation | nw_c2_default4 |
OnDisturbed | nw_c2_default8 |
OnCombatRoundEnd | nw_c2_default3 |
OnHeartbeat | nw_c2_default1 |
OnPhysicalAttacked | nw_c2_default5 |
OnPerception | nw_c2_default2 |
OnRested | x2_def_rested |
OnSpawn | nw_c2_default9 |
OnSpellCast | nw_c2_defaultb |
OnUserDefined | x2_def_userdef |
- The only script that isn't defined by Sinfar edits is OnUserDefined (as far as I know).
- It is recommended you create a monster and assign the default scripts to it in the toolset, and 'save the script set' and inject it to all monsters hereon. This way you can use 'load script' to inject all the code at once.
The variables
The variables in bold are what you would use to put on your monster.
Script | Script description | Event Name String | Pre-event description |
---|---|---|---|
nw_c2_default1 | On Heartbeat event | EVENT_AI_HEARTBEAT (string) | Script name for pre-event use. |
nw_c2_default2 | On Perception event | EVENT_AI_PERCEPTION (string) | Script name for pre-event use. |
nw_c2_default3 | On Combat Round End event | EVENT_AI_ENDCOMBATROUND (string) | Script name for pre-event use. |
nw_c2_default4 | On Conversation event | EVENT_AI_CONVERSATION (string) | Script name for pre-event use. |
nw_c2_default5 | On Attacked event | EVENT_AI_ATTACKED (string) | Script name for pre-event use. |
nw_c2_default6 | On Damaged event | EVENT_AI_DAMAGED (string) | Script name for pre-event use. |
nw_c2_default7 | On Death event | EVENT_AI_DEATH (string) | Script name for pre-event use. |
nw_c2_default8 | On Disturbed event | EVENT_AI_DISTURBED (string) | Script name for pre-event use. |
nw_c2_default9 | On Spawned event | EVENT_AI_SPAWN (string) | Script name for pre-event use. |
nw_c2_defaultb | On Spell Cast At event | EVENT_AI_CASTAT (string) | Script name for pre-event use. |
nw_c2_defaulte | On Blocked event | EVENT_AI_BLOCKED (string) | Script name for pre-event use. |
For OnUserDefined functions, you would apply the script directly onto the monster.
Note : nw_c2_default9 uses the variable ENTIRE_APPEARANCE2 already
You can also register these events dynamically using Variable Based Events.