OpenXcom Forum

Modding => Work In Progress => Topic started by: SteamXCOM on June 10, 2017, 01:14:26 am

Title: (Solved)How does one create a working door and add it to a tileset?
Post by: SteamXCOM on June 10, 2017, 01:14:26 am
USING MAPVIEW
How does one  create a working  door and add it  to a tileset?
I want to make doubledoors that open close for one of the lightning mods I uploaded (for the tank to travel out)

Added the graphics in the PCK VIEW but they do not appear in the TILE VIEW
Also, how to assign the function of a door to the newly added graphic once it is visible?
Thanks
Title: Re: How does one create a working door and add it to a tileset?
Post by: Hobbes on June 10, 2017, 01:41:37 am
To add/remove/edit entries on the MCD files you need volutar's MCDEdit (https://www.ufopaedia.org/index.php/MCDEdit). It also comes included with a PCK editing tool, which is much better than PCKView (which I used for years before switching to MCDEdit). PCKView can only be used to add/remove/edit the images on .PCK files, to change how the images are used you'll need to edit the MCD files.

To set entries to act as doors, you'll need to set either byte 30 (for 'sliding' type doors) or byte 35 (for traditional doors). For both you'll also need to define using byte 46 the number of the MCD entry that will be used when the door has been opened. For 'sliding' doors you'll also need to assign the different PCK images to the 8 possible animation sequences (see attached image below)

Title: Re: How does one create a working door and add it to a tileset?
Post by: Wolfstarr on June 10, 2017, 01:43:27 am
Hi SteamXCOM,

There used to be some videos on youtube by one of the modders on here on youtube but I can't find it now, not sure if they were taken down :( I do have them on my machine somewhere and I'll post when I find time as this is something I want to get into to.

There is some further information here that might help: http://openxcommods.weebly.com/general-map-creation.html

Nice work on the lightning btw!
Title: Re: How does one create a working door and add it to a tileset?
Post by: SteamXCOM on June 10, 2017, 05:13:39 am
To add/remove/edit entries on the MCD files you need volutar's MCDEdit (https://www.ufopaedia.org/index.php/MCDEdit). It also comes included with a PCK editing tool, which is much better than PCKView (which I used for years before switching to MCDEdit). PCKView can only be used to add/remove/edit the images on .PCK files, to change how the images are used you'll need to edit the MCD files.

To set entries to act as doors, you'll need to set either byte 30 (for 'sliding' type doors) or byte 35 (for traditional doors). For both you'll also need to define using byte 46 the number of the MCD entry that will be used when the door has been opened. For 'sliding' doors you'll also need to assign the different PCK images to the 8 possible animation sequences (see attached image below)

THANK YOU
I at last obtained the correct version of MCEDIT and opened the MCD data file and added the settings(yes not to be confused with the DOS version still in abundance).
https://www.ufopaedia.org/index.php?title=MCDEdit
Now the graphic appears where I can add it in MAPVIEW.
However, while it seems animated in the MCDEDIT, when I add the door to the craft it does not animate, though it allows passage otherwise.

The settings are copied from the door that already exits for the LIGHTNING.

This byte 46, it was marked as 0 for the default door...


Title: Re: How does one create a working door and add it to a tileset?
Post by: SteamXCOM on June 10, 2017, 08:05:19 am
Hi SteamXCOM,

There used to be some videos on youtube by one of the modders on here on youtube but I can't find it now, not sure if they were taken down :( I do have them on my machine somewhere and I'll post when I find time as this is something I want to get into to.

There is some further information here that might help: http://openxcommods.weebly.com/general-map-creation.html

Nice work on the lightning btw!

Thank you for that link.  I think I shall restart the map and re-import the graphics  in MCD edit as before I simply opened up an existing MCD file.
There is no "clean" way to switch files and have a  tile set with new stuff work into an already existing map?  I gather one must have the map open and bring additional items in.

Yes, only wanted small changes on the Lightning, do not think it needs a whole lot,  thanks for the input!

--- posts merged - Solarius Scorch ---

Here is what I got when I loaded the tileset on a LIGHTNING map without doing anything else to the map yet.
This was with MCDedit with added PNGs for the additional doors.

 As seen the new tileset dropped the doors on the map  and created  holes in the floor of the craft and there is no transparency on the added doors.

