Staredit Network > Forums > Null > Topic: python map editor (backend only :()
python map editor (backend only :()
Jan 7 2009, 3:57 am
By: cheeze  

Jan 7 2009, 3:57 am cheeze Post #1



So I found some old code for reading maps and decided to make it more usable. Basically, it's the backend of a map editor. The library has two functions: read and write. read, obviously, reads a map and then you can play around with the data in the map before using the write function.
Also included is a sample file using the library which can be used to create the frontend of a map editor.

Unfortunately, I don't know how to extract scenario.chk from a starcraft map so you'll have to manually do that. I think starcraft can play .chk files so writing out should still work but it can't have sounds and stuff. Of course, if anyone knows how to use python (strictly python) to extract and pack .chk, tell me. :D

No source code for public yet. ;) Although it's really simple if you know anything about reading and writing binary files.. so probably like three of you.

My ultimate goal is making a command line map editor. Because I'm more hardcore than you guys.

Attachments:
pyscums.tar.bz2
Hits: 3 Size: 28.08kb



None.

Jan 7 2009, 4:00 am O)FaRTy1billion[MM] Post #2

👻 👾 👽 💪

SC can only read SCX/SCM. ;o StarEdit can read chk.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Jan 7 2009, 5:52 pm scwizard Post #3



This is stupid, the program is:
from pyscumslib import *
map_data = read("scenario.chk")
write(map_data, "new_scenario.chk")

And you don't give us the source of pyscumslib.

This is completely useless.



None.

Jan 7 2009, 8:59 pm cheeze Post #4



Quote from O)FaRTy1billion[MM]
SC can only read SCX/SCM. ;o StarEdit can read chk.
Well aren't you a party pooper.
Quote from scwizard
This is stupid, the program is:
from pyscumslib import *
map_data = read("scenario.chk")
write(map_data, "new_scenario.chk")

And you don't give us the source of pyscumslib.

This is completely useless.
I should point out that I did you big favor. You wanted a community map editor and I gave you something that's easy to both read and write a starcraft map, separates the sections so they can be modified however you want, and written in python because it rocks as a language. PS. read the comments next time.

For convenience, here they are:
Code
##the data is stored in the data structure of a map. these are the keys:
##['TECx', 'UPRP', 'IOWN', 'COLR', 'IVE2', 'STR ', 'DIM ', 'VCOD', 'WAV ', 'MASK', 'PUNI', 'VER ', 'MBRF', 'OWNR', 'TILE', 'MTXM', 'PUPx', 'MRGN', 'SWNM', 'PTEx', 'FORC', 'TRIG', 'ISOM', 'UPGx', 'DD2 ', 'UNIT', 'UPUS', 'ERA ', 'THG2', 'SPRP', 'UNIx', 'TYPE', 'SIDE']
##each key (they are just strings) represents that particular section in the data
##to access it, use something like map_data["SIDE"]
##map_data["SIDE"] would return something like:
##['05', '05', '02', '01', '00', '02', '01', '00', '07', '07', '07', '04']
##refer to how scenario.chk is organized for what it means.
##example: in the above, 05 is "user selectable" so player 1 is set as "user selectable"
##player 2 is also set as "user selectable"
##if we wanted so player 2 was zerg, we change it like:
##map_data["SIDE] = ['05', '00', '02', '01', '00', '02', '01', '00', '07', '07', '07', '04']


Post has been edited 1 time(s), last time on Jan 9 2009, 12:09 am by Doodan. Reason: flame removed



None.

Jan 8 2009, 12:27 am Syphon Post #5



....Fucking Python.

*Shakes fist*



None.

Jan 9 2009, 6:22 am scwizard Post #6



Quote from cheeze
I should point out that I did you big favor. You wanted a community map editor and I gave you something that's easy to both read and write a starcraft map, separates the sections so they can be modified however you want, and written in python because it rocks as a language.
The problem is twofold:
1. The library the program depends completely on isn't open source, therefore the program isn't open source, therefore it doesn't qualify for inclusion in the project.
2. This "program" you've written isn't usable on it's own, therefore it doesn't qualify for inclusion in the project.

Now for a bit of irrelevancy. I'm not going to go into detail about my opinion of python, but lets just say that if I were to develop a program python would be low on my list of considerations for languages to use to develop that program.



None.

Jan 10 2009, 7:04 pm poiuy_qwert Post #7

PyMS and ProTRG developer

1) I haven't taken an in depth look but if you mean Python isn't open source then I'm fairly sure you're wrong. If you mean his library isn't open source he already stated he didn't release the source yet.
2) Actually you are wrong.

For your opinion, I'm guessing you are just ignorant, and depending on the program you would be writing, daft as well.

Keep it up cheeze, you should make the frontend now :P




Jan 12 2009, 12:33 am cheeze Post #8



Quote from scwizard
Quote from cheeze
I should point out that I did you big favor. You wanted a community map editor and I gave you something that's easy to both read and write a starcraft map, separates the sections so they can be modified however you want, and written in python because it rocks as a language.
The problem is twofold:
1. The library the program depends completely on isn't open source, therefore the program isn't open source, therefore it doesn't qualify for inclusion in the project.
2. This "program" you've written isn't usable on it's own, therefore it doesn't qualify for inclusion in the project.

Now for a bit of irrelevancy. I'm not going to go into detail about my opinion of python, but lets just say that if I were to develop a program python would be low on my list of considerations for languages to use to develop that program.
1. I could careless about your project; I was merely offering something I made in my spare time to this site. You can use it or not, I don't care. I will release the source code soon, once I add a few more features to my awesome command line editor.
2. Yes it is. Learn to program and learn how to use a library.


Quote from poiuy_qwert
1) I haven't taken an in depth look but if you mean Python isn't open source then I'm fairly sure you're wrong. If you mean his library isn't open source he already stated he didn't release the source yet.
2) Actually you are wrong.

For your opinion, I'm guessing you are just ignorant, and depending on the program you would be writing, daft as well.

Keep it up cheeze, you should make the frontend now :P
Yeah... well regarding the mpq portion, that thing is a bitch to write. Do you know anything about the mpq format? If so, I could use help. :P
Here is the format I'm following and I've only got the encryption part done. D;



None.

Jan 12 2009, 6:04 am poiuy_qwert Post #9

PyMS and ProTRG developer

I don't know much about the format, but someone (Heinermann i believe) gave me that link which is supposed to be good. You could also check out the SFmpq source. Good luck!




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
Please log in to shout.


Members Online: gilbertoecabrera