[TOOL] PayDay's Map Editor


(Christoph Timmermann) #21

So true. :smile:

Okay, I just have to figure out a reasonable control for this…


As @radar3301 said: Totally!
But I don’t know if supporting dofilepath is a good idea, because every function has to be declared in the editor’s interpreter.
Would the scripts called by dofilepath from a level file be able to have other functions than the Level scope’s?

DetermChunk and NonDetermChunk are called by the editor after “doing” the level file, but I assume that you have these functions inside the script called by dofilepath, but dofilepath is not implemented, so it is unable to find them.


Ouch, that looks very intimidating. :disappointed_relieved:
I don’t think that I can do much, but I think that it is unable to find the icon or something, but wouldn’t that just raise an exception and let you continue or something?

I will look at the Mac compile when I have time. :slight_smile:
You know, school and stuff.


(Nathanius) #22

@radar3301 and @PayDay, if I provided you with the STC randomly generated map script, would you be able to incorporate that with the editor?

As it stands the randomly generated maps are not safe for multiplayer online, so I’ll need static maps, but as I said the randomly generated ones are much more interesting than any I could manually create… :confused:

It could also provide a good starting point for the community for 999999 different maps :wink:


(ajlsunrise) #23

I may have mis-spoke earlier with my “we” comment… I have no idea if PayDay wants/needs my help on this project, but I’m more than willing to assist! :stuck_out_tongue:

That said, I don’t think having the STC scripts would actually be necessary (though I wouldn’t mind taking a peek at them! :wink: ); just implement the dofilepath function and give it to the Lua state interpreter, and away you go.


(Christoph Timmermann) #24

It would be interesting to see, so upload it if you want to. :slight_smile:
EDIT: You already sent a PM.

I had trouble loading official Homeworld maps with for loops in them. I think it’s some kind of special loop from Homeworld?

Of course I do. :wink:
My free time for developing is getting very limited…
I now have 6 projects to work on (3 from school) and my timetable likes to keep me in school long into the afternoon.
Any help is appreciated, these tools are from us for us. :slight_smile:

EDIT: But I have to warn you, some parts are pretty ugly (especially the properties of the several object types).
I want to make it more object-oriented some time…


(ajlsunrise) #25

@Nathanius, @PayDay: The Lua developers changed the syntax of the Generic For loop from Lua 4.0.1 (HW2/RM) to Lua 5.x.x… NLua is based on the 5.x.x version syntax (with no backwards compatibility). :angry:


(Nathanius) #26

Damn… We’d have to rewrite it in LUA 5 then? To make a random map generator in the editor?


(Christoph Timmermann) #27

Hmm, that would destroy the use I had in mind.
I think that we will have to use another library for Lua stuff. NLua doesn’t support overloaded methods or variable argument counts either I think.

(I tried to implement random() for example, but you can use it with 0, 1 or 2 arguments, which was not possible for me to do.)


(Nathanius) #28

Can’t you use the library from the HWRM game itself? It’s just a dll right?


#29

For MissionDude I used “lua4.exe” to process and import level files.


#30

In my map collection, I have several dozen functions to create maps of various mathematical shapes.

You are welcome to use them in your own map tool.


(ajlsunrise) #31

I did it. Sort of…


(ajlsunrise) #32

Unfortunately, it’s not quite that simple… I may try to write a Lua 4.0.1 wrapper for the .NET Framework, but I wouldn’t hold your breath, lol.


#33

Why would you hold my breath?


(ajlsunrise) #34

#35

Yes, but why are you holding my breath?


(Christoph Timmermann) #36

That’s exactly what I was thinking, so why?


#37

I think there is an implied “If I were you, I …” going on here.


(Nathanius) #38

@PayDay

I don’t know if there is anything you can do about this (it certainly doesn’t make sense to me) but not all of the maps that your map generator creates are usable.

The only issue I’ve had is with the loadBackground("") bit, for some maps the game crashes on load if I don’t have this in the NonDetermChunk function twice. Yes, twice. In one instance I had to leave the random generator script in a static map so that it could randomly set a map before I overrode it in the *.level file (setting the background twice didn’t work there).

Yeah, it’s just weird >_<


(ajlsunrise) #39

Yes, exactly.

I wonder if it’s the background that has the issue, rather than the map?


(Christoph Timmermann) #40

Hmm… that’s very strange.
I can’t try to replicate it this evening, I’m going to look at it when I can.

Could be.