Data Realms Fan Forums
http://45.55.195.193/

Tutorial: Atomgroups
http://45.55.195.193/viewtopic.php?f=1&t=13508
Page 1 of 1

Author:  Geti [ Sat Jan 17, 2009 7:16 am ]
Post subject:  Tutorial: Atomgroups

This tutorial outlines how to create custom atomgroups, to interact with terrain. These are used, for example, in footgroups.

You Will Need:
Code:
Either:
   A) a brain that can visualise an object in pixels well
   B) an image editor (eg. MSPaint, GIMP)
A text editor (Notepad on windows, TextEditor on mac)


First of all, open up any referenced .ini that loads before to object you are applying the atomgroup to, or the one that it does load in. this is to ensure that when you reference the group as a CopyOf, it doesnt crash.
From here, add this code, and dont forget to name it.
Code:
AddActor = AtomGroup
   PresetName = <Name Here>
   AutoGenerate = 0

now, open up paint, or use your mind to draw the object you want. for food and hand groups, this should just be a line, but it could be anything made out of pixels.
pick a pixel, and colour it red, this is your 0,0 co-ordinate.
add this code to place that pixel as an atom
Code:
   AddAtom = Atom
      Material = Material
         CopyOf = Metal

see the line about Material, and the copyof reference below it? this can be anything, or the material can be omitted. when the material is omitted, the game will give the atomgroup the default material (or at least in my experience it will). if you want custom collisions, for example for bounce and friction, edit it here.
DONT BOTHER WITH THE NEXT STEP IF YOU WANT YOUR ATOMGROUP ATTACHED AT THE RED PIXEL.
now, decide where you want your atomgroup to be joined to your actor, and colour this green. count how many pixels across to the right from your red pixel this is, and remember this number as "X". if it is to the left, use negative numbers. count how many pixels downwards from your red pixel this is, and remember this number as "Y". if it is upwards, use negative numbers.
add this code to place your jointoffset (you dont have to bother if you want your atomgroup attached to the red pixel), remember to put your x value where <X> is , and your y value where <Y> is:
Code:
   JointOffset = Vector
      X = <X>
      Y = <Y>

in any case, to place any other atoms, count from your 0,0 pixel in the same manner as you did for your jointoffset (right for positive X, left for negative X, down for positive Y, up for negative Y) and use this code to place the remaining atoms
Code:
   AddAtom = Atom
      Offset = Vector
         X = <X>
         Y = <Y>

as boring as that is, you have to do it to place all the atoms.

congratulations, you've made a custom atomgroup!

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/