How do I add custom graphics to CEs?

Stuck at a level? Need help with R'n'D or anything R'n'D related? Post here!

Moderators: Flumminator, Zomis

Post Reply
ncrecc
Posts: 106
Joined: Thu Jul 12, 2018 12:59 am

How do I add custom graphics to CEs?

Post by ncrecc » Tue Sep 04, 2018 2:25 am

There must be some documentation to this that I can't find. All I know is that it involves some .pcx extension.

User avatar
Eizzoux
Posts: 304
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: How do I add custom graphics to CEs?

Post by Eizzoux » Tue Sep 04, 2018 9:01 am

1. First you need to create new folder "graphics" in the level set you want to add new graphics to. Then open Notepad and click "File>Save as", change file type from "Text file (.TXT)" to "Any file", save the file to that new "graphics" folder as "graphicsinfo.conf" (yes, .CONF, not .TXT).
bn0.jpg
'graphicsinfo.conf' & 'player.png'
bn0.jpg (26.33 KiB) Viewed 1135 times
Then you need to have at least one file with width and height that can be divided by 32 (for example, 256x128, 160x64 or 640x354) and any supportable image file (for example PCX or PNG). I'll have the PNG image 192x64 as example. Each frame in it must be aligned on 32x32 pix. grid.
bn1.jpg
Here's the "player.png" image example
bn1.jpg (67.34 KiB) Viewed 1135 times
Open the "graphicsinfo.conf" file you created if you closed Notepad after creating it. Type this in there:

Code: Select all

custom_1: [name of image file you need]
custom_1.xpos: [X-position of the needed frame counting from 0]
custom_1.ypos: [Y-position of the needed frame counting from 0]
custom_1.frames: [the frames count for animation]
custom_1.delay: [delay between frames (1=0.02 second=20 milliseconds, not neccessary if frames count is '1')]
custom_1.anim_mode: [animation mode: none, loop, pingpong, pingpong2, linear, random, reverse (can be combined with other anim modes), and some other "special" ones, not neccessary if you just want it to be normally looping]
Here're these "animation modes" shown as the frames order:
bn4.jpg
Animation types
bn4.jpg (289.43 KiB) Viewed 1135 times
Here're two examples:
bn2.jpg
File setting and sprite position
bn2.jpg (78.88 KiB) Viewed 1135 times
bn3.jpg
Animating
bn3.jpg (93.18 KiB) Viewed 1135 times
You can also do different animations for moving, pushing, collecting, exploding, turning, falling or just standing still for different directions, you just need to add few new rows with the needed element, needed action and direction ([element].[action].[direction]).
bn5.png
'[element].[action].[direction]'
bn5.png (54.16 KiB) Viewed 1135 times
For example:

Code: Select all

custom_1.left:player.png
custom_1.left.xpos:4
custom_1.left.ypos:0
custom_1.left.frames:1
custom_1.right:player.png
custom_1.right.xpos:1
custom_1.right.ypos:1
custom_1.right.frames:1
custom_1.down:player.png
custom_1.down.xpos:1
custom_1.down.ypos:0
custom_1.down.frames:1
custom_1.up:player.png
custom_1.up.xpos:4
custom_1.up.ypos:1
custom_1.up.frames:1
custom_1.moving.left:player.png
custom_1.moving.left.xpos:3
custom_1.moving.left.ypos:0
custom_1.moving.left.frames:3
custom_1.moving.left.delay:4
custom_1.moving.left.anim_mode:pingpong
custom_1.moving.right:player.png
custom_1.moving.right.xpos:0
custom_1.moving.right.ypos:1
custom_1.moving.right.frames:3
custom_1.moving.right.delay:4
custom_1.moving.right.anim_mode:pingpong,reverse
custom_1.moving.down:player.png
custom_1.moving.down.xpos:0
custom_1.moving.down.ypos:0
custom_1.moving.down.frames:3
custom_1.moving.down.delay:4
custom_1.moving.down.anim_mode:pingpong
custom_1.moving.up:player.png
custom_1.moving.up.xpos:3
custom_1.moving.up.ypos:1
custom_1.moving.up.frames:3
custom_1.moving.up.delay:4
custom_1.moving.up.anim_mode:pingpong,reverse
Nothing in here...*

ncrecc
Posts: 106
Joined: Thu Jul 12, 2018 12:59 am

Re: How do I add custom graphics to CEs?

Post by ncrecc » Tue Sep 04, 2018 4:30 pm

That explains everything, thank you!

User avatar
Holger
Site Admin
Posts: 3218
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: How do I add custom graphics to CEs?

Post by Holger » Wed Sep 05, 2018 10:43 am

Thanks a lot, Eizzoux, for this comprehensive and very detailed explanation of how to define custom graphics for custom elements in R'n'D! You did it *much* better than I could have done it myself, and added great illustrations to show how it works!

This post should be part of a larger "custom artwork" documentation yet to be written, but it's really the basics most people will probably want to start with!

Thanks again! :)

Post Reply