Menu

#9 please help

closed
None
5
2015-06-22
2010-02-03
No

(I already posted this but thought I'd post anywhere and everywhere that might get me an answer)
How do I add a NEW role?
I have been coding an old pirate.diff line for line into the slashem code, and I have come up with erroneous errors in attrib.c and also if I remove attribs entrys on pirate role.c goes nuts.
I am wondering if anyone can tell me EVERY spot that needs some reference to PM_PIRATE or something like that. As in...
PM_PRIEST has an entry in:
attrib.c
u_init.c
role.c
priest.des
etc.
so that I can put ALL the entries I need into the code so that it won't freak out.
currently I have #ifdef PIRATE and then the pir_attrib[] stuff stuff stuff (matching the code of the other roles)
#endif
and that seems to work. but then when it gets to the PM_NECROMANCER ...#ifdef PIRATE PM_PIRATE...abil pir_abil...#endif {BY THE WAY all entries are identical}
it crashes with adjabil PM_PIRATE undeclared (first use in this function)
I am thinking that it doesn't have some previous reference to PM_PIRATE that it needs, so...
if anyone knows about what entries are required into the code so that PM_PIRATE can be referenced
(even if someone wants to contact the coder of the jedi patch and ask him)
PLEASE help me.
I am eventually trying to code the electric and etheric mages into slashem (check feature request), but thought I would try to use the pirate role patch from nethack and see if I could at least use someone elses code to help me design my own.
I looked at the jedi patch and I HAVE added all the stuff that he did (monst.c artilist.h attrib.c tech.c u_init.c etc) with #ifdef's and #endif's and made sure to put it in config.h
I would love to find some info ANYWHERE on how to add characters to slashem, but as much as I have searched there seems to be NO info on that subject anywhere.

Discussion

  • J. Ali Harlow

    J. Ali Harlow - 2010-02-03

    As far as I know, no such documentation exists. In general the difficult part of adding a new role is finding some new and interesting way in which the role can interact with the dungeon. That means lots of changes in lots of unpredictable places in the codebase. Any attempt at a cookbook approach would be counter productive. Sorry that we couldn't be more help.

     
  • J. Ali Harlow

    J. Ali Harlow - 2010-02-03
    • assigned_to: nobody --> j_ali
    • status: open --> closed
     
  • ozma

    ozma - 2015-06-22

    A baseline would have helped, (btw I am writing these answers to my own question posts after my discoveries; for others like me) like:

    If your character has the same letter as another existing character add it after... That is why Ranger is AFTER Rogue. Like Mage after Monk (in the code).

    u_init.c, role.c, (name).des (one in src one in dat), makefile(s), config(s), tech.c (slashem only), attrib.c, and preface each entry with ifdef (name) and enddef (look in the codes for tourist or jedi.patch etc)

    AND j.ali is right:
    if you are intending to add a new character class to nethack/slashem/or a variant... You need to think/plan/test/answer what do I want to add? why do I want this? what will this do in interaction with existing classes? how will this affect future bones? and how does this change game balance/how do I rebalance?

     

Log in to post a comment.