Page 1 of 3 123 LastLast
Results 1 to 20 of 51

Thread: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

  1. #1
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Hey,

    i started this tutorial long ago, but due other time consuming activities and the complexness of the topic it only progressed slowly. So i decided to post it piece by piece.

    Introductive Words


    Everyone of us knows those little wood fences and stonewalls of the campaign battle maps. Long time we weren't able to use those on custom battle maps, which i want to change, since i can see some good uses of them.
    My workflow and Scripts i share with you, are heavily based on 3ds Max and i'm aware that not everyone has acess to it, since it's quite expensive. However you can use any tool which allows the usage of Splines/ Lines/Curves but be aware that i can't help you then and you have to create your own scripts.

    Content

    I Programms and Tools you'll need
    II Preparations

    1) Farm_Manager

    2) 3ds Max Basic Setup

    a) Implementing the scripts

    b) Creating the Map layout

    III Placing a fence in 3ds Max

    IV Exporting a fence from 3ds Max

    V Implementing it in in the Farm Templates and Field Manager

    VI Credits


    Programs and tools you'll need


    • Notepad++ and/or XML Notepad
    • Husserls and Taw's ESF Total Editor
    • 3ds Max (You can use any other software which supports spline modelling, but be aware that this means that you'll have to write a) your own tools to get the coordinates or b) copy everything by hand... and believe me, you don't want to this ^^)
    • Primergy's poorly written Scripts and the Example-farm_manager and Farm Template Tiles (included in the attached zip)

    Preperations - Farm Manager

    Ok first some introductive words to the files you'll have to edit.
    One of them is the Farm_manager file which can be found in the map folder. It's used to load the farm_template_tile file and also defines, which walls are showing up, aswell which models are used. During the Process you will use my example_farm_manager, convert it to an esf and then replace the one in your map with the newly created one.
    You'll have to use my example_farm_manager.xml or you can extract it yourself with Husserls Tool from the map Algeria or Star_fort (which are the only ones which are using walls). But well... it's easier to use mine .
    Extract the folder from the Zip and place it in in the XML Folder of Husserls Total ESF Editor.
    Open it with XML Notepad and take a look on the areas i marked in the following image.
    Attachment 184052

    1. Is the Size of the Map which get's covered by the template_tile. Leave this field as it is.
    2. Here you can see several paths, where only few are important. The first path loads the Farm_template_tile from the path you specifed. The one which are made unreadable are unimportant since those textures don't show up anyway. The other entrys are only then important i you are using new fence which got referenced in the warscape_rigid_lod table . If you replaced the vanilla wood fence and hedge, you can leave this alone.
    3. With those entrys you could move the farm_template on your map around, but with the entries given by me, it will be placed in the middle (which is what you want, i assume)

    After those entrys there a lot of farm_ and wall_instances where i don't really now what they are doing. The coordinates there are unimportant (no visible effect) but deleting will cause the game to crash.
    Important are the dozens entrys wallxyz entries. Or better, those are important in NTW, so that wall you created shows up.
    It seams that in ETW you only have to reference the walls in a field (later explained) and not in the farm_manager. I assume the code for the "wall instances" is broken in ETW.

    Preperations - Install the Scripts for 3ds Max


    1. Download the Zip file and extract it.
    2. You will find folders named XML and Scripts. Copy the Content of the scripts folder and paste it to your 3ds Max Script folder (yourpath/3dsmax [Version]/Scripts).
    3. Start 3ds Max, open the Customize UI -> Toolbars and create a new one.
    4. Look in the scroll menue on the left for my Tools under Primergy's Warscape Map Tools and drag and drop all four of them to your new Toolbar.
    5. Save the new UI.

    Attachment 184053Attachment 184054

    What are the Scripts doing?


    • File Stream - Creates the information needed to export the spline
    • Export Spline - Exports the Spline to your Macroscripts Folder
    • Stonewall - Subdivides a spline with two knots (which is the format stonewalls do need)
    • Woodfence - Subdivides a spline by (length/2) = number of knots.

    Units Setup

    Choose the "Generic Units" not metric ones, or yards.

    Create the "Map"

    Now you have to create the "Map" you will need as reference. Create a plane the same way you can see in the attached image. The Maps in NTW/ETW are max. 2048*2048 Units large, so lets use this value, so the coordinates will be right.

    Attachment 184383

    After that you can go to the Material Editor, load the colourmap, layout map, whatever so you know where the fences will be placed and assign it to the plane.



    First Part done, more will follow
    Last edited by Primergy; October 08, 2011 at 04:29 AM.

  2. #2
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Create a Spline, work with the scripts, export the coordinates

    Ok, now it gets a bit more interesting, we will create a spline and export it .

    But first a short outline, what we are doing:

    You already created the Map Layout, and now you are placing Splines (Lines, Curves etc) there. After that you have to decide if the wall should be a Wood Fence, or a Stonewall.
    To make your spline to wood fence (technicaly) you'll press the woodfence button on your toolbar, which will subdivde the spline with a lot of knots. Those knots represent the places where a fence segment will be placed in the game.
    After that you run the Filestream and export the coordinates to a xml.

    -----


    To create a Spline, press choose line and then left click somewhere on your map. Move a bit forward (where you want your fence to end) left cklick again. To end the line placement right click.
    Attachment 184563

    Keep the spline selected and press the "Wood Fence" Button on your toolbar to make a Wood Fence. It should look like this:

    Attachment 184564

    Ok now it will get "tricky" since the scripts for the export don't work as Macroscript :/. So you have to run it the old way.
    To create the Information, go to Maxscript, run Script, go to your 3ds Max Script folder and then choose the Primergy Filestream Script File.

    To export the Filestream you have to go Maxscript and open up the Maxscript Recorder Window (F11 in my Version). As command you have to type in the white area:

    ExportAsXML ("name.xml")

    and press Enter.

    Attachment 184565

    Now your XML with the Spline Coordinates got created in your 3ds Max/Script Folder. You can open it with Notepad++ and take a look on them (and maybe also guess what you have to do in the next steps, which will follow later)
    Last edited by Primergy; October 07, 2011 at 12:44 PM.

  3. #3
    B-DizL's Avatar TGW Lead Modeller
    Patrician

    Join Date
    May 2009
    Location
    America
    Posts
    5,900

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Nice start + rep

  4. #4

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Thank you for the Tutorial



    here is my first Rep point for you ;
    Last edited by nowerman; October 06, 2011 at 03:55 PM.

  5. #5
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Lol nice to see that people already get things finished, which i didn't even mentioned
    Last edited by Primergy; October 06, 2011 at 04:23 PM.

  6. #6

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    I couldn't run your script yet but I am ready to work on the next step when you have the time ;

    A big thanks for your Time and Skills



    Last edited by GrnEyedDvl; May 17, 2012 at 04:20 PM.

  7. #7
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Ok that already looks very good . But sadly i have to announce that the export scripts doesn't seam to work as Macroscripts. So you have to run them the way i mentioned in my second part of the Tutorial, which now covers the steps "creating a spline" and export it.
    But not how to work with the farm_tile_template (yet).

  8. #8

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Ooops !!!! I got stuck here ;



    Sorry I can't get further

    Could you please indicate the handwritting option upon the farm.farm_manager ?
    Last edited by GrnEyedDvl; May 17, 2012 at 04:20 PM.

  9. #9
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Simple Solution.... only select the spline you created not the underlaying plane .

  10. #10

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    I got one step further OK !!!

    now problem about saving the xml file F11 ( works for me also) ;
    Were am I wrong ?

    Last edited by GrnEyedDvl; May 17, 2012 at 04:20 PM.

  11. #11
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    You have to run the Filestream script first. Also here the macroscript doesn't work reliable. So go maxscript/run script/ and run the primergy filestream script by hand. After that you can type in the exportasxml stuff .

  12. #12

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Sorry ; too bad I couldn't make it work
    (I can't manage to have the script running I guess ; and I keep having the same error message)

    my only hope would be if you show the empiric way of placing the fences and walls directly inside the file ; writing each knots by hand. ( I know it is very long ....) , but I can't see the coordinates knots in the farm.farm_manager ;
    Could you please show where the coordinates are in the file ?

  13. #13
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Sorry ; too bad I couldn't make it work
    (I can't manage to have the script running I guess ; and I keep having the same error message)
    Ok, i uploaded a new zip, where i deleted the old scripts instead you now find a "splinetoxml script" there. Copy and paste this one to the 3ds max Script folder and run this instead.

    Select spline -> go to Maxscript/Run Script/ choose "Splinetoxml" -> after that open the command window (F11) and write exportasxml ("name.xml")

    Coordinates have to be inserted in the farm_tile_template. To get them by hand, you have to select a knot, choose the "move tool" and press F12, then you get the coordinates from where you can copy and paste them.

  14. #14

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    GREAT one step further ..... Script working !

    Last edited by GrnEyedDvl; May 17, 2012 at 04:21 PM.

  15. #15

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    I made some small progress with a new working Maxscript ; I hope




    I though maybe you could try this one ; and see if you could adapt the XML file format created to the game farm.farm_manager
    Last edited by GrnEyedDvl; May 17, 2012 at 04:21 PM.

  16. #16
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    I though maybe you could try this one ; and see if you could adapt the XML file format created to the game farm.farm_manager
    The script gives you a lot of unneeded information, eg. the in and out vector aswell as the z value. Besides that it has the wrong format for the wood fence. And i should add that the coordinates of the fences, aren't in the farm_manager. This one is only used to determine, which farm_template is loaded and which fences show up.
    The Farm_template_tile is the important one .

    I will show you a "preview" of the final parts of the tutorial... in the small window you can see the coordinates for a wood fence and propably you understand why i'm using this "special" format in my script.
    So you can simply select the lines and copy and paste them into the "wood fence coordinates" v2_array.

    Attachment 184787

  17. #17

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    Ok ; I follow you Sir ( this is the file included in your archive)



    and the coordinates created in 3dsMax with the Script



    goes there ; righ ?

    So what I understand is that 2 files are necessary inside One mod to get the walls inside a custom map

    1) farm.farm_manager
    2) XXXX_farm_template_tile -> the wall coordinates
    Last edited by nowerman; October 09, 2011 at 11:18 AM.

  18. #18
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    goes there ; righ ?

    So what I understand is that 2 files are necessary inside One mod to get the walls inside a custom map

    1) farm.farm_manager
    2) XXXX_farm_template_tile -> the wall coordinates
    Exactly, but don't copy the unnecessary other stuff from the script file

  19. #19

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    I'm lost
    Do we need to create those folders with those xml references in it to create the custom farm_template_tile ?



    Last edited by nowerman; October 15, 2011 at 04:56 PM.

  20. #20
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: How to add Stonewall/Fences to Custom and Campaign Battle Maps First Part

    The esf2xml creates those folders and those are needed when you convert the xmls to esf again. Important are the walls xmls, of course.
    But you can edit the "Split file" so everything stays in one xml, if you like this better.

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •