FORUM ARCHIVED

Questions about a possibilities in a Skills Mod

Discussion in 'Modding' started by Wootah, Jan 10, 2013.

  1. Wootah

    Wootah Member

    So I want to try to build a skill mod.
    I don't have almost any programming experience, but I have been reading dreadmod I am going to give it a shot.

    I already have the functionality of the mod drawn out on paper IF some of the following scenarios are possible.
    Unfortunately, I am not sure by looking at dredmod if they are possible. Most abilities I have seen that have a chance to proc are set up such that if a skill is associated with multiple events, each one is simply given a percentage and all or non or any combination can proc. I don't want that.

    I was hoping for something different. I want the events to be mutually exclusive (so that the player knows that they are going to get something, but that it will be random, or repeated randomly)

    Are these possible:

    First Scenario
    Second Scenario
    Third Scenario
     
  2. Alistaire

    Alistaire Member

    First:
    triggerFromList

    Second:
    Ask kazeto

    Third:
    Ask kazeto

    ----

    Also, you seem to think of code in terms of equations. Dredmor's XML does not have that.
     
  3. Wootah

    Wootah Member

    Thank you, Thank you.
    I will start working on the trigger from list ones first, Thanks again.

    And how should I think of code? I took a intro to pascal class in 1998... so a long time ago.
     
  4. Alistaire

    Alistaire Member

  5. Essence

    Essence Will Mod for Digglebucks

    Second scenario is pretty simple.

    requirebuffonnottrigger="1" for the 'if no buffs'.
    requirebuffontrigger for each of the two individual cases.
    and two sequential requirebuffontrigges for the final case. If necessary, each triggering a requirebuffonnottrigger referencing the other buff if you want it to be an and rather than an or.


    The third case, i do believe is either impossible or Kazeto territory.
     
    Kazeto likes this.
  6. Wootah

    Wootah Member

    Thanks Essence. That is what I needed. I can do most of the mod now :)
     
  7. Essence

    Essence Will Mod for Digglebucks

    No problem, w00tz. Feel free to ask about anything that comes to mind. :)
     
  8. Oh, the third one would be possible, just kind of obnoxious - you could have three different buffs, one named <buffname>, one named <buffname >, and one named <buffname > (EDIT - this should have two spaces after it but for some reason it's not showing up), each one with x, 2x, and 3x the bonuses. The spell that would otherwise give you the buff would need three nested spells (using similar code to scenario two) that remove the lower level and give you the higher level depending on which level you have.
    Oh! Alternate thought, which occurred to me while I was writing this. It's sort of hard to explain, so let me just pseudocode it out quickly:

    BuffName (stacksize 3)

    StartSpell
    trigger Branch1 requirebuffontrigger BuffName

    Branch1
    removebuffbyname BuffName
    trigger Effect1 requirebuffonnottrigger BuffName
    trigger Branch2 requirebuffontrigger BuffName
    trigger BuffName

    Branch2
    removebuffbyname BuffName
    trigger Effect2 requirebuffonnottrigger BuffName
    trigger Effect3 requirebuffontrigger BuffName
    triggerBuffName

    (the order of the spells needs to be changed to work properly but i just wrote them out in the way that made it clearest what i meant)
    Neither of these work that cleanly with brittle or upkeep buffs, but those don't often stack anyways. And of course both could be scaled up or down for stacksize =/= 3.
     
    Kazeto, mining and Essence like this.
  9. Essence

    Essence Will Mod for Digglebucks

    Very nicely explained, VV. Thank you!
     
  10. Kazeto

    Kazeto Member

    That having been said (yay, I'm late to the party; I had two rather tiring days and thus this thread was sitting here open waiting for me to read it and reply), the third case's alternate version ("for each instance of the buff on the stack, do 'A'") is actually fairly easy to do even if you don't want the buffs on the stack to be removed.

    You simply need to create two buffs - the first one being this buff, and the other one a placeholder (a dummy buff, pretty much).
    Then, make it so that the spell, upon casting, triggers an effect with a "requirebuffontrigger" on the first buff. This effect will do five things - trigger the desired "A" effect via a trigger, remove one instance of the first buff via "removebuffbyname", give you one instance of the second buff via a trigger, cast itself via a trigger with "requirebuffontrigger" on the first buff, and cast the second effect via a trigger with "requirebuffonnottrigger" on the first buff. The second effect (a dummy one) will trigger the third effect with "requirebuffontrigger" on the second buff. The third effect, upon triggering, will do almost the reverse of what the first effect did - remove one instance of the second buff, place one instance of the first buff, and trigger itself via a trigger with "requirebuffontrigger" on the second buff.

    Thus, the spell would cast the desired effect as many times as you have stacks of the buff, without them disappearing and without you having to make insane amounts of nigh-identical buffs.

    And yes, just as vacantVisionary wrote, it tends not to work with buffs which are limited by anything other than the timer, and it is best to use it with "permanent" buffs.
     
    mining and Essence like this.