Lugaru Map Import / Export scripts for Blender

The place to discuss all things Lugaru.
User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by rudel_ic » Thu Aug 19, 2010 7:57 pm

I haven't got time to get around reworking the heightmap, sorry. When that's done, it'll be a release. Some other things are also improved in other scripts, but it'll be months, unfortunately.
Lotus Wolf wrote:Just an update on my testing (I got the patched scripts);
Here's some incomplete architecture I've been working on in my spare time. This may become part of a mod of mine, so this is for private use only (however, I encourage the placing of enemies on the map). It's a mix of hand-placed(Blender), editor-placed(Lugaru) objects, built with the foundation of the original 4th challenge. I put all the objects on the map before moving, resizing, rotating and duplicating them, in this way (I think), none of the placements were messed up. I love the scripts so far, very precise, great stuff.
-Lotus
Image

That an array? Sweet!

User avatar
ChosenOne
Posts: 46
Joined: Sat Jul 17, 2010 4:00 pm

Re: Lugaru Map Import / Export scripts for Blender

Post by ChosenOne » Fri Aug 20, 2010 12:44 am

Cool, Rudel. Sounds fine.

Hah, knarly pic!

cooldude
Posts: 40
Joined: Wed Jun 29, 2011 2:58 am

Re: Lugaru Map Import / Export scripts for Blender

Post by cooldude » Sat Jul 09, 2011 9:46 pm

I opened lugarumapping.blend then tried to import a map using the scripts and nothing happened, please help

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by rudel_ic » Sun Jul 10, 2011 9:08 am

The objects are probably not where you're looking! They usually end up being far away from the absolute center.
To align your viewport camera to your objects: After importing, press . (the dot) on your Numpad, and the viewport camera centers on the objects. Or you can press Home on your keyboard.
If you don't have a Numpad, then press Spacebar while your mouse is over the viewport and choose either "Align View > View Selected" or "Align View > View All".

Edit: It's one of those things I forgot to script, really. Thanks for bringing it up though, I'll put it into the ported importer for Blender 2.58 once I get around to that. :)

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by rudel_ic » Sun Feb 26, 2012 3:16 pm

I've just released version 1.1 of the Lugaru mapping tools for Blender 2.49. There is no 2.5x or 2.6x version, and there might never be one.

Get it here, as always: http://www.alice-dsl.net/wolf.mathwig/tools/py/

This update enables pixel-perfect placement of map elements. Sadly, I still haven't touched any other aspects of mapping besides placing map elements.

If you want to use these tools, please read the first post in this thread, and follow instructions in there. Most notably, the idea is to import a Lugaru map that already contains all elements you want to use.
Also, check the thread for hints. There are quite a few hidden in here.

Here's a tip for pixel-perfect placement: Try to restrict your map element movements on axes, and change the view accordingly. You'll have a hard time telling whether the object is aligned perfectly otherwise.
So in Object mode, when you want to move an element up and left, you first go into frontal view mode (NUM1), press G to move the thing, then press X, then move it to the left, then confirm. Then, you press G again, then press Z, then move it upwards, then confirm. Then, you rotate around edges or vertices with MMB to check whether you've aligned well. You zoom in as much as you can on crucial points to make sure it's as perfect as Blender can place it. This is tedious, but yields perfect results.

Note that although placement is now pixel-perfect, rotation restrictions still apply! This means that when you rotate a map element in Blender, you should always rotate around its local X and Z axis separately. Never rotate around its local Y axis.
Furthermore, rotations around the local X axis should always be in 1° increments; rotations around the local Z axis should always be in 30° increments. This is a Lugaru engine peculiarity you'll just have to keep in mind.

One more note: scaling is uniform per model. The export script reads scaling along the local X axis, and exports that as the uniform scaling factor. Obviously, it thus doesn't make much sense to scale an object along less than all axes if you're making a map in Blender.

You can of course always ask me stuff. Good luck and have fun!

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by rudel_ic » Mon Feb 27, 2012 4:42 pm

Image
wtf lol

Here's an example where you really need precise placement. The level is a mansion. You have two floors, there's a sort of stair from floor 1 to floor 2, and you can drop down from floor 2 to floor 1. There are a couple of windows. There are pillars balancing the house. And there's a big ramp leading into the mansion.

You'll see a bit of z-fighting where I didn't pay close attention, and that's not awesome. But the point is that things like repeated windows or arching ceilings aren't really possible with the Lugaru default editor.
And I know what I'm talking about. I've built two maze-like mansions before. It's hell.

The attached .zip has the .blend file and the map file inside. Drop the map file named "mansion" into Lugaru's Maps/ folder. Start Lugaru, open the console and type "map mansion", hit Enter.
Attachments
mansion_ex.zip
Honk if you like pancakes
(90.17 KiB) Downloaded 360 times

User avatar
tannim
Posts: 271
Joined: Tue Sep 30, 2008 5:54 pm
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by tannim » Mon Feb 27, 2012 5:12 pm

Does the script work with 2.62? I'd prefer not to have to have two versions of the same program installed.

Also, how hard is it to edit the script for newer versions?

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by rudel_ic » Mon Feb 27, 2012 5:53 pm

tannim wrote:Does the script work with 2.62? I'd prefer not to have to have two versions of the same program installed.

