1
Features & Articles / 9. Adding or modifying graphical assets.
« Last post by Slowhand on September 18, 2023, 07:48:41 am »9. Adding or modifying graphical assets.
Client side:
Server side:
Testing it:
CHEAT SHEET:

Client side:
- Creating a custom animation frame file (.fofrm), for the item to show on map:
- Navigate to ..\Client\data\base.zip\art\items\ folder, and look up the structure of a fofrm file.
- Create the fofrm file as described below, but to a temporary location of your choosing, copy the image to it as described later.
- fps=10 what fps will the animation of the item run, if there is animation, this is default 10, or sometimes 8.
- count=1 how many frames are the for the animation, if it's 1 then the item has no animation.
- offs_x=-23 move the middle of the image 23 pixels to the left, if positive then to the right. If this is 0, then it's centered on the X axis.
- offs_y=50 move the whole image 50 pixels up, so if an image is 100 pixels tall, it would be centered on the Y axis.
- [dir_0] this will tell the engine that frames will come for direction 0, which is how the item would look facing North-East on the map.
- frm_0=fish_circling1_01.png this is the image file for the first frame in given direction. If your item uses animations, there will be more of these with the suffix increasing
- Create image file:
- Download random image from web or create the one with your favorite paint tool, use .png file type when you save it.
- Custom images can contain all colors in 32 bit range, you can use transparency as well, thus .png files work best, as size not an issue. Side note: Original fallout 1/2 image files contained only up to 240 different colors and color blue was used for transparent color, but you don't need to worry about that.
- Create inventory image - repeat this process for the image that will be shown in inventory, if the item is picked up.
- Copy the .fofrm files and their images to the respective folder structure:
- ..\Client\data\base.zip\art\items\ for items on the map
- ..\Client\data\base.zip\art\inven\ for items in the inventory
- Alternatively, use a new zip file (example: fishing.zip) to store the data, you need to copy the .fofrm files to:
- ..\Client\data\fishing.zip\art\items\ for items on the map
- ..\Client\data\fishing.zip\art\inven\ for items in the inventory
- Add the new zip file (fishing.zip) to the config file to be loaded:
- Edit ..\Client\DataFiles.cfg and add this new line data\fishing.zip after data\base.zip
Server side:
- Adding the new item to the server
- Open the file ..\Server\proto\items\misc.foproto
- Find an item you wish to copy the attributes from and copy paste lines starting with [Proto] and ending with an empty line. Example: ProtoId=539 -which is the Meat
- Make sure to keep the empty line between items.
- There are various parameters you can change, but for simplicity we just copy flags, weight etc. from well working items.
- You will need to change the following parameters to:
- To change the image when the fish is dropped on the ground on a map, change this: PicMap=art\items\fishing\freshmeat.fofrm
- To change the image when the fish is in inventory, change this: PicInv=art\inven\fishing\fish_1.fofrm
- Give a unique ProtoID number, for example 26760, should look like this: ProtoId=26760
- Name and description to the new item
- Edit the file at location: ..\Server\text\engl\FOOBJ.MSG and add the following line accordingly keeping the sorted nature of the numbers in front of lines.
- {2676000}{}{Fish} for the name of the item
- {2676001}{}{Could be a derivative of Salmon and radiation.} for the description (or info) of the item.
- Notice that the number 2,676,000 is 100 times 26,760, and the two last digits will have a special meaning, denoting name or info, hence I colored them differently above.
Testing it:
- Once you logged in with your admin character, type the command: ~getaccess admin admin (In case you changed the admin password, use different password, if in doubt check the GM abuse tutorial at fodev.net questions and answer section)
- You should get a message on top of the screen stating: "Mercenaries don't die - they just go to hell to regroup."
- Type `give 26760 2 - this will give you 2 Fishes.
- Hover over the Fish you got in inventory, click with default mouse cursor to show description info, and check if it's the same you have added.
CHEAT SHEET:
