Difference between revisions of "Useful Scripts"

Jump to navigation Jump to search
1,705 bytes removed ,  03:47, 4 March 2010
Removed water purifier script - doesn't really belong on this page
imported>Henning
(water purifier example script added)
imported>Cipscis
(Removed water purifier script - doesn't really belong on this page)
Line 300: Line 300:
     ;if you used the above alternative, this segment removes the smoke effect from the character
     ;if you used the above alternative, this segment removes the smoke effect from the character
     RemoveSpell {smoke actor effect}
     RemoveSpell {smoke actor effect}
end
</pre>
==Water Purifier==
Script Type: Object
<small>A very simple script, with an example of using an activator to manipulate items in the player's inventory. You can pick up some basics from this script. Based loosely on the House Nuka-Cola machine script in game, this is for use on an activator that purifies bottles of dirty water in the player's inventory.</small>
<pre>
scn AAAwpscript
;This script is designed to handle a Water Purifier
;This script is attached to the Water Purifier I have added in the player's megaton house
;Basically all it does is check to see how many dirty waters the player is carrying, it removes them all and adds purified waters instead
short DirtyOnMe      ;declare a variable to store the number of dirty waters the player has
begin OnActivate      ;starts the script when the purifier is activated
if ( IsActionRef Player == 1 )
;checks to make sure you are the player
if ( Player.GetItemCount WaterUnpurified >= 1 )
;checks to make sure you actually have some dirty water on you
ShowMessage AAAWPdirtywith     
;displays a message that tells the player what the machine does
set DirtyOnMe to ( Player.GetItemCount WaterUnpurified )
;sets DirtyOnMe to however many Dirty Waters the player has
Player.RemoveItem WaterUnpurified DirtyOnMe     
;removes all of the player's dirty water from the invent.
player.AddItem WaterPurified DirtyOnMe     
;adds the purified water - same number as dirt waters removed
elseif ( Player.GetItemCount WaterUnpurified < 1 )     
;if the player has no dirty water in their invent
ShowMessage AAAWPdirtywithout     
;display a message telling the player they need more dirty water
endif
endif
end
end


Anonymous user

Navigation menu