Remove this ad
avatar

Stanimus

City Founder
Old Timer

Posts: 1,366 Member Since:19 July, 2014

#21 [url]

26 April, 2016 02:09:18

Ya, basically it's all the game settings, variables and definitions. You can open the file and read it with a text reader. It's a bunch of labels telling you just what they're for. And what their values are. That's the whole file, with a bunch of repetitive words in between for the computer.

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Quote    Reply   
Remove this ad
avatar

Stanimus

City Founder
Old Timer

Posts: 1,366 Member Since:19 July, 2014

#22 [url]

11 May, 2016 20:49:42

Example file

OK. I've been trying to get this right for awhile now.

This links to an example xml file with most of the 'computer-formatting' stripped out of it. You can see many/most of the variables available through this file. I did some minor formatting (indenting) to help keep it as clear as it can be. Also, several places could become terribly bloated and I've put elipses there (...).

This is only the file - taken from several game files - and no explanation is given in that blog. Look here for that info. Perhaps someone will add this to the wiki someday. But that's not this day. I tried posting it here but the lack of decent text formatting on this site forced me to post it in a blog on the wiki. I'll try again but stylizing text that works elsewhere isn't working here.

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Quote    Reply   
avatar

Stanimus

City Founder
Old Timer

Posts: 1,366 Member Since:19 July, 2014

#24 [url]

18 May, 2016 02:00:18

banks and tables in xml

I've done some more xml experimenting and found the following, with a surprise discovery. (The code examples below are slightly modified to display better.)


MEMORY BANK BEHAVIOR ENTRY

This is the actual code for the MemoryBankBlockBehavior section in a sample xml file:

Values Name="MemoryBankBlockBehavior"
   Values Name="Blocks"
      Value Name="3405,66,5002" Type="string" Value="FEDCBA9876543210;3" /
      Value Name="3403,65,5004" Type="string" Value="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F;0" /
    /Values
   Values Name="Items" /
   /Values

That is the code for two banks placed and programmed with data.

What that code means:

"MemoryBankBlockBehavior" has two sub-heads - "Blocks" and "Items".

The "Blocks" heading lists every bank by a unique 'Name', which is actually their location.
Each bank in this list has two values.
The first value is the data in that bank.
The second value is the data that is currently being output by the bank.

As you can see, the programmed data assumes all trailing data are '0's. The first bank was only programmed in the first row, so the remaining data are all '0's. The second bank was only programmed in the last cell so all leading data was fillled in as '0's.
The first bank has a battery connected to the AddressLow input which is supplying a steady voltage value of 'C' to the input. This causes the bank to output a '3' as indicated. The second bank has nothing connected to the address inputs and accordingly is outputting a '0'.

What the "Items" heading means for the bank behavior is yet unknown.

Note that this is NOT the block data for the memory bank so does not include the bank's orientation or connections. That information is inside the chunks file.

This means that it is possible to program every bank in a world, and set its current state outside of the game itself.


TRUTH TABLE BEHAVIOR ENTRY

The xml code for a truth table entry is:

Values Name="TruthTableCircuitBlockBehavior"
   Values Name="Blocks"
      Value Name="3407,66,4999" Type="string" Value="0F0000000000000F" /
   /Values
   Values Name="Items" /
   /Values

The structure is the same as for the Memory Bank. It has two sub-headings, "Blocks" and "Items".
Each table listed in the block section is also identified by its location.
There is only a single value for each table and this tells how it is programmed.
Each digit in the string represents one checkbox in the table's interface. The left-most digit is the top box, etc. Where the box is checked, an 'F' is present in the file.

This shows that through the xml file, we can do something that cannot be done 'normally', however! Each input and the output are normally assumed to be binary (digital). But, the above data shows that the output may be treated as a hexadecimal (analog) value. Rather than outputting an 'F' (digital '1') the table can actually output ANY hex value.
This feature gives us more flexibility in the Truth Table although it can only be utilized via editing the xml file. And it has been verified to work.

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Last Edited By: Stanimus 18 May, 2016 03:05:35. Edited 1 time.

Quote    Reply   
Remove this ad
avatar

Stanimus

City Founder
Old Timer

Posts: 1,366 Member Since:19 July, 2014

#25 [url]

26 May, 2016 23:16:27

World modification via XML

You can have a world with only certain areas modified to “Flat”. These areas could be at any level you wish, from 0 to 120. The rest of the world may be generated normally with common terrain features.

Wherever the step below says “open the xml file”, that means to:
1 open a good file manager, such as Xplore
2 find the file you just saved
3 rename the file’s extension to “.zip”
4 open the zip file (with Xplore, you must close the folder that the file is in, then re-open it so it recognizes it as a zip file)
5 locate the file proect.xml, inside that zip folder/file and open it with a text editor (with Xplore, long tap it and select ‘edit text’)
That may seem like a lot but it becomes one regular

When the step says “close the xml file”, that means to:
1 save the changes in the file
2 close the text editor
3 open the file manager (Xplore automatically opens it when closing the editor)
4 change the file’s extension back to “.scworld”


