Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 02/19/2024 in all areas

  1. Import Placeables This script is for those people who want to modify/edit existing maps and want to load all the placeables in taht map in one hit. However any modification/deleting of any of the loaded placeables will still require manual changes to the placeables.xml. The script will import all the placeables listed in the placeables.xml into the map at the location set in the xml and with any User Attributes that are assigned to each placeable. Script will only import placeables from i3ds so any placeables.xml script that does not have an i3dPath in its base.filename will not be loaded and an error message with the problem xml's filePath will be printed in the console log, error message will also be printed if the mod directory doesn't have a mod associated with that map. Any file not loaded automatically will have to be manually added to the placeholders TG. Limitations: Where fences/hedges/power lines have been created using the in game construction tool and then copy pasted into the placeables.xml from a save game these will not appear in their assigned position as any editing/deletion must be carried out in game and the placeables.xml manually adjusted from a new save game. Installation and Use To use the script unzip the Import Placeables.zip (available at the end of this tutorial) and copy/paste the folder to the location of your GIANTS Editor 64bit 9.0.6/scripts folder in this case it is, C:/Users/*****/AppData/Local/GIANTS Editor 64bit 9.0.6/scripts (replacing the *** with your computer name) Open GE and open the Script Editor , Window -- Script Editor and select Import Placables Check and amend the following lines as necessary : - Line 50 local gInst = "C:/Program Files (x86)/Farming Simulator 2022/" --change to your Farming Simulator 2022 Installation Path if different. Line 52 local pathModDir = "C:/Users/ccrjs/Documents/My Games/FarmingSimulator2022/mods/" --change to your mod directory path if different. Line 54 local placePath ={"placeables.xml","xml/placeables.xml","xmls/placeables.xml","maps/mapUS/placeables.xml"} The 'placePath' array contains the various paths that the placeables xml can normally be found, if your placeables are in a different place/folder then add the path to the list. When done save the script, the Script Editor can now be closed. In GE create a new transform group and name it 'placeholders' with the new placeholders transform group selected, in the User Attributes Panel of GE add a new attribute Type 'script callback' with the name 'onCreate' select Add and in the new onCreate box type 'Placeholders.onCreate' (correct Font and spelling required). This will allow the placables to be seen in GE, the new placeholders TG will be ignored when the map is opened in game and the placeables will be loaded as normal from the placeables.xml. Select -- Scripts --Import Placeables A pop up panel will appear with a button marked Import Placeables Image below shows the Scenegraph and User Attributes entries together with the pop up panel With the placeholders Transform Group selected, select the Import Placeables button. All the placeables listed in maps placeables.xml will be loaded into the map together with any User Attributes assigned and a print out of the file path to each one loaded will appear in the GE Console log. The name of each individual placeable in the Scenegraph will be its xml/i3d name not its placeable folder name. The script will continue running until all placeables listed (including error messages) in the placeables.xml have been loaded An example of the console log print out showing normal and error path print outs is shown below, I have tested the script on several maps inc FS22_Maypole_Farm FS22_BucksCounty FS22_FrontierMap FS22_Calmsden FS22_Monette_Farms however there maybe other maps on which the script may/may nort work as expected but I'm sure you will tell me about them. Import Placeables.zip
    1 point