MAPEDIT did the same thing EXACTLY when I imported a tileset that I started to make with it then finished in MCDedit to create the animation from MAPview  except there was transparency on the doors with the imported BMPs (both files were resaved in PHOTOSHOP).

I think I can fix transparency (MAPview exporting / importing BMPs have no issue with transparency),

however, How can I import items into an existing tileset and not monkey up the map?
Thanks

Title: Re: How does one create a working door and add it to a tileset?
Post by: Wolfstarr on June 10, 2017, 12:53:24 pm
So I found the video and uploaded it to my Dropbox, it was by bombbloke originally not sure how active he is on here but if he wants me to take it down I will.

https://www.dropbox.com/sh/rjdg8vj5m5h0y8l/AADU1TVWuTsOO-jmUf2bS_Hza?dl=0

Should help you :)
Title: Re: How does one create a working door and add it to a tileset?
Post by: SteamXCOM on June 10, 2017, 09:01:58 pm
So I found the video and uploaded it to my Dropbox, it was by bombbloke originally not sure how active he is on here but if he wants me to take it down I will.

https://www.dropbox.com/sh/rjdg8vj5m5h0y8l/AADU1TVWuTsOO-jmUf2bS_Hza?dl=0

Should help you :)

yes thank you!

--- posts merged ---

Right now I'm guessing its like this,

--One cannot add a new tile an existing map, it throws off the sequence of the already existing tiles (unless there is some trick to it).
--A new map has to be created to work with the altered tileset
--One CAN edit an exisiting tile by importing new BMPs or PNGs whatever (watch the transparency).

In the case of the LIGHTNING for a double door, for the proper illusion, two tiles have to  be sacrificed
one of which is the single passage door.

However since no other tile is avaiable, the door has to be altered (if left alone and  animated there is a post in the middle where the two doors meet making it odd that the tank can drive through it.

Have the double door to the stair not animate (as now ) but passible.

Edit the door tile to see if the "post" can be made to disappear

Recreate the LIGHTNING on a new map or delete all on an existing map and recreate?  Which seems best to keep things spawnable?


 
Title: Re: How does one create a working door and add it to a tileset?
Post by: Hobbes on June 11, 2017, 03:03:50 am
--One cannot add a new tile an existing map, it throws off the sequence of the already existing tiles (unless there is some trick to it).

For modifying existing maps, create a new tileset with the extra tiles you created and add the tileset (MCD + PCK + TAB files) to the bottom of the list of tilesets already assigned to the map. Keep in mind that there's a 255 tile limit that can be displayed/edit in MapView because of size limitations of the MAP files

Title: Re: How does one create a working door and add it to a tileset?
Post by: SteamXCOM on June 11, 2017, 07:54:05 pm
For modifying existing maps, create a new tileset with the extra tiles you created and add the tileset (MCD + PCK + TAB files) to the bottom of the list of tilesets already assigned to the map. Keep in mind that there's a 255 tile limit that can be displayed/edit in MapView because of size limitations of the MAP files

THIS seems promising.

As an experiment I duplicated LIGHTNIN MCD + PCK + TAB files and added LIGHTNIN01 MCD + PCK + TAB files in the terrain folder.

In MapView there appears to be image files there
However the duplcated LIGHTNIN01 is not there
How to assign new tiles  to a map?

Thanks

Title: Re: How does one create a working door and add it to a tileset?
Post by: Hobbes on June 11, 2017, 08:50:03 pm
In MapView there appears to be image files there
However the duplcated LIGHTNIN01 is not there
How to assign new tiles  to a map?

Thanks

It's supposed to be through the Image Files tab on the pic you posted but that never worked very well unless it has been fixed. So you'll have to add the new tilesets manually to MapView.

1.Just open the /settings folder of MapView and then open the Images.dat file with Notepad or Notepad++
2. Add the name of the tileset on the same format as the existing ones the list and save Images.dat
3. Copy the necessary files to the /TERRAIN folder
4. Restart MapView and the new tileset will be available to assigned to maps

Btw I wrote the attached guide on how to make maps for UFO2000 a long time ago. Some of it doesn't apply to OpenXCom but you might find it useful since it answers many of the questions you posted on this thread
Title: Re: How does one create a working door and add it to a tileset?
Post by: SteamXCOM on June 11, 2017, 11:03:25 pm
YES that images.dat edit worked into getting the tileset into MAPVIEW,

THANKS


(EDITING the data file found in it setting folder)
images.dat
LIGHTNIN:${var1}
LIGHTNIN01:${var1}  <<<< added line

mapedit.dat  (no editing, it updated on its own)
files:XCom
      PLANE:plane
      AVENGER:AVENGER
      LIGHTNIN:LIGHTNIN LIGHTNIN01
      
   And your guide helped me to realize in order to get the tile into the game, another edit had to be made, and sure enough crafts.rul needed to be tackled:   
      
      craft.rul edit required
            mapDataSets:
        - BLANKS
        - LIGHTNIN
        - LIGHTNIN01  <<<<<<< added line
      
      
Just black squares otherwise!
      
Thanks again Hobbes!!!
Title: Re: How does one create a working door and add it to a tileset?
Post by: Hobbes on June 11, 2017, 11:09:27 pm
mapedit.dat  (no editing, it updated on its own)

Mapedit.dat contains the definitions for all .MAP files loaded into MapView, so it will automatically change every time you add a new map or change the tilesets order. Y

ou can also manually edit it instead of using MapView's GUI, which is handy when you are adding a terrain that contains a lot of individual maps. You should make a backup copy first though because it is easy to mess up the list and you'll have to start again using MapView with only the vanilla maps loaded.
Title: Re: How does one create a working door and add it to a tileset?
Post by: SteamXCOM on June 12, 2017, 11:50:46 pm
A couple of other questions
What is the best way for workflow?

It seems that MAPview is best used setup for paths to the default game UFO folder. 
Once done I copy the terrain, map and route file the the appropriate mod folder
(geeze is there a batch file I can use that does this automatically?)
Then update the RUL file.
Then play the game (quick battle gets the craft into the game to see its changes)

I'd rather do it all in the game folders then copy into the mod at the end (unless a batch file  I can somehow create) but the issue is I cannot find the .rul files ;
there is a "standard" and "data" folder but when I changed the .rul from either one it does not reflect in the game.


MAPVIEW seems to have issues with these files

UFO000 UFO01a  UFO010
The walls look all scrambled even the scout with a pile of walls from the other UFOs,
Is there a fix somewhere to those maps?


thanks
Title: Re: How does one create a working door and add it to a tileset?
Post by: Wolfstarr on June 13, 2017, 01:34:48 am
Hi Steam,

Thanks for documenting your progress :) Getting into map editing does seem more daunting than sprite editing!

