9 downloads

I wrote a program to generate buildings.
just a "city"

GENERAL INFO

  • Created On: Android
  • Game Version: 0.9.923.0

CHARACTERISTICS

  • Radius: 200 km
  • Sea Level: None
  • Surface Gravity: 10.0 m/s
  • Rotational Period: N/A
  • Escape Velocity: 2.00 km/s
  • Mass: 5.99E+21kg

Atmosphere

  • No Atmosphere

EQUIRECTANGULAR MAP


2 Comments

  • Log in to leave a comment
  • Profile image

    2 months ago
  • Profile image
    8,382 Sibonitro


    import re
    from lxml import etree
    name=raw_input("Please key in planet name: ")
    path = ("/storage/emulated/0/Android/data/com.jundroo.SimpleRockets2/files/UserData/CelestialDatabase/CelestialBodies/" + name + ".xml")
    path2 ="/storage/emulated/0/Android/data/com.jundroo.SimpleRockets2/files/UserData/CelestialDatabase/CelestialBodies/structures_for_sr2city.xml"
    try:
    f =open(path,'r')
    f.close()
    plantes = etree.parse(path)
    root = plantes.getroot()
    sts = root.findall('StructureNodes/StructureNode/SubStructure/SubStructure')
    print(sts)
    structures_file= etree.parse(path2)
    structures_file=structures_file.getroot()
    structures_file= structures_file.findall('StructureNodes/StructureNode/SubStructure/SubStructure')
    for e in sts:
    structure_name=e.get("name")
    structure_name= structure_name.split("__")
    if structure_name[0]=="b":
    hight=0
    substructure=0
    substructure2=0
    sunstructure3=0
    if "floor" in e.get("name"):
    for substructure in structures_file:
    if substructure.get("name") == ("floor_" + structure_name[1]):
    add_hight=substructure.get("position")
    add_hight=add_hight.split(",")
    hight=2*float(add_hight[1])
    sst=etree.tostring(substructure)
    e.append(etree.XML(sst))
    sst=0
    print(etree.tostring(e))
    for substructure2 in structures_file:
    if substructure2.get("name") == ("storey_" + structure_name[1]):
    storeycount=e.get("scale")
    storeycount=storeycount.split(",")
    storeycount=int(storeycount[1])
    for storey in range(storeycount):
    add_hight=substructure2.get("position")
    add_hight=add_hight.split(",")
    hight=float(add_hight[1])+hight
    hight2=float(add_hight[1])+hight
    ssh=add_hight[1]
    add_hight[1]=str(hight)
    hight=hight2
    text = add_hight[0]+","+add_hight[1]+","+add_hight[2]
    substructure2.set("position",text)
    #print(substructure2.get("position"))
    sst=etree.tostring(substructure2)
    e.append(etree.XML(sst))
    sst=0
    text = add_hight[0]+","+str(ssh)+","+add_hight[2]
    substructure2.set("position",text)
    if "top" in e.get("name"):
    sunstructure3=0
    for substructure3 in structures_file:
    if substructure3.get("name") == ("top_" + structure_name[1]):
    add_hight=0
    add_hight=substructure3.get("position")
    print(substructure3.get("position"))
    add_hight=add_hight.split(",")
    add_hight[1]=float(add_hight[1])+hight
    text = add_hight[0]+","+str(add_hight[1])+","+add_hight[2]
    sst=etree.tostring(substructure3)
    sst2=etree.XML(sst)
    sst2.set("position",text)
    sst=etree.tostring(substructure3)
    e.append(sst2)
    sst=0
    sst2=0
    hight=0
    e.set("name",structure_name[1])
    e.set("scale","1,1,1")
    #print(etree.tostring(plantes))
    plantes.write(path)
    except IOError:
    print("no file")

    2 months ago

6 Upvotes

Log in in to upvote this post.