Editing Useful Scripts
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
==Karma Effects on Items== | |||
= | Script Type: Effect<br /> | ||
<small>For armour, you can use a scripted Object Effect. This allows the armour to safely be equipped and unequipped via [[EquipItem]] and [[UnequipItem]]</small> | |||
Script Type: | |||
<small> | |||
<pre> | <pre> | ||
ScriptName | ScriptName KarmaEffect | ||
ref rWearer | |||
Begin ScriptEffectStart | |||
set rWearer to GetSelf | |||
if rWearer.GetIsReference player | |||
RewardKarma -650 | |||
endif | |||
End | End | ||
Begin ScriptEffectFinish | |||
if rWearer.GetIsReference player | |||
player.RewardKarma 650 | |||
endif | |||
Begin | |||
End | End | ||
</pre> | </pre> | ||
Script Type: Object<br /> | |||
<small>For weapons, you'll have to use an Object Script. "Weapon" type Object Effects are applied to that weapon's target, and are therefore unsuitable for applying effects to the wielder</small> | |||
<pre>ScriptName KarmaEffect | |||
Begin OnEquip player | |||
RewardKarma -650 | |||
Begin | |||
End | End | ||
Begin OnUnequip player | |||
player.RewardKarma 650 | |||
End | End | ||
</pre> | </pre> | ||
==Autoclosing door== | ==Autoclosing door== | ||
Line 228: | Line 64: | ||
endif | endif | ||
Activate | Activate | ||
End | End | ||
</pre> | </pre> | ||
Line 323: | Line 122: | ||
</pre> | </pre> | ||
== | ==Light switch== | ||
Script Type:Object | |||
<small>To be placed on an [[activator]], and [[Reference#Linked_Ref|linked]] to a light source or x-marker [[Reference#Enable_Parent|Enable Parent]].</small> | |||
</ | |||
<pre> | <pre> | ||
ScriptName LightSwitchScript | |||
ref light | |||
Begin OnActivate | |||
if light == 0 | |||
set light to GetLinkedRef | |||
Begin OnActivate | |||
set | |||
endif | endif | ||
if light.GetDisabled | |||
light.Enable | |||
if | |||
else | else | ||
light.Disable | |||
endif | endif | ||
Activate | |||
End | End | ||
</pre> | </pre> |