Have you installed the universal patch and looked at the map bits that fix certain components of the ufo map tiles?

http://www.openxcom.com/mod/darkened-ufo-vanilla-variants

https://openxcom.org/download/extras/universal-patch.zip

May be of use :)
Title: Re: How does one create a working door and add it to a tileset?
Post by: Hobbes on June 13, 2017, 01:41:15 am
A couple of other questions
What is the best way for workflow?

It seems that MAPview is best used setup for paths to the default game UFO folder. 
Once done I copy the terrain, map and route file the the appropriate mod folder
(geeze is there a batch file I can use that does this automatically?)
Then update the RUL file.
Then play the game (quick battle gets the craft into the game to see its changes)

I'd rather do it all in the game folders then copy into the mod at the end (unless a batch file  I can somehow create) but the issue is I cannot find the .rul files ;
there is a "standard" and "data" folder but when I changed the .rul from either one it does not reflect in the game.

For UFO Defense the .rul files are located in the OXC installation folder, on \openxcom\standard\xcom1. There's no /data folder in the nightlies (which I assume you are using?)

For me, I've always used 3 separate folders:
* One for MapView (contains the full original game)
* One for MCDEdit (contains only the terrain files)
* The OpenXCom mod folder

The terrain files first created/modified in MCDEdit, then copied to MapView to use in new/existing maps, then the terrain files and maps are copied to the mod folder for final testing. One of the reasons why I prefer this setup is that if you decide to revert back work while working on MCDEdit/MapView, you can simply go back to the mod folder and copy back the old files.

Quote
MAPVIEW seems to have issues with these files

UFO000 UFO01a  UFO010
The walls look all scrambled even the scout with a pile of walls from the other UFOs,
Is there a fix somewhere to those maps?

UFO000 and UFO010 are incomplete maps that can included with the original game - no one knows which tiles they were supposed to use, so the MapView developer assigned them the UFO ones. You can have an idea of how they *might* look on this page: https://www.ufopaedia.org/index.php/Talk:MAPS

