ID:160564
 
Hey there, today is my 24th birthday, and i suddenly got the itch to make a byond game, i've been reading up on the DM Guide, got through everything up until you make the icons for the floor, wall, and player, now, it took a while to do that, but once i got icons for them, and i created the map file, it doesn't seem to recognize that i actually have any icons setup, my code is
turf
floor
icon = 'floor.dmi'
wall
icon = 'wall.dmi'
density = 1
mob
icon = 'player.dmi'

same as the tutorial says, and of course the icon files are named floor.dmi, wall.dmi, and player.dmi respectively, could someone point out where i went wrong? also, i'd like to add a secondary question, the icons i'm using are actually cropped from rpgmaker 2000 tilesets, is there any easier way to grab the tiles from them and put them into the dream maker? the wall one i had a bunch of trouble with, cause just selecting, copying, and pasting a mountain icon into another file, then putting that in dream maker, showed up as a tiny little dot, so i had to stretch it over 1000% of the original size just to get it to show up recognizably, and am having trouble getting it into a correct size that shows just that tile and nothing else, with nothing cut out.
For your first problem, make sure your icons don't have an icon state assigned to them.
If the icon within the .dmi has an icon state assigned to it, make sure you define it.
turf
icon = 'turfs.dmi'
wall
icon_state = "wall"
floor
icon_state = "floor"


As for your second problem... cut, copy, and clean up, buddy. Only way I know of, so far.
If you have them placed in a separate file in the game's directory ("project/icons") make sure you either 1) Specify what folder the icon is in ('icons/person.dmi') or 2) Add:

#define FILE_DIR "icons"


where "icons" is the name of the folder your icons are in.
You would probably better off making your own icons...
In response to Quest Industries
RPG Maker graphics are very good quality; a lot higher than some of the custom icons on BYOND.
In response to Jeff8500
True, but it does get a little annoying seeing them used in alot of games, over and over again. Thats, why I am making my own even though they are'nt the best or not even close to that.
In response to Thief Jack
Thief Jack wrote:
For your first problem, make sure your icons don't have an icon state assigned to them.
If the icon within the .dmi has an icon state assigned to it, make sure you define it.
turf
> icon = 'turfs.dmi'
> wall
> icon_state = "wall"
> floor
> icon_state = "floor"
>

As for your second problem... cut, copy, and clean up, buddy. Only way I know of, so far.

