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: Object | |||
Script Type:Object | |||
<pre> | <pre> | ||
scn KarmaEffect | |||
Begin OnEquip | |||
player.RewardKarma -650 | |||
END | |||
Begin OnUnequip | |||
player.RewardKarma 650 | |||
END | |||
</pre> | </pre> | ||
==Autoclosing door== | ==Autoclosing door== | ||
Line 210: | Line 24: | ||
Begin GameMode | Begin GameMode | ||
if closeDoor == 1 | |||
if doorTimer > 0 | |||
set doorTimer to doorTimer - getSecondsPassed | |||
else | |||
;close the door | |||
Activate | |||
; Lock | |||
set closeDoor to 0 | |||
endif | |||
endif | |||
End | End | ||
Begin OnActivate | Begin OnActivate | ||
Activate | |||
if IsActionRef Player == 0 ;if it only works for NPCs remove this ..... | |||
set doorTimer to 5 | |||
set closeDoor to 1 | |||
endif ;...and this | |||
End | End | ||
</pre> | </pre> | ||
Line 271: | 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>spell effect script for a weapon that knocks people far away and creates a trail of smoke or fire along the way. </small> | ||
<pre> | <pre> | ||
scn CALFPeffectSCR | scn CALFPeffectSCR | ||
ref Target | |||
short ActorValue1 | short ActorValue1 | ||
Line 282: | Line 61: | ||
Begin ScriptEffectStart | Begin ScriptEffectStart | ||
set Target to GetSelf | |||
; 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} | Target.placeatme {ExplosionType} | ||
Player.PushActorAway Target 104 | Player.PushActorAway Target 104 | ||
Line 299: | Line 80: | ||
set Damage to -1 * ( {formula incorporating actor values} ) | set Damage to -1 * ( {formula incorporating actor values} ) | ||
ModAv Health DamageValue | Target.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 309: | Line 90: | ||
; 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} | Target.placeatme {smokeeffect} | ||
; alternatively add a smoke actor effect on the character | ; alternatively add a smoke actor effect on the character | ||
CastImmediateOnSelf {smoke actor effect} | Target.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 smok eeffect from the character | ||
RemoveSpell {smoke actor effect} | Player.RemoveSpell {smoke actor effect} | ||
end | end | ||
</pre> | </pre> | ||
== | ==Light switch== | ||
Script Type:Object | |||
<small>To be placed on an [[activator]], and [[Reference#Linked_Ref|linked]] to a light source or a x-marker [[Reference#Enable_Parent|parent]].</small> | |||
</ | |||
<pre> | <pre> | ||
scn LightSwitchScript | |||
ref myself | |||
ref light | |||
short toggle | |||
begin onactivate | |||
if myself == 0 | |||
set myself to this | |||
endif | |||
if light == 0 | |||
set light to myself.getlinkedref | |||
endif | |||
if toggle == 0 | |||
light.disable | |||
activate | |||
set toggle to 1 | |||
else | |||
light.enable | |||
set toggle to 0 | |||
activate | |||
endif | |||
end | |||
</pre> | </pre> |