NUM_RODS?


Questions, Explanations, Howtos

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Thursday, 14th March 2013, 15:36

NUM_RODS?

The compiler keeps crashing on tilepick.cc.
The error happens at line 62,
  Code:
COMPILE_CHECK(NUM_RODS == TILE_ROD_ID_LAST - TILE_ROD_ID_FIRST + 1);

which makes sence because I tried to add a few rods in. Does anyone know what I should do from here?

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Thursday, 14th March 2013, 15:41

Re: NUM_RODS?

1) Nobody can help you if you don't provide enough detail, i.e. show all the code you have changed.
2) Have you even tried to find out anything else about those TILE_ROD_ID_LAST and TILE_ROD_ID_FIRST enums?

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Thursday, 14th March 2013, 15:57

Re: NUM_RODS?

mumra wrote:1) Nobody can help you if you don't provide enough detail, i.e. show all the code you have changed.
2) Have you even tried to find out anything else about those TILE_ROD_ID_LAST and TILE_ROD_ID_FIRST enums?

Yes. I went code diving in the hopes to find them, but they didn't seem to be in the item enum file, nor the regular enum file.
As far as being specific goes, I was just hopeing someone could tell me somethign about those Enums, at which point I could probably figure out what was wrong. Either way, here's the changes.
This bit was at the end of the rods in the book file.
  Code:
   
{   // Heat ray
    SPELL_THROW_FLAME,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
},
{   // freeze ray
    SPELL_THROW_FROST,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
},
{   // death ray
    SPELL_BOLT_OF_DRAINING,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
},
{   // ray gun
    SPELL_MAGIC_DART,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
    SPELL_NO_SPELL,
},

And this is in the item-prop enum
  Code:
  ROD_HEATRAY,
    ROD_FREEZERAY,
    ROD_DEATHRAY,
    ROD_RAYGUN,

They're for a wizlab. Can you tell?

EDIT:
ALmost forgot. Also gave them names in the file for item names.
  Code:
 case ROD_HEATRAY:
   return "heat rays";
    case ROD_FREEZERAY:   
   return "freeze rays";
    case ROD_DEATHRAY:
        return "death rays";
    case ROD_RAYGUN:
        return "laser beams";

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Thursday, 14th March 2013, 16:08

Re: NUM_RODS?

Did you update the rod_type enum in itemprop-enum.h? If not, do that and see if it compiles.

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Thursday, 14th March 2013, 16:15

Re: NUM_RODS?

BlackSheep wrote:Did you update the rod_type enum in itemprop-enum.h? If not, do that and see if it compiles.

Yup. It's the second block of code.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 14th March 2013, 16:20

Re: NUM_RODS?

TILE_ROD_ID_FIRST and TILE_ROD_ID_LAST are defined in rltiles/tiledef-main.h which is a generated file. You added rods but failed to give them tiles. You need to define it in rltiles/dc-item.txt. The syntax for this file is explained on the dev wiki.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks:
khalil

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Thursday, 14th March 2013, 16:23

Re: NUM_RODS?

galehar wrote:TILE_ROD_ID_FIRST and TILE_ROD_ID_LAST are defined in rltiles/tiledef-main.h which is a generated file. You added rods but failed to give them tiles. You need to define it in rltiles/dc-item.txt. The syntax for this file is explained on the dev wiki.

There's a dev wiki? This will make my life so much easier. Also, thank's for explaining what I did wrong.

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Thursday, 14th March 2013, 16:23

Re: NUM_RODS?

That explains why I wasn't seeing it in my code base here. I've never compiled it. :)

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Thursday, 14th March 2013, 16:26

Re: NUM_RODS?

khalil wrote:Yes. I went code diving in the hopes to find them, but they didn't seem to be in the item enum file, nor the regular enum file.
As far as being specific goes, I was just hopeing someone could tell me somethign about those Enums, at which point I could probably figure out what was wrong. Either way, here's the changes.


Well, people are more willing to tell you what they know if you actually show that you're willing to do some work yourself. Your very brief posts which usually give scant detail about anything you've done tend to give the impression that you want other people to do most of the work for you. (I would also strongly recommend discussing your ideas first, or picking things to implement that have already had a dev seal of approval; you are far more likely to get comprehensive help if you're implementing something that relevant people actively want to see in the game... You haven't told anyone what this wizlab is about but I don't have high hopes when I see things like "laser beams" and "death rays" that this is going to make it in. I'm not trying to be negative here, and if you're doing this just for your own entertainment then fair enough, but I wouldn't want someone being disappointed when their work doesn't get accepted into the game.)

Note: grep has already been recommended to you and this would have found the tile enums fine just like it will find anything in a file you don't know about.

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Thursday, 14th March 2013, 19:01

Re: NUM_RODS?

mumra wrote:
Well, people are more willing to tell you what they know if you actually show that you're willing to do some work yourself. Your very brief posts which usually give scant detail about anything you've done tend to give the impression that you want other people to do most of the work for you. (I would also strongly recommend discussing your ideas first, or picking things to implement that have already had a dev seal of approval; you are far more likely to get comprehensive help if you're implementing something that relevant people actively want to see in the game... You haven't told anyone what this wizlab is about but I don't have high hopes when I see things like "laser beams" and "death rays" that this is going to make it in. I'm not trying to be negative here, and if you're doing this just for your own entertainment then fair enough, but I wouldn't want someone being disappointed when their work doesn't get accepted into the game.)

Note: grep has already been recommended to you and this would have found the tile enums fine just like it will find anything in a file you don't know about.

I tried grep and it refuses to work.
As far as the laser goes, I just thought 'space wizards, we need that.'
I don't expect it to ever get accepted. I'm modding with the same mindset as when I mod dwarf fortress. It'll never be official, but at least I'll enjoy it.

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Thursday, 14th March 2013, 19:17

Re: NUM_RODS?

Are you using msysgit under windows for your git stuff and compilation?

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Thursday, 14th March 2013, 19:21

Re: NUM_RODS?

BlackSheep wrote:Are you using msysgit under windows for your git stuff and compilation?

Yes.

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Thursday, 14th March 2013, 19:28

Re: NUM_RODS?

  Code:
grep -r TILE_ROD_ID_FIRST *.h *.cc

I don't use it often, so I'm sure someone with stronger grep-fu could provide a cooler example, but that should show you the files containing that string. I just use N++ for searching because you can double-click on the search results to open the file and jump right to the line. At home I use eclipse which does something similar.

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Thursday, 14th March 2013, 19:42

Re: NUM_RODS?

khalil wrote:I tried grep and it refuses to work.
As far as the laser goes, I just thought 'space wizards, we need that.'
I don't expect it to ever get accepted. I'm modding with the same mindset as when I mod dwarf fortress. It'll never be official, but at least I'll enjoy it.


Crawl is open source; you can always make a public fork for other people to try out.

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Thursday, 14th March 2013, 19:44

Re: NUM_RODS?

mumra wrote:
khalil wrote:I tried grep and it refuses to work.
As far as the laser goes, I just thought 'space wizards, we need that.'
I don't expect it to ever get accepted. I'm modding with the same mindset as when I mod dwarf fortress. It'll never be official, but at least I'll enjoy it.


Crawl is open source; you can always make a public fork for other people to try out.

I figured it would be best if I made something worth putting up before I did that.

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Thursday, 14th March 2013, 19:56

Re: NUM_RODS?

I wasn't suggesting you did it immediately...

Return to Coding

Who is online

Users browsing this forum: No registered users and 9 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.