Making patches of flat terrain in a normal world:
1 create a random or seeded world
2 mark any chunks you wish to keep as normal terrain (place or remove any block in that chunk)
3 exit the world and save it to SD
4 open that world’s xml file
5 change terrain type to Flat
6 set new terrain level
7 set terrain block type as wanted
8 close the xml file
9 load it into SC and open it
10 mark all chunks to keep at that level
11 exit the world and save it to SD
12 open that world’s xml file
13 change back to Normal and level 64
14 close the xml file
15 load it into SC and open it
16 you have a ‘normal’ world with deep pits or high towers of flat terrain
You can repeat this process for any other levels you wish, higher or lower than normal. These will be flat with the terrain block specified.

If you start with a “Flat” world, you could change it to Normal to generate terrain but it always generates infinite ocean with islands. Even if you don’t modify it before making it “Normal”. As long as terrain generation is “Normal”, the terrain level doesn’t seem to matter.

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Quote    Reply   
avatar

Stanimus

City Founder
Old Timer

Posts: 1,366 Member Since:19 July, 2014

#26 [url]

8 July, 2016 19:18:01

...and don't forget that we can use any xna color in many places- not just the small built-in selection. See this page: http://survivalcraft.lefora.com/topic/19401019/custom-color-signs-color-pick-make-sign#.V3_7tvnD9eS

I'll have to see if all the 'new' paintable items use xna color codes...
...the answer is, NO, they do not. Rather they have unique block ids.

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Last Edited By: Stanimus 29 May, 2017 18:54:52. Edited 2 times.

Quote    Reply   
avatar

Stanimus

City Founder
Old Timer

Posts: 1,366 Member Since:19 July, 2014

#27 [url]

22 September, 2016 15:45:28

Finding block IDs

We can use the project file to determine the IDs of any pickable oobject in the game.

  1. Start in creative with any fresh world and place 1 chest.
  2. Fill that chest with 16 different blocks/items you want the IDs for. Write down which item is in which slot.
  3. Close the world and open its project file
  4. Go through the file and find the section for the chest. Hint: search "chest".
  5. Write down the IDs for each slot as listed. The slots start with Slot0, which is the upper-leftmost slot.

  6. You could also place a crafting table and fill it the same way. And fill the character's inventory and personal crafting, likewise. The chest, table and inventory are all listed and labelled separately so it's easy to tell them apart.You could even place more than one chest and still determine which is which. You fill each chest but leave ONLY ONE slot empty. Make sure it's a different slot for each chest. Then just match the list pairs by the missing slot. So, you could get the IDs of all missing objects at once this way.


  7. This is an example of a filled chest:
   


The IDs are defined in the line for "Contents". Note that some are small (185) while others are larger (917656). The larger numbered objects are ones added after the change to 32 bits.

Note that this is the technique for filling chests via the project file. Simply fill iin the ID for the objects you want in the chest and the quantity of each.
 

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Last Edited By: Stanimus 22 September, 2016 18:12:44. Edited 1 time.

Quote    Reply   
avatar

Stanimus

City Founder
Old Timer

Posts: 1,366 Member Since:19 July, 2014

#28 [url]

14 June, 2017 13:44:47

Furniture in the xml

 There are two general entries for furniture use. The first is for each furniture design and the second is for furniture packs.

This is an example basic entry for a furniture design:


After removing the formatting to male it more human readable:

Name = "21"
Name = "sign wrt"
TerrainUseCount = "1"
Resolution = "16"
InteractionMode = "ElectricButton"
     Values = ". . ."

There are 6 fields in this entry. The first Name is the internal reference to this particular furniture design. The game assigns this unique number to each design. The second Name is what the player named this design. The third field, "TerrainUseCount" keeps track of how many times this design is used in the world. The fourth field records the resolution, or initial size of the design. This can be from 2 to 16. The fifth field, "InteractionMode" tells the system what 'type' of furniture this piece is. The last field holds the actual design parameters of this piece.
-----
The valid values for the interaction mode are: "None", "ElectricButton", "ElectricSwitch", "Interactive" and "Connected". For the switch, interactive and connected types there will be an additional field:


or:
LinkedDesign = "29"

This is how each different design for a changing piece is defined and creates a linked list. The value specifies the next design in this list. For a switch, there will only be two designs in the list. For others, there may be up to 9 different designs.

-----
A linked list can usually be any length at all. The same is true of these. The reason there is a maximum of 9 different states is because of the limitation of making them in the crafting table. However, the xml file may be modified to create an interactive piece of virtually any number of states.

-----
-----

Furniture Packs
Here is a sample entry for a furniture pack (set):
       
         
         
         

or:

Name = "0"
Name = "Hexkeys"
ImportedFrom = "Hexkeys.scfpack"
Indices = "0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15"

As in furniture pieces, the first "Name" is assigned by the game. The second "Name" is the name given by the creator of the pack. This third field, "ImportedFrom" defines the file this pack was saved as. It will not be included if the pack was created in the current world. The last field, "Indices" specifies which individual pieces are included in this furniture pack.

————————————————————
"[The future] is a place about 70 miles east of here - where it's lighter." - Laurie Anderson


Stanimus

Last Edited By: Stanimus 18 June, 2017 10:42:14. Edited 2 times.

Quote    Reply   
Remove this ad
Add Reply

Quick Reply

bbcode help