Also, how hard is it to edit the script for newer versions?
It doesn't work with 2.62. I have both 2.49 and 2.6something installed, so it's not really a big deal or anything. I get why you wouldn't want to have two versions installed though.

The Python API has fundamentally changed, so it's a lot of boilerplate work to get these scripts working in 2.62, but as soon as you've got buttons working and properties mapped, you're good; you can pretty much copy the rest, seeing as all there is to do is make file operations. Those haven't changed. Some things might work differently though (stuff like printing to STDOUT, for instance).
This goes for both the importer and the exporter.

One special thing these scripts do is they attach custom properties to Blender objects, I'm not sure how that works now, but I don't think it's a big deal to find out.

I'm currently not in the position to do this though, I shouldn't have touched this script again in the first place, not sure why I did, haha

So if you're knowledgeable enough to get this working in recent Blender versions, go!

Here are the docs you need:
2.49 API
2.62 API
Also, basic Python knowledge.
Try to find some one-button script that does file operations, and take it as a template. You'll save a lot of time. Blender ships with export scripts that are like that, for example. So check those out.

Or don't. There aren't a lot of people downloading these modding tools anyway, going by my web statistics. That's actually also why I don't bother with the porting anymore, very few people care at all. And those who do usually end up not finishing their projects. Modding in a nutshell, hah.

User avatar
tannim
Posts: 271
Joined: Tue Sep 30, 2008 5:54 pm
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by tannim » Mon Feb 27, 2012 10:22 pm

given the amount of work it is to actually plan one of these maps, I don't see myself doing another. I tried another cave maze a while back, but it was too frustrating. The first one was rather easy, surprisingly, but topping a first success is a pain.

I used up most of my ideas when I made the first mini campaign :}

It would be nice to have them working with a modern version of blender, but I don't know any python scripting and can only barely use blender.

Thanks for the efforts with Lugaru already, though. I'll leave it to anybody who takes it up.

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by rudel_ic » Mon Feb 27, 2012 11:05 pm

tannim wrote:given the amount of work it is to actually plan one of these maps, I don't see myself doing another. I tried another cave maze a while back, but it was too frustrating.
Yeah, enclosed places are really not easy to pull off with such a restrictive set of models. The facilities Blender provides help a bit though. Still, you have to plan things out well. Usually, it's no good if you just go at it on a whim.

I had this other idea to change Lugaru's code so that it switches to a set of models as specified in a level (directory-based to make it easy to understand); that would make it possible to design models and maps for each other on a case-by-case basis, so to say. (Would be relatively easy to do, too!)

Like, you want to build a house level, so you model all elements for that house level, and place them.
Then, you want to build a village level, so you model all village components.
And so on.

But again, noone would use it, so it'd be a waste of time unless I needed it, and I don't.

I'm pretty sure Lugaru is through at this point. I think it's about time for me to move on. Too bad that no animations or custom immobile / body models came of my tools, I think a lot of potential wasn't fulfilled, but it's been fun in any case.

I might look at doing weird shit with Overgrowth at some point. It's probably a lot more efficient, flexible and rewarding to do things with that. Although it feels like the furries are taking over when I look at the fan art thread. I dunno.

User avatar
tannim
Posts: 271
Joined: Tue Sep 30, 2008 5:54 pm
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by tannim » Tue Feb 28, 2012 5:42 am

Being a furry, I don't mind that at all <laughs at your discomfort> The anthropomorphic characters are the reason I'm here at all. Still, the gameplay in lugaru was a lot of fun too.

User avatar
rudel_ic
official Wolfire heckler
Posts: 2193
Joined: Sun Aug 28, 2005 11:19 pm
Location: Hamburg City
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by rudel_ic » Tue Feb 28, 2012 11:21 am

To each his own; it's not my style to judge people. It's just not my scene.

I like grand Science Fiction and introspective storytelling, but neither with a furry approach. I hope you can understand that.

Looking at what it would take to pull off a good mod, a common mindset amongst participants generally makes it easier to get somewhere. I can't do whole projects on my own.

User avatar
tannim
Posts: 271
Joined: Tue Sep 30, 2008 5:54 pm
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by tannim » Wed Feb 29, 2012 5:04 am

I understand :)

As to modding, it takes a group to make a real mod. One person does one thing, another does another. Having to do everything by yourself is far too much work.

Could be fun to get a group together here for one last campaign.

One or two peeps come up with a story
One guy draws a layout for the maps
several people actually make those drawings into maps
one uses the dialogue editor thing to actually put the story in
And somebody puts the maps together into the campaign file

Or something like that

User avatar
Count Roland
Posts: 2937
Joined: Tue Sep 25, 2007 11:15 pm
Location: Galapagos Islands, rodeoin some turtles.
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by Count Roland » Wed Feb 29, 2012 11:41 pm

it's funny because I think so far all the mods have mostly been made almost entirely by single people with a bit of community assistance, but it could be fun to do a group mod or two.

User avatar
tannim
Posts: 271
Joined: Tue Sep 30, 2008 5:54 pm
Contact:

Re: Lugaru Map Import / Export scripts for Blender

Post by tannim » Thu Mar 01, 2012 1:43 am

Almost isn't entirely ;}

Post Reply