UFO01a is the Small Scout but for some reason MapView doesn't display it correctly
Title: SOLVED How does one create a working door and add it to a tileset?
Post by: SteamXCOM on July 10, 2017, 09:34:41 pm
SOLVED

After some more fiddling I finally got custom door sets to work
updating Hobbes instructions.

To add/remove/edit entries on the MCD files you need
--volutar's MCDEdit (https://www.ufopaedia.org/index.php/MCDEdit). It also comes included with a PCK editing tool,
PCKView can only be used to add/remove/edit the images on .PCK files,
To change the attributes of how the images are used you'll need to edit the MCD files.

Since MCD Edit controls the behavior of doors, it is useful to study another file such as XBASE1 for sliding doors  and BARN for traditional doors.

Sliding doors
=UFO door:30 1 (original 0)

Traditional door
=Door:35 1 (original 0)

Alt_MCD:46   Set this to swap the door graphics (IMPORTANT)
I.E. set up the door graphics in Edit PCKs and in their MCD animation. 
Follow an example MCD to set it up(you can copy and past from another MCD to get the LOFTs and other settings.
When done in MCD there should be TWO MCD frames for the door.
(not to be confused with the large frame below which PCKs are assigned to create the
MCD frame)
Once the MCD frames  are created; say 39 and 40,
for MCD 39 the Alt_MCD:46 is 40.
For MCD 40 the Alt_MCD:46 is 39.

For a sliding door typically MCD 39 would consist of 4 to 8 PCK frames
In 4  frames such as the LIGHTNIN door the last 4 pck frames repeat.
For  MCD 40 one of the above PCK frames is used (probably the last opened door frame)

Tile_type:53 should be set to either west wall 1  or north wall 2 depending upon orientation.

If doors fail to open, in my instance, I did not quite understand how Alt_MCD:46 worked.

Once that was learned, then the doors opened.

FYI check Die_MCD:44
If 0 the standard game graphic will be used, if your door is destroyed, if some other number corresponding to an MCD then that tile will appear.  If your attributes were copied from another MCD,  this may display an entirely unsuitable tile if your door  is destroyed.


-----------------------

edit


Hi Steam,

Thanks for documenting your progress :) Getting into map editing does seem more daunting than sprite editing!

Have you installed the universal patch and looked at the map bits that fix certain components of the ufo map tiles?

http://www.openxcom.com/mod/darkened-ufo-vanilla-variants

https://openxcom.org/download/extras/universal-patch.zip

May be of use :)

BTW thanks for these, yes the patch actually downloads on the nightlies, the LIGHNIN was of particular interest since they updated a few things to cover the holes in it from its first release in the 90's.
Title: Re: (Solved)How does one create a working door and add it to a tileset?
Post by: The Reaver of Darkness on July 13, 2017, 08:51:58 pm
I see you got it working but I wanted to offer my short explanation: The easiest way to make a door work correctly is to copy a working door and change the image. But you can also look at working doors to figure out how they work. MCDEdit has notes by the numbers which help you make sense of them. The most important bits are that it is a wall tile and has the door setting on it. You can set it as a wall tile type in MCDEdit but that only sorts it in MapView. You must actually place it as a wall for it to function as a door.



I made a double door for the Lightning a while back, and I got the graphic fixed so it has just one X-Com decal in the center and it opens smoothly. Then I duplicated it in the opposite direction, and added the Avenger doors with tweaks to make them fit the Lightning, also going both ways. I tweaked the shading to fit the different directions. I'm about to make a few changes to the doors: I'm going to fix some alignment issues as well as better define them so they look more like doors than walls. I might also try to swap the south door onto the other wall tile--it currently has that awkward slot on it.

In addition to the doors, I have added several other things:


I'm making somewhat of a collection of items for the Lightning tileset which I have dubbed LIGHTNIA, and I'll share it here after I make those door fixes. My goal is to make a tileset that gives players the freedom to make custom craft maps of varying design. Hopefully I can add more interior doodads as well as any other things it needs. And I'm going to try and see if I can make the walls act more like walls instead of big blocks. I hope you'll like my tileset, it might save you time in the future and allow you to focus on making maps.

edit: Here's the tileset plus an image:
(http://i.imgur.com/vxkRVbj.png)
Title: Re: (Solved)How does one create a working door and add it to a tileset?
Post by: SteamXCOM on July 14, 2017, 03:16:25 am
THANKS for this!!!