Hmm, well, thanks for trying to help, but i replaced the code the guide says
turf
floor
icon = 'floor.dmi'
wall
icon = 'wall.dmi'
density = 1
with the one i'm quoting from you, it needed me to make a turfs.dmi, so i did, little forest thingy, i go to the actual map file and it says i've got 1 floor, but with no icon, and about 20 walls(when i've only got 1, all with no icons.
In response to Domar
If you read the paragraph above that snippet, the key word is "example".

The icon variable, obviously, refers to the file where the icons you want.

Now, I am sure you went in the icon file... did you set an icon state (text underneath the icons, this can be done by right clicking the icon and selecting Edit State)?

The icon_state variable helps separate the icons in each icon file. If all of them had no icon state (no text underneath the icons in the DMI file) or at least two had the same icon state value, only one of those with the same icon state variable will show up and the other(s) won't.

The one with no icon state is usually the default icon state, such as if you had a state named "Xaw" but when you set the object's state as icon_state = "xaw", this will set the icon to the icon state of null (because it is cap-sensitive).

turf
icon = 'Example.dmi'

No_State

IS_of_Xaw
icon_state = "Xaw" // Will show the icon in the Example.DMI file with the state "Xaw"

Wrong_IS
icon_state = "xaw" // Assuming that the DMI has only two states, null (blank) and "Xaw", this will default to the null icon because xaw != Xaw (cap-sensitive).
In response to GhostAnime
Ok, you seem to know what you're talking about, problem is, i don't, haha, really, i just started as this, i followed the directions in the guide for creating a Maze, this is what it says
# Create a project called maze through the New Environment... option.

# Create the main maze.dm file, and enter the following code:

turf floor icon = 'floor.dmi' wall icon = 'wall.dmi' density = 1 mob icon = 'player.dmi'

# Build the floor.dmi icon. Do this by selecting New File... and choosing Icon File for the type. This will bring up a new window, with the option to build pixmaps (static, directionless, icons) and movies (animated or directional icons). Choose New Pixmap... from the Graphic menu and show off your artistic flair by drawing a picture of a floor. Repeat this step for the wall.dmi and player.dmi icons.

# With the three icons in place, the project should compile. Test this by selecting the Compile option. If it is successful, you should be able to see your icons in the object tree tab on the left-hand side of the screen. This tree illustrates the objects defined in your world.

# You can run the world now, but you won't see any icons because you haven't put any objects on the map yet. To build a map, again select New File... and choose Map File. You can name it whatever you'd like; the .dmp extension will be appended, indicating that this file is a map.

# Now for the fun part! Create the map by selecting objects from the tree and placing them with the various functions. For example, to add a row of walls, select the Add function on the map pane, click on the wall tile in the tree (it's underneath turf), and draw them on the map by left-clicking the mouse. You can remove tiles by right-clicking. The map editor has considerable functionality; you can learn about it by reading the included documentation.

# Compile the new, graphical project and run it with Dream Seeker. If all goes well, you should see your creation on screen. Your avatar can roam the floors and bump into the walls. Not too bad for a couple minutes of work!

sorry about the big post, but i followed those directions completely, i set the floor as just a green block, walls as a bright red block with some orange in it, and the character as just a brown arrow with a off-white background around him, i go to the map file, and i find that i can set mobs and floors, but they don't show up, the walls, however, do, after reading your post, i went to the icons, right clicked, set the icon states to have the same named as the icons, and also checked the movement box on the mob one, now the map file won't display ANY of the icons when placed, its giving me a big migrane, do you think you know what the problem is? i can actually run the game, but it'll just show up with a blank screen on the left side and no options on the right(which is what i expect with nothing displaying on the map)
In response to Domar
Domar wrote:
i go to the map file, and i find that i can set mobs and floors, but they don't show up, the walls, however, do

Be sure to compile (ctrl+K) whenever you make any changes to /turf, /obj, etc when you want to update the map!

after reading your post, i went to the icons, right clicked, set the icon states to have the same named as the icons, and also checked the movement box on the mob one, now the map file won't display ANY of the icons when placed

Did you defined the icon_state variable? Remember to always have one default icon_state (which has no name) so in case you misspell an icon_state, you'll know!

For example, in my turf icon fie, the default icon state I have is grass. For objects icon file, I have a big red X outlined in blue. For mobs, I have some random drawing - so when I notice that one of these appeared when it isn't suppose to, I know I did something wrong (which happened a few times).
In response to GhostAnime
ok, well, i always compile after i make changes, but i dunno how to set the icon_state variable, right clicking one of the icons and going to edit state only makes a small box appear with two things you can do, Input State Name, and a check box for Movement State. Do i simply leave one of the State Name fields empty to make it the default?
In response to Domar
Domar wrote:
Do i simply leave one of the State Name fields empty to make it the default?

Yes. The default state is the empty [string] state.
I highly recommend reading this since you're a beginner to improve yourself and introduce you to the language. Start with Zilal's Beginner Tutorials (ZBTs), they cover the basic things such as setting icons on an almost step by step basis and are good for beginners.
In response to Domar
Yep, make the state name blank (also known as null - not to be confused with "null") to make it the default.

Movement state will animate the icon when it moves. You can have two icon states, both with the same name, and have one checked off with the movement state option and the following will happen:

- The one WITH the movement state checked will only animate when moved, primarily used for walking animation.

- The one without movement will happen whenever the icon stays still (ex: blinking animation)


As to tell the compiler what icon state to use, define the icon_state variable.

Keyword: variable

This should hint you, if you looked at my snippet earlier, that this needs to be defined in the code (.dm) file. Remember, compilers are not psychic - they do as told. If you do not tell them what icon_state to refer to, they'll go with the default one.

Please read the comments ni the following snippet.
turf
Example1
icon = 'X.dmi' // The compiler is told that Ex1 is to use X.dmi as its icon file
icon_state = "X" // The compiler is specifically told to the state "X" from the icon file

Example2 // Since Ex2 is under Ex1, the default icon is X.dmi and the default IS is X - until you define it otherwise
icon_state = "Y"

Example3
icon = 'Z.dmi' // Ex3 is told to use Z.dmi as it's icon with no specific state

Example4
icon 'A.dmi' // This should give you an error. Can you see why? ;)
icon_state = "1" // Uses the specific state "1". Note that any values used in the icon file's state, including numbers, are treated as text strings.


Also note the link provided by Kaioken, this will help you learn more about how to program in DM.
In response to GhostAnime
Wow, thanks, ok, thats one hurdle jumped, now just several thousand more to go, haha. really, thanks for the help, its working correctly now.