Difference between revisions of "Scripting Tutorial: Working with FormLists"
Jump to navigation
Jump to search
Scripting Tutorial: Working with FormLists (edit)
Revision as of 10:30, 3 August 2009
, 10:30, 3 August 2009no edit summary
imported>Omzy |
imported>Omzy |
||
Line 81: | Line 81: | ||
*You can use the [[ListGetCount]] function. | *You can use the [[ListGetCount]] function. | ||
==Lists of | ==Using Lists to Create Floating Text== | ||
This example goes beyond what a casual modder might attempt to accomplish, but it displays the abilities of lists quite well. | |||
Suppose we have added 27 textured meshes into the GECK, corresponding to the letters of the English alphabet plus a space character. These meshes are added as forms (e.g. we have objects in the editor letterA, letterB, etc.). Now suppose we want to use these to display a list of names on a sign board in Fallout 3. | |||
We have determined: | |||
*The first letter of the first name should be positioned at (1000,1000,1000) in our cell with angle positions of (0,0,0). | |||
*The offset to the next letter is (0,5,0), meaning if the first letter of a name is at x=1000,y=1000,z=1000 in a cell, the next letter should be at x=1000,y=1005,z=1000. | |||
*The offset to the next name is (0,10,0), meaning if the first letter of the first name is at x=1000,y=1000,z=1000 in a cell, the first letter of the second name should be at x=1000,y=1000,z=1010. | |||
*Our names are (courtesy of FF7): | |||
#Cloud | |||
#Tifa | |||
#Barret | |||
#Aeris | |||
#Red XIII | |||
#Yuffie | |||
#Vincent | |||
#Cait Sith | |||
#Cid | |||
So, let us create a [[FormList]] for each name that contains the letters of that name | |||
As it would seem, a FormList is also an object in the editor, which has its own FormID. That makes a FormList a Form. What this means is that FormLists can contain other FormLists. This may seem a bit confusing if you've never learned any mid-level programming before, so lets look at the following script and see what it does: | As it would seem, a FormList is also an object in the editor, which has its own FormID. That makes a FormList a Form. What this means is that FormLists can contain other FormLists. This may seem a bit confusing if you've never learned any mid-level programming before, so lets look at the following script and see what it does: | ||