Difference between revisions of "Mining tutorial"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Izjusme
Tag: Manual revert
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category: Scripting_Tutorials|Mining]]
{{Unfinished}}
 
[[Category: Articles to be Edited|!]]</noinclude>
<div id="esstyle">
<span class="header" style="Display: Block; Margin: -5px -5px 0px -5px;">Article Is Unfinished</span>
 
This article has been marked by editors or authors as incomplete. Please see the [[:{{NAMESPACE}} talk:{{PAGENAME}}|Talk page]] for details. Discussion and collaboration can improve an article and lead to a better Wiki.
</div>




Line 56: Line 49:
   
   
  Begin onactivate
  Begin onactivate
if isactionref player == 1
    if isactionref player == 1
if player.getitemcount ironore >= 1
      if player.getitemcount ironore >= 1
set amountofiron to player.getitemcount ironore
          set amountofiron to player.getitemcount ironore
player.removeitem ironore amountofiron
              player.removeitem ironore amountofiron
player.additem ironbar amountofiron
                    player.additem ironbar amountofiron
messagebox "You recieve some iron!"
                        messagebox "You recieve some iron!"
elseif player.getitemcount ironore < 1
      endif
messagebox "You don't have enough iron ore!"
   
endif
      elseif player.getitemcount ironore < 1
elseif isactionref player == 0
          messagebox "You don't have enough iron ore!"
set donothing to 1
      endif
endif
      elseif isactionref player == 0
  end
          set donothing to 1
      endif
    endif  
  end ; This script has been edited to be easier read


=== The Anvils ===
=== The Anvils ===

Latest revision as of 13:13, 21 December 2023


Introduction[edit | edit source]

This article is here because I wanted to put a piece or two of scripting knowlegde here.

THIS IS NOT COMPLETED YET


What This Teaches[edit | edit source]

This article teaches how to make a script for:

  1. A rock to mine ores from
  2. A furnace to refine the ores
  3. Different anvils to craft weapons and items


Here we go![edit | edit source]

The Rock[edit | edit source]

The script for the rock is very simple. Be sure to attach this script to a character that is shaped like a rock.

Scriptname AAAminingrockscript

Begin onhitwith pickaxe
Player.additem ironore 1
end

Lets examine what that means, shall we? We added the part where you hit it with the pickaxe

Begin onhitwith pickaxe

We added the part where you get the iron ore

Player.additem ironore 1

And we ended the script.

end

The Furnace[edit | edit source]

The Script for the furnace is a bit more complicated. Be sure you attach this script to an activator.

Scriptname aaafurnacescript

short donothing
short amountofiron

Begin onactivate
   if isactionref player == 1
      if player.getitemcount ironore >= 1
          set amountofiron to player.getitemcount ironore
              player.removeitem ironore amountofiron
                   player.additem ironbar amountofiron
                       messagebox "You recieve some iron!"
      endif
   
      elseif player.getitemcount ironore < 1
         messagebox "You don't have enough iron ore!"
      endif
      elseif isactionref player == 0
         set donothing to 1
      endif
   endif   
end ; This script has been edited to be easier read

The Anvils[edit | edit source]

This is a test. Using what you know of the scriptname, short, messagebox, isactionref, etc. commands, create the scripts for several anvils, each creating a different item. You can do it!

Contributors[edit | edit source]

The maker, Axle12693 16:51, 4 January 2007 (EST)