Difference between revisions of "Useful Scripts"
Jump to navigation
Jump to search
Reference scripts can use implied reference syntax
imported>Illyism (created page :"Example scripts".) |
imported>Cipscis (Reference scripts can use implied reference syntax) |
||
Line 6: | Line 6: | ||
Begin OnEquip | Begin OnEquip | ||
player.RewardKarma -650 | player.RewardKarma -650 | ||
End | |||
Begin OnUnequip | Begin OnUnequip | ||
player.RewardKarma 650 | player.RewardKarma 650 | ||
End | |||
</pre> | </pre> | ||
Line 38: | Line 38: | ||
Begin OnActivate | Begin OnActivate | ||
Activate | Activate | ||
if IsActionRef Player == 0 ;if it | if IsActionRef Player == 0 ;if it shouldn't work for the player remove this... | ||
set doorTimer to 5 | set doorTimer to 5 | ||
set closeDoor to 1 | set closeDoor to 1 | ||
endif | endif ;...and this | ||
End | End | ||
</pre> | </pre> | ||
Line 48: | Line 48: | ||
Script Type: Effect | Script Type: Effect | ||
<small>spell effect script for a weapon that knocks people far away and creates a trail of smoke or fire along the way. </small> | <small>spell effect script for a weapon that knocks people far away and creates a trail of smoke or fire along the way.<br />NOTE - Only works correctly when the player has the weapon equipped.</small> | ||
<pre> | <pre> | ||
scn CALFPeffectSCR | scn CALFPeffectSCR | ||
short ActorValue1 | short ActorValue1 | ||
Line 61: | Line 59: | ||
Begin ScriptEffectStart | Begin ScriptEffectStart | ||
; places initial explosion when hit, just in case there's no specified explosion effect in the weapons projectile | ; places initial explosion when hit, just in case there's no specified explosion effect in the weapons projectile | ||
; also useful if you'd want a melee weapon or fist to cause explosions on hit | ; also useful if you'd want a melee weapon or fist to cause explosions on hit | ||
placeatme {ExplosionType} | |||
Player.PushActorAway Target 104 | Player.PushActorAway Target 104 | ||
Line 80: | Line 76: | ||
set Damage to -1 * ( {formula incorporating actor values} ) | set Damage to -1 * ( {formula incorporating actor values} ) | ||
ModAv Health DamageValue | |||
; make the effect play a certain sound-you could also use the sound of the explosion and not specify a specific sound | ; make the effect play a certain sound-you could also use the sound of the explosion and not specify a specific sound | ||
Line 90: | Line 86: | ||
; this is the part where you place a smoke effect on every axis the NPC/Creature is located | ; this is the part where you place a smoke effect on every axis the NPC/Creature is located | ||
; it makes as if the smoke is always coming out of the target while the effect is taking place | ; it makes as if the smoke is always coming out of the target while the effect is taking place | ||
placeatme {smokeeffect} | |||
; alternatively add a smoke actor effect on the character | ; alternatively add a smoke actor effect on the character | ||
CastImmediateOnSelf {smoke actor effect} | |||
End | End | ||
begin ScriptEffectFinish | begin ScriptEffectFinish | ||
;if you used the above alternative, this segment removes the | ;if you used the above alternative, this segment removes the smoke effect from the character | ||
RemoveSpell {smoke actor effect} | |||
end | end | ||
Line 112: | Line 108: | ||
scn LightSwitchScript | scn LightSwitchScript | ||
ref light | ref light | ||
short toggle | short toggle | ||
begin onactivate | begin onactivate | ||
if light == 0 | if light == 0 | ||
set light to | set light to getlinkedref | ||
endif | endif | ||