Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - --LegoPepper--

Pages: 1 2 3 4 [5] 6 7 8 9 10 ... 127
61
Ayy lmao!

62
You can put tons of convex meshes in a single dts for collision.
See, I tried that. I edited Tendon's script to put 60 collision meshes in each dts but the collision still didn't work :/

Thing is, bl takes like 10 minutes to download those 8MB.
It's unbelievably slow for files not on the CDN.
Yeah, gotcha.

Here's my version of Tendon's export.py that I edited: Maybe I did something wrong?
Code: [Select]
import bpy
import os

def get_override(area_type, region_type):
for area in bpy.context.screen.areas:
if area.type == area_type:             
for region in area.regions:                 
if region.type == region_type:                   
override = {'area': area, 'region': region}
return override
#error message if the area or region wasn't found
raise RuntimeError("Wasn't able to find", region_type," in area ", area_type,
"\n Make sure it's open while executing script.")

#we need to override the context of our operator   
override = get_override( 'VIEW_3D', 'WINDOW' )

#override is for resizing an object by the median center of it's vertices.  It's not needed here, but maybe in the future.

def dodtloveports(exportpath,blpath):
#setup script files
if os.path.exists(exportpath + 'server.cs') == False:
textserver = open(exportpath + 'server.cs', "w")
textserver.write("exec(\"./data.cs\");")
textserver.close()
if os.path.exists(exportpath + 'description.txt') == False:
textdesc = open(exportpath + 'description.txt', "w")
textdesc.write("Title: MAPNAME\n")
textdesc.write("Author: NOT AVAILABLE\n")
textdesc.write("THIS FILE WAS AUTOGENERATED\n")
textdesc.close()
textdata = open(exportpath + 'data.cs', "w")
textdata.write("package LoadMapPackage\n")
textdata.write("{\n")
textdata.write("\tfunction GameConnection::startLoad(%client)\n")
textdata.write("\t{\n")
textdata.write("\t\tif(!isObject(\"MapGroup\"))\n")
textdata.write("\t\t{\n")
textdata.write("\t\t\texec(\"" + blpath + "place.cs\");\n")
textdata.write("\t\t\tMissionCleanup.add(\"MapGroup\");\n")
textdata.write("\t\t}\n")
textdata.write("\t\tParent::startLoad(%client);\n")
textdata.write("\t}\n")
textdata.write("};\n")
textdata.write("activatepackage(LoadMapPackage);\n\n")
textplace = open(exportpath + 'place.cs', "w")
textplace.write("new SimGroup(MapGroup)\n")
textplace.write("{\n")
#export detail32
if bpy.data.groups.get("detail32") is not None:
objects = bpy.data.groups['detail32'].objects
for object in objects:
bpy.ops.object.select_all(action='DESELECT')
object.select = True
bpy.ops.object.duplicate(linked=False,mode='DUMMY')
dupe = bpy.context.selected_objects[0]
dupe.name = "DETTEMPSHAPE"
bpy.context.scene.objects.active = dupe
bpy.ops.transform.translate(value=dupe.location*-1)
bpy.ops.object.transform_apply(location=True,scale=True,rotation=True)
bpy.ops.export_scene.dts(filepath=exportpath + "shapes\\" + object.name + ".dts",select_object=True)
textdata.write("datablock staticShapeData(SS" + object.name.replace(".","DOT") + "Data)\n")
textdata.write("{\n")
textdata.write("\tshapefile = \"" + blpath + "shapes/" + object.name + ".dts\";\n")
textdata.write("};\n")
textplace.write("\tnew StaticShape(\"SS" + object.name.replace(".","DOT") + "\")\n")
textplace.write("\t{\n")
textplace.write("\t\tposition = \"" + "%.6f" % object.location[0] + " " + "%.6f" % object.location[1] + " " + "%.6f" % object.location[2] + "\";\n")
textplace.write("\t\trotation = \"1 0 0 0\";\n")
textplace.write("\t\tscale = \"1 1 1\";\n")
textplace.write("\t\tdataBlock = \"SS" + object.name.replace(".","DOT") + "Data\";\n")
textplace.write("\t\tcansetIFLS = \"0\";\n")
textplace.write("\t};\n")
bpy.ops.object.delete(use_global=False)
else:
print("detail32 group not found.  No visible meshes to export.")
#export collision-1
if bpy.data.groups.get("Collision-1") is not None:
#create NULL SHAPE for detail32 layer of collision objects.
bpy.ops.object.select_all(action='DESELECT')
scene = bpy.context.scene
me = bpy.data.meshes.new("NULLTEMPSHAPE")
me.vertices.add(1)
nullob = bpy.data.objects.new("NULLTEMPSHAPE", me)
nullob.location = (0,0,0)
nullob.select = True
scene.objects.link(nullob)
scene.objects.active = nullob
scene.update()
if bpy.data.groups.get("detail32") is not None:
bpy.ops.object.group_link(group='detail32')
else:
bpy.ops.object.group_add()
nullob.users_group[0].name = "detail32"
objects = bpy.data.groups['Collision-1'].objects
counter = 0;
for object in objects:
if object != nullob:
if counter == 0:
# First Time
if not 'ColGroup' in bpy.data.groups:
bpy.ops.group.create(name="ColGroup")
counter = counter + 1


