Page 1 of 1

Custom Terrain Types?

Posted: Thu Sep 22, 2011 8:44 am
by Fimconte
Maybe I'm missing something very obvious here, but after adding a new Terrain type into terrain.pzdat and corresponding movement values into movement.pzdat, I still can't get the terrain to show up in the Editor.
Where else do I need to dot the i's to get my custom terrain in?

Posted: Thu Sep 22, 2011 10:13 am
by rezaf
Since the editor is a messy piece of hardcoded assumptions with no relations to the actual gamefiles, I highly doubt it's capable of recognizing new terrain types, sorry to tell.

It MIGHT work just adding a new tile for your terrain type to the png which holds the "hand drawn" terrain types that are shown when you place terrain in the editor, but I haven't tried - it works that way with flags, though.
_____
rezaf

Posted: Thu Sep 22, 2011 10:21 am
by HBalck
That's all hard coded !!! We can mod only the units and the png layers all main parameters the developers will save for later versions I think.

H.Balck

Posted: Thu Sep 22, 2011 1:28 pm
by Fimconte
rezaf wrote:Since the editor is a messy piece of hardcoded assumptions with no relations to the actual gamefiles, I highly doubt it's capable of recognizing new terrain types, sorry to tell.

It MIGHT work just adding a new tile for your terrain type to the png which holds the "hand drawn" terrain types that are shown when you place terrain in the editor, but I haven't tried - it works that way with flags, though.
_____
rezaf
I added the new tile to the .png, now the tile shows up in the editor but has no corresponding string attached to it.
Curiously enough while in a new blank scenario, placing the new tile results in a blank string (the image is placed), while on a existing map (Moscow 41 in this case) it assumes a existing one. In Moscow 41, placing the new tile shows up as Olenino, In France - as Amiens.
Both being the 18th String. Populating the list with other strings and the setting the 18th same as the one in the terrain.pzdat doesn't work either.

So it's probably hardcoded indeed. =/

Posted: Thu Sep 22, 2011 2:38 pm
by rezaf
Yeah, the string attached to your new terrain type is stored in the strings file, but the actual connection between terrain id and string is hardwired in both the scenario editor and game exe files - you can easily find the references using a Hex editor.

At least the text descriptions for a lot of things are actually stored in HTML or XML files/snippets, so they would be easy to modify, if only the developers hadn't then compiled those files INTO the exes and hardwired everything so nobody can make changes. It's very disappointing, really, and I hope this sees some developer love in the not-too-distant future.

Fimconte, have you verified if the actual terrain works?
If it's just the descriptions that are wrong, you can just replace all with custom strings. Yes, it's a bit laborous, but doable. I did exactly that for all Desert/Rough Desert tiles in my PG Classic mod.
_____
rezaf

Posted: Thu Sep 22, 2011 3:25 pm
by HBalck
Thats all right , but you can't give the new tiles new parameters for movement and diggin in - thats hartd coded I have tested in July 2011 and it doesnt run also with the new patches !

H.Balck

Posted: Thu Sep 22, 2011 6:26 pm
by Fimconte
rezaf wrote:Yeah, the string attached to your new terrain type is stored in the strings file, but the actual connection between terrain id and string is hardwired in both the scenario editor and game exe files - you can easily find the references using a Hex editor.

At least the text descriptions for a lot of things are actually stored in HTML or XML files/snippets, so they would be easy to modify, if only the developers hadn't then compiled those files INTO the exes and hardwired everything so nobody can make changes. It's very disappointing, really, and I hope this sees some developer love in the not-too-distant future.

Fimconte, have you verified if the actual terrain works?
If it's just the descriptions that are wrong, you can just replace all with custom strings. Yes, it's a bit laborous, but doable. I did exactly that for all Desert/Rough Desert tiles in my PG Classic mod.
_____
rezaf
No the terrain doesn't do what it's supposed to (allow air embark).

Re: Custom Terrain Types?

Posted: Thu Sep 22, 2011 10:20 pm
by wino
Fimconte wrote:Maybe I'm missing something very obvious here, but after adding a new Terrain type into terrain.pzdat and corresponding movement values into movement.pzdat, I still can't get the terrain to show up in the Editor.
Where else do I need to dot the i's to get my custom terrain in?
Did you try to add new hex picture in graphics/editor/terrain.png ?
Maybe it is needed ?

All the names are coded into pzscn files individually but they are then translated via pzloc and strings.pzdat files.

When you look into ScenarioEditor.exe it got reference to pzdat files, so I do not think that anything is hardcoded. Maybe editor Author can say anything about this ?

Re: Custom Terrain Types?

Posted: Fri Sep 23, 2011 5:33 am
by rezaf
Wino, did you even read what we discussed just above?

If you're already looking into the scenario editor exe, scan it for references to the terrain ID strings. Something TRN_FOREST (for example), stored in unicode.
As you'll discover, the terrain types ARE hardcoded in the editor, same goes for the game.

Sadly.

Just as you wrote, there's plenty of indication that they actually intended for this stuff to be moddable, but in the end they didn't.

Seems like the developer coding this portion of the game got a 0:8 prediction for pulling it off but then the RNG handed him a 2:3 result. :P

As for a word from the devs, sadly Rudankort got his forum-posting privileges cancelled some months ago. :(
_____
rezaf

Re: Custom Terrain Types?

Posted: Fri Sep 23, 2011 11:19 am
by Molve
rezaf wrote:As for a word from the devs, sadly Rudankort got his forum-posting privileges cancelled some months ago. :(
What does this mean?

Searching Rudankort's posts, you'll find his most recent post was made five days ago:
viewtopic.php?p=258903#258903

Posted: Fri Sep 23, 2011 11:29 am
by rezaf
Just semi-kidding around Molve.

Rudankort used to be pretty active on all PzC forums, even outside of Slitherine/Matrix. These days ... you might notice all even remotely recent posts of Rudankort are in the Beta forum...

I DO hope it's a good sign and he's busy patching up whatever they see fit to include in the patch(es) and otherwise hard at work on the first content expansion.
_____
rezaf

Posted: Sat Sep 24, 2011 9:40 pm
by wino
I am not sure what are you trying to achieve here. Each scenario got defined independent defined strings. The terrain types strings are just first N strings. When N is bigger then X (number of terrain types on scenario creation time) we got problem, right ?
So we can just re-numerate all non terrain types strings and all be fine again.
Or do it yourself by renamming first N-X and add their copy on the end of the string list, then change ID of those relocated strings on map.
BTW. Do you want me to write scenario file names re-numerating tool ? This should be quite easy (?)

Example of tool usage:
movenamestool scenario_name.pzscn 17 3

This will move all names having number 17 or bigger by 3 (17+3=20, 18+3=21, etc) and place 3 empty strings on positions 17,18,19 so new terrain types can have unique name (non existing in scenario name ID).

Posted: Tue Sep 27, 2011 10:00 am
by IainMcNeil
The only reason Alex has not posted to the forums is he is working hard and exhausted! He needs a holiday but is not scheduled to take it till October.

He posts when he can so not sure how this odd rumour got started!