More modding questions

Discussion in 'Modding' started by tentacled-godqueen, Aug 13, 2012.

  1. >.< (because I seem to be asking a bunch :p)

    Anyway!

    Is there a way to make an item provide a buff when equipped/remove it when removed? Or a spell to check if an item is equipped?

    I have a few alternate ideas so it's not like it's the most important thing ever.
     
  2. shaken

    shaken Member

    There is no way to provide a buff when an item is equipped, and there is no way to remove a buff when an item is unequipped, that I know of. I am currently implementing some "Item Set" logic into a mod, so if you're interested in seeing a ridiculous workaround, you'll be able to poke around in the XML when the mod is released.
     
  3. That does actually fairly little to help me now though :p

    (Anyway I'd just give the item a proc on something that happens all the time--most likely either consumeBuff or targetKillBuff and then have things to check that, and then either stick everything on a timer, or have the checking effect wipe old effects its checking for, or both. ...so basically your item triggers a medium duration proc whenever you kill something, and resets the duration if you already have it, and wipes it if you equip another version of the item. Or something like that. Which works for my purposes. Or I could just use wands instead of like, hats. :p)
     
  4. shaken

    shaken Member

    This is essentially what I'm doing, so you're good to go.
     
  5. Next question! If I were to make a Plant Person mod, is there a way to make it so you can't eat food like the Vampirism skill? (You must instead take time to photosynthesize)
     
  6. AvzinElkein

    AvzinElkein Member

    Sorry, I think that kind of stuff is hardcoded.
     
  7. Null

    Null Will Mod for Digglebucks

    Well you could make it exactly like vampirism including the same text.
     
  8. lilystorm

    lilystorm Member

    From the vampire skill tree: <flags noFood="1"/> last line before </skill>
    Vegan has <flags nofood="1" veganism="1" friendlyTaxa="Animal"/>
     
  9. Yeeeeah I figured.

    Another question: Does "triggerOnCast" work on items? 'cause it's not giving errors or anything but it doesn't appear to be working for me. Which :|

    I've seen nothing saying it won't work on items though.
     
  10. lilystorm

    lilystorm Member

    How would that work though? You mean have the item have a chance to do the buff when you cast a spell? If you tried it at 100% and it didn't work then it probably doesn't work. Sounds neat if it could work though.
     
  11. Yeah that was the idea.

    It uses the same syntax as triggerOnDodge which I have seen sources say only works in skills, soooo it's not exactly surprising.
     
  12. Kazeto

    Kazeto Member

    No, it doesn't work.

    If it was working, then the item would trigger a spell, any spell, when you cast a spell of your own.
     
  13. lilystorm

    lilystorm Member

    Ah yes, like your sig says.
     
  14. Another question: Is there a way to have "<" in the description of a skill? (I assume there's a way to escape it in XML but I'm not as certain Dredmor will read that correctly)

    (As an explanation, I'm trying to make a skill description be "Bring sparkly rainbow joy to the world! And drive back those meany monsters Dredmor summoned with the magic of love and hope! <3" ...and the heart is VERY IMPORTANT okay)
     
  15. shaken

    shaken Member

    I also assume there is a way to escape the arrow bracket within XML, but I don't know what it is. If you can't find a way to do that, you could always use Alt + 3, and see if that is displayed in Dredmor. ♥
     
  16. Null

    Null Will Mod for Digglebucks

    Isn't it just &lt; or something like that?
     
    Kazeto likes this.
  17. That'd probably be good to check. My backup plan is just use another smiley, like "^_^" or ":)" even.

    More my question was, is this going to break the game if I try it? I know I saw some stuff about translations breaking the game if they used nonlatin characters; though maybe in fixing that this will work too?

    Although I could just use something safe for a while and when my mod is a bit more functional (as in, able to load at all :p) do some poking around and see what works.
     
  18. Kazeto

    Kazeto Member

    Not really. It might fail to load when you change it, but after you revert the change in your mod it will be fine.
    Unless you mean the graphic emoticon, in which case I can assure you that it won't be able to do anything with it, as XML is kind of pure text while said emoticon is no text at all.

    Also, this page:
    http://www.w3schools.com/xml/xml_syntax.asp
    Sometimes it's good to just sit down and read part of a tutorial if you are unsure. Even if you have experience as a programmer and "know it" - just to be sure that you didn't make a stupid mistake when using something you didn't use for some time.

    And it's "&lt" in this case, just as Null had said.
     
  19. Mkay another question:

    Is there a simple way to do a switch control structure type thing with buffs? Like, if buff a do effect a, if b do effect b, etc. and then if none do another effect?

    'cause I can do it without a default option pretty simply, but if i want a default option (if not A and not B and not C...) then the only way I can think of would be to make a linked-list thing with spells that're each like "If A do thing, if not A go to the next entry" and repeat until the last one is like, "If F do thing, if not F do other thing".

    Which takes a BUNCH of superfluous spells that don't really do anything and is kind of inelegant :p
     
  20. Kazeto

    Kazeto Member

    Your mod will have to be inelegant for the time being, then.
    Because that is the only way right now, unless the buffs were exclusive (in which case it would be easier to decrease the amount of code in the prerequisite checker, but the buffs themselves would use slightly more code).