#otherwise do the other stuff
bpy.ops.object.select_all(action='DESELECT')
object.select = True
bpy.ops.object.duplicate(linked=False,mode='DUMMY')
dupe = bpy.context.selected_objects[0]
dupe.name = "COLTEMPSHAPE"
bpy.context.scene.objects.active = dupe
bpy.ops.transform.translate(value=dupe.location*-1)
bpy.ops.transform.resize(value=(2,2,2))
bpy.ops.object.transform_apply(location=True,scale=True,rotation=True)
bpy.ops.object.group_link(group="ColGroup")

if counter > 60:
#export everything
bpy.ops.object.select_all(action='DESELECT')
exportObjects = bpy.data.groups['ColGroup'].objects
for exportObject in exportObjects:
exportObject.select = True
bpy.ops.export_scene.dts(filepath=exportpath + "shapes\\" + object.name + ".dts",select_object=True)
textdata.write("datablock staticShapeData(SS" + object.name.replace(".","DOT") + "Data)\n")
textdata.write("{\n")
textdata.write("\tshapefile = \"" + blpath + "shapes/" + object.name + ".dts\";\n")
textdata.write("};\n")
textplace.write("\tnew TSStatic(\"TSS" + object.name.replace(".","DOT") + "\")\n")
textplace.write("\t{\n")
textplace.write("\t\tposition = \"" + "%.6f" % object.location[0] + " " + "%.6f" % object.location[1] + " " + "%.6f" % object.location[2] + "\";\n")
textplace.write("\t\trotation = \"1 0 0 0\";\n")
textplace.write("\t\tscale = \"0.5 0.5 0.5\";\n")
textplace.write("\t\tshapename = \"" + blpath + "shapes/" + object.name + ".dts\";\n")
textplace.write("\t};\n")
counter = 0
bpy.ops.object.delete(use_global=False)

nullob.select = True
bpy.ops.object.delete(use_global=False)
else:
print("Collision-1 group not found. No collision meshes to export.")
#close script files
textdata.close()
textplace.write("};")
textplace.close()

dodtloveports('C:/Program Files (x86)/Steam/SteamApps/common/Blockland/Add-Ons/Map_TheSlopesv21/',"Add-Ons/Map_TheSlopesv21/")

63
Merge multiple dts files into one, each with it's own node name.
Then use static shapes and call the node functions on it.
For static shapes, won't this break collision?

Also, I don't NEED 8000 shapes, itd just be nice for smoother vehicle collision. Its for terrain maps. (more faces = bigger resolution overall, allowing the map to be less bumpy while still retaining changes in elevation.)

64
Its only 1kb per shape, approx 8mb total download

65
The problem is if i use datablocks, i reach the datablock limit because there are so many shapes- so I'm looking for an alternative way to require the download of dts files without hitting the db limit.

66
Well all the server to client loading is probably handled in the engine. i'm sure someone could write a DLL that could achieve what you want, but at the same time its probably going to take a while just to download multiple DTS files anyways
Thats ok! The other option is to create a client that people download, which would be faster than dling ingane anyway.

67
I may be wrong, but I think there can only be one instance of shape, shapename or shapefile in a tsstatic
Yeah only one per tsstatic. I want players to be able to download the shape files without it taking all the datablocks in the server.

68
Modification Help / Terrain Map Dev Thread [SUCCESS PAGE 2]
« on: May 02, 2017, 07:55:03 AM »
Is it possible?

Edit:
The entire purpose of this is so the players will download the DTS files.
The dts files in the server are referenced by TSStatic.

69
Thank you so much!

THE SLOPES:

Need to:
- increase the size
- add more faces for smoothness
- decrease DB size from 8100 somehow
- texture

Slopes Heightmap:

70
Games / Re: How many removed Steam games do you have
« on: April 24, 2017, 09:14:33 AM »
Shattered Horizon

71
Help / Re: Main Menu Freezing
« on: January 19, 2017, 04:03:57 PM »
Happens to me sometimes on steam. Restarting your comp can fix it.

72
Add-Ons / Re: Chat Emotes Restored v2
« on: December 06, 2016, 01:00:10 PM »
As far as compatibility, why not try packaging messageClient and look for instances of :emotes:?

edit: ohhh because it strips it of bitmaps

73
General Discussion / Re: What you should NOT post onto Blockland Forums.
« on: December 05, 2016, 12:06:33 AM »
If you quote this post, you won't win any money. This is not a joke.

74
Add-Ons / Re: Chat Emotes Restored
« on: December 04, 2016, 11:58:26 PM »
Hah, cool way to force-download textures. :iceCream:

Off topic:
Nexusmods huh? Would be interesting if its BL page got popular enough to show on the front page of the website.

75
General Discussion / Re: Blockland Glass Hosting Service
« on: December 04, 2016, 11:46:13 PM »
Seeing the reactions earlier, I have to give props to Scout, atleast someone is trying to get a proper replacement to RTB and RTB Hosting completely freely, but I feel like some of the comments bashes his head too much, yes issues happen but since we can be too harsh as a community when new contents are made some modders leaves and just gives up, I just hope it won't happen this time, anyway thanks Scout and your group for providing us Blockland Glass, I really appreciate the improvements being done recently and I can tell it can only get better with time
This so much. What you're doing for the community is amazing. I hope you don't burn yourself out.

Pages: 1 2 3 4 [5] 6 7 8 9 10 ... 127