SUPPORT ACCOUNT CLANS
Welcome, Unregistered.
 

Thread: Coding Dream Hero Wit

Page 1 of 2 12 LastLast
Results 1 to 20 of 32
  1. #1

    Coding Dream Hero Wit

    Hi guys,

    (Hope this is the right place for this)

    I'm currently working on coding my Hero from Dream into HoN, and of course there are some snags along the way that I hope some of you guys have a good idea of how to work out.

    The hero I'm trying to code is my Dream hero Wit (Link to Dream page)

    I have layed it out as follows:

    The first ability: Knife juggle
    I have split this ability in two. First part takes care of the toggle for gaining knife charges, and the launching of knives into the air on toggle off. The second part is the target ability that deals with the executing of throwing the juggling knives.



    Ability1:
    Setting up dobble interface for this ability.
    ability.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
        name="Ability_Wit1"
        icon="icon.tga"
     
        anim="ability_1"
        casttime="1100"
        castactiontime="400"
        maxlevel="4"
        requiredlevel="1,3,5,7"
        actiontype="toggle"
        casteffecttype=""
     interface="double"
        manacost="25"
        cooldowntime="1000"
     
        range="400"
     
     modifierkey="wit_juggle1,wit_juggle2,wit_juggle3,wit_juggle4"
    >
     <modifier key="wit_juggle1" modpriority="90"
      disabled="true"
     />
     
     <modifier key="wit_juggle2" modpriority="90"
      disabled="true"
     />
     
     <modifier key="wit_juggle3" modpriority="90"
      disabled="true"
     />
     
     <modifier key="wit_juggle4" modpriority="90"
      disabled="true"
     /> 
     
    </ability>

    Ability1a:
    Toggle ability for starting the juggling
    abilitya.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
        name="Ability_Wit1a"
     
        icon="icona.tga"
     
        anim=""
        casttime="0"
        castactiontime="0"
     
        maxlevel="4"
        requiredlevel="1,3,5,7"
     
        targetscheme="enemy_units"
        targetradius="2500"
     
        actiontype="toggle"
        casteffecttype=""
     
        manacost="25"
        cooldowntime="1000"
     
        maxcharges="4,5,6,7"
    >
        <ontoggleon>
            <setcharges a="2" />
            <starttimer duration="1000,800,600,400" />
        </ontoggleon>
     
        <ontoggleoff>
            <compare a="charges" b="0" op="gt">
                <spawnaffector name="Affector_Wit_Ability1a" />
                <setcharges a="0" />
                <resettimer />
            </compare>
            <else>
                <resettimer />
            </else>
        </ontoggleoff>
     
        <ontimer>
            <addcharges entity="this_entity" count="1" />
            <setaccumulator entity="this_entity" value="charges" />
            <printvalue label="==== Charges =" value="charges" />
            <printvalue label="==== SetAccumulator =" value="accumulator" />
            <compare a="charges" b="4,5,6,7" op="lt">
                <starttimer duration="1000,800,600,400" />
            </compare>
        </ontimer>
     
        <onattack>
            <compare a="charges" b="0" op="gt">
                <removecharge />
            </compare>
        </onattack>
     
        <ondeath>
            <setcharges a="0" />
        </ondeath>
     
        <modifier key="Wit_Artist_1" modpriority="100"
            maxcharges="5,6,7,8"
        >
            <ontimer>
                <addcharges entity="this_entity" count="1"  />
                <compare a="charges" b="5,6,7,8" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="Wit_Artist_2" modpriority="100"
            maxcharges="5,6,7,8"
        >
            <ontimer>
                <addcharges entity="this_entity" count="1"  />
                <compare a="charges" b="5,6,7,8" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="Wit_Artist_3" modpriority="100"
            maxcharges="6,7,8,9"
        >
            <ontimer>
                <addcharges entity="this_entity" count="1"  />
                <compare a="charges" b="6,7,8,9" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="Wit_Artist_4" modpriority="100"
            maxcharges="7,8,9,10"
        >
            <ontimer>
                <addcharges  entity="this_entity" count="1"  />
                <compare a="charges" b="7,8,9,10" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="wit_juggle1" modpriority="90"
            baselevel="1"
            keyslot="0"
        />
     
        <modifier key="wit_juggle2" modpriority="90"
            baselevel="2"
            keyslot="0"
        />
     
        <modifier key="wit_juggle3" modpriority="90"
            baselevel="3"
            keyslot="0"
        />
     
        <modifier key="wit_juggle4" modpriority="90"
            baselevel="4"
            keyslot="0"
        />    
    </ability>

    affector.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <affector
        name="Affector_Wit_Ability1a"
     
        radius="2500"
     
        lifetime="1000"
        maximpactspertarget="1"
        targetselection="all"
        targetscheme="enemy_units"
        effecttype="Physical"
     
        impactdelay="1000"
     
        persist="true"
    >
        <onexpired>
            <playeffect effect="effects/aoe1.effect" source="this_position" target="" occlude="true" />
        </onexpired>
     
        <onimpact>
            <applystate name="State_Wit_Ability1a_Enemy" duration="2000" />
            <setvar0 a="accumulator" b="15,20,25,30" op="mult" />
            <printvalue label="==== val0 =" value="val0" />
            <printvalue label="==== accumulator =" value="accumulator" />
            <damage effecttype="Physical" amount="1" b="val0" op="mult" />
            <damage effecttype="Physical" amount="100,200,300,400" />
        </onimpact>
    </affector>

    statea_enemy.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <state
     name="State_Wit_Ability1a_Enemy"
     icon="icon.tga"
     effecttype="StatusDebuff"
     allowtransfer="true"
     movespeedslowpercharge="0.04"
    >
     <oninflict>
      <setcharges entity="this_entity" a="accumulator" />
      <printvalue label="==== Charges enemy =" value="charges" />
     </oninflict>
     
    </state>



    Ability1b:
    Ability for triggering knifthrow
    abilityb.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
     name="Ability_Wit1b"
     
     icon="iconb.tga"
     
     anim=""
     casttime="0"
     castactiontime="0"
     
     maxlevel="4"
     requiredlevel="1,3,5,7"
     
     actiontype="target_entity"
     targetscheme="enemy_units"
     range="600"
    >
     <onimpact>
      <applystate name="State_Wit_Ability1b_Self" target="source_entity" proxy="target_entity" continuous="true" />
     </onimpact>
     <modifier key="wit_juggle1" modpriority="90"
      baselevel="1"
      keyslot="1"
     />
     
     <modifier key="wit_juggle2" modpriority="90"
      baselevel="2"
      keyslot="1"
     />
     
     <modifier key="wit_juggle3" modpriority="90"
      baselevel="3"
      keyslot="1"
     />
     
     <modifier key="wit_juggle4" modpriority="90"
      baselevel="4"
      keyslot="1"
     />
    </ability>

    state_self.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <state
        name="State_Wit_Ability1b_Self"
     
        icon="icon.tga"
        passiveeffect=""
     
     impactinterval="600,500,400,300"
     effecttype="Physical"
    >
     <onimpact>  
      <distance target="source_entity" source="proxy_entity" />  
      <compare a="result" b="800" op="lt">
       <spawnprojectile name="Projectile_Wit_Ability1b" source="source_entity" target="proxy_entity" noresponse="true" />
      </compare>
      <else>
       <expirestate name="State_Wit_Abillity1b_Enemy" target="proxy_entity" />
       <expire />
      </else>
     </onimpact>
     
     <onkill>
      <expire />
     </onkill>
     
     <onexpired>
      <expirestate name="State_Wit_Ability1b_Enemy" target="proxy_entity" />
     </onexpired>
    </state>

    stateb_enemy.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <state
     name="State_Wit_Ability1b_Enemy"
     icon="icon.tga"
     effecttype="StatusDebuff"
     allowtransfer="true"
    >
     <oninflict>
      <addcharges count="1" />
     </oninflict>
     
     <onrefresh>
      <addcharges count="1" />
     </onrefresh>
     <modifier key="Wit_Artist_1" modpriority="80"
      movespeedslowpercharge="0.02"
     />
     <modifier key="Wit_Artist_2" modpriority="80"
      movespeedslowpercharge="0.04"
     />
     
     <modifier key="Wit_Artist_3" modpriority="80"
      movespeedslowpercharge="0.06"
     />
     
     <modifier key="Wit_Artist_4" modpriority="80"
      movespeedslowpercharge="0.08"
     />
    </state>


    Ability 2:
    Gives passiv bonus to ability 1
    ability.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
     name="Ability_Wit2"
     icon="icon.tga"
     maxlevel="4"
     requiredlevel="1,3,5,7"
     actiontype="passive"
     modifierkey="Wit_Artist_1,Wit_Artist_2,Wit_Artist_3,Wit_Artist_4"
    >
    </ability>



    The problem is that i can't get the two subabilities in ability 1 to affect eachother. Like reducing charges in ability1a duo to targeting with ability1b. Is there a method for passing variables among abilities?

    I have posted my whole code for ability 1 and 2. Hopefully someone will help me get back on track. Is there better methods for coding this hero?

    Thanks in advance!

    -Lirion

  2. #2
    I havent much time to look into your code now but you should be able to
    pass variables by using something like the following in your abilityb.entity:

    <onimpact>
    ...
    <pushability name = "wit_jugle1"/>
    <removecharge entity="stack_entity" />
    ...
    </onimpact>

    As far as I remember that should work.

    [Custom Map]
    Valkyrie Wars [Dream]
    [Guide] How to create a neutral creep spot | [Map] Borderland [Dream]
    [MineCraft Server] CraftCraft 20Slot 24/7 [84.200.47.30]

  3. #3
    Hi Schm0ftie, thanks for your respons.

    I have started to work on the pushability, but can't seem to get it right. I'm new too this kind of programming so hope you can enlighten me on how to use it. Think my problem is that I dont have anything in the stack? The whole idea of how too use stack_entity is vague for me, can you cast some light here aswell?

    -Lirion

  4. #4
    Hey
    I'm gonna go through your code and answer your questions below
    Lines removed
    Lines added

    Lines changed

    Additional info:
    Every entity has its own variables (charges, accumulator, param). Param can be passed at spawning of affector and projectile, charges with <addcharges count="0" entity="..._entity"/>. Accumulator is private.

    Idejder's Drunken Master Dev Blog: Episode 2 First spoiler contains info about states, affectors, projectiles, gadgets and modifiers

    Updated guide by me (now again outdated, but still useful :P )




    ability.entity

    This ability is only main skill, which is leveled up, its variables are used only in tooltips, so it doesn't require anim, casttime and castactiontime
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
        name="Ability_Wit1"
        icon="icon.tga"
       anim="ability_1"
        casttime="1100"
        castactiontime="400"
        maxlevel="4"
        requiredlevel="1,3,5,7"
        actiontype="toggle"
        casteffecttype=""
     interface="double"
        manacost="25"
        cooldowntime="1000"
     
        range="400"
      
        disabled="true"
     modifierkey="wit_juggle1,wit_juggle2,wit_juggle3,wit_juggle4"
    >
    //I don't see point in these lines, it works as well with disabled="true" by default, but I'll ask someone wiser than me about it
      <modifier key="wit_juggle1" modpriority="90"
      disabled="true"
     />
     
     <modifier key="wit_juggle2" modpriority="90"
      disabled="true"
     />
     
     <modifier key="wit_juggle3" modpriority="90"
      disabled="true"
     />
     
     <modifier key="wit_juggle4" modpriority="90"
      disabled="true"
     /> 
     
    </ability>

    Ability1a:
    Toggle ability for starting the juggling
    abilitya.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
        name="Ability_Wit1a"
     
        icon="icona.tga"
     
        anim=""
        casttime="0"
        castactiontime="0"
     
        maxlevel="4"
        requiredlevel="1,3,5,7"
        baselevel="0"
     
        targetscheme="enemy_units"
        targetradius="2500"
     
        actiontype="toggle"
        casteffecttype=""
     
        manacost="25"    // Does toggling cost mana? Otherwise it should be 0
        cooldowntime="1000"
     
        maxcharges="4,5,6,7"
    >
        <ontoggleon>
            <setcharges a="2" />  // Wit will have 2 daggers every toggling. Intended?
            <starttimer duration="1000,800,600,400" />
        </ontoggleon>
     
        <ontoggleoff>
            <compare a="charges" b="0" op="gt">
                <spawnaffector name="Affector_Wit_Ability1a" param="charges" /> // It's easiest way to pass variable to affector and projectile 
                <setcharges a="0" />
                <resettimer />
            </compare>
            <else>
                <resettimer />
            </else>
        </ontoggleoff>
     
        <ontimer>
            // You should be able to make dagger cost 20 mana <compare a="source_mana" ...>  <takemana/> actions
            <addcharges entity="this_entity" count="1" />
            <setaccumulator entity="this_entity" value="charges" />
            <printvalue label="==== Charges =" value="charges" />
            <printvalue label="==== SetAccumulator =" value="accumulator" />
            <compare a="charges" b="4,5,6,7" op="lt">
                <starttimer duration="1000,800,600,400" />
            </compare>
        </ontimer>
     
        <onattack>
            <compare a="charges" b="0" op="gt">
                <removecharge />
            </compare>
        </onattack>
     
        <ondeath>    // Some debug code, isn't it?
            <setcharges a="0" />
        </ondeath>
     
        <modifier key="Wit_Artist_1" modpriority="100"
            maxcharges="5,6,7,8"
        >
            <ontimer>
                <addcharges entity="this_entity" count="1"  />
                <compare a="charges" b="5,6,7,8" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="Wit_Artist_2" modpriority="100"
            maxcharges="5,6,7,8"
        >
            <ontimer>
                <addcharges entity="this_entity" count="1"  />
                <compare a="charges" b="5,6,7,8" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="Wit_Artist_3" modpriority="100"
            maxcharges="6,7,8,9"
        >
            <ontimer>
                <addcharges entity="this_entity" count="1"  />
                <compare a="charges" b="6,7,8,9" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="Wit_Artist_4" modpriority="100"
            maxcharges="7,8,9,10"
        >
            <ontimer>
                <addcharges  entity="this_entity" count="1"  />
                <compare a="charges" b="7,8,9,10" op="lt">
                    <starttimer entity="this_entity" duration="1000,800,600,400" />
                </compare>
            </ontimer>
        </modifier>
     
        <modifier key="wit_juggle1" modpriority="90"
            baselevel="1"
            keyslot="0"
        />
     
        <modifier key="wit_juggle2" modpriority="90"
            baselevel="2"
            keyslot="0"
        />
     
        <modifier key="wit_juggle3" modpriority="90"
            baselevel="3"
            keyslot="0"
        />
     
        <modifier key="wit_juggle4" modpriority="90"
            baselevel="4"
            keyslot="0"
        />    
    </ability>

    affector.entity

    Here you should use param variable, which you can set in <spawnaffector/> action

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <affector
        name="Affector_Wit_Ability1a"
     
        radius="2500"
     
        lifetime="1000"
        maximpactspertarget="1"
        targetselection="all"
        targetscheme="enemy_units"
        effecttype="Physical"
     
        impactdelay="1000"
     
        persist="true"
    >
        <onexpired>
            <playeffect effect="effects/aoe1.effect" source="this_position" target="" occlude="true" />
        </onexpired>
     
        <onimpact>
            <applystate name="State_Wit_Ability1a_Enemy" duration="2000" pushentity="true" />
            <setcharges a="param" entity="stack_entity"/>
            <evaluate a="param" b="15,20,25,30" op="mult" />
            <printvalue label="==== result=" value="result" />
            <damage effecttype="Physical" amount="1" b="result" op="mult" />
            <damage effecttype="Physical" amount="100,200,300,400" />
        </onimpact>
    </affector>

    statea_enemy.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <state
     name="State_Wit_Ability1a_Enemy"
     icon="icon.tga"
     effecttype="StatusDebuff"
     allowtransfer="true"
     movespeedslowpercharge="0.04"
    >
      <oninflict>
      <setcharges entity="this_entity" a="accumulator" />
      <printvalue label="==== Charges enemy =" value="charges" />
     </oninflict>
      // Charges must be set after applying state by using stack_entity
    </state>



    Ability1b:
    Ability for triggering knifthrow
    abilityb.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
     name="Ability_Wit1b"
     
     icon="iconb.tga"
     
     anim=""
     casttime="0"
     castactiontime="0"
     
     maxlevel="4"
     baselevel="0"
     
     actiontype="target_entity"
     targetscheme="enemy_units"
     range="600"
    >
     <onimpact>
      <applystate name="State_Wit_Ability1b_Self" target="source_entity" proxy="target_entity" continuous="true" />
     </onimpact>
     <modifier key="wit_juggle1" modpriority="90"
      baselevel="1"
      keyslot="1"
     />
     
     <modifier key="wit_juggle2" modpriority="90"
      baselevel="2"
      keyslot="1"
     />
     
     <modifier key="wit_juggle3" modpriority="90"
      baselevel="3"
      keyslot="1"
     />
     
     <modifier key="wit_juggle4" modpriority="90"
      baselevel="4"
      keyslot="1"
     />
    </ability>

    state_self.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <state
        name="State_Wit_Ability1b_Self"
     
        icon="icon.tga"
        passiveeffect=""
        ishidden="true"
     impactinterval="600,500,400,300"
      effecttype="Physical" In states in can be StatusBuff or StatusDebuff to make it purge-able and enemy/friendly. ""  makes state non-purgable and neutral.
    >
     <onimpact>  
      <testactivate target="source_entity" source="proxy_entity" distance="800">
           <spawnprojectile name="Projectile_Wit_Ability1b" source="source_entity" target="proxy_entity" noresponse="true" />
      </testactivate > //It's recommended tag for checking distance (Guide)
      <else>
       <expirestate name="State_Wit_Abillity1b_Enemy" target="proxy_entity" />
       <expire />
      </else>
     </onimpact>
     
     <onkill>
      <expire />
     </onkill>
     
     <onexpired>
      <expirestate name="State_Wit_Ability1b_Enemy" target="proxy_entity" />
     </onexpired>
    </state>

    stateb_enemy.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <state
     name="State_Wit_Ability1b_Enemy"
     icon="icon.tga"
      effecttype="StatusDebuff"     // It makes it purge-able (removable by Shrunken) 
      allowtransfer="true"              // and allows Parasite to steal it 
    >
     <oninflict>
      <addcharges count="1" />
     </oninflict>
     
     <onrefresh>
      <addcharges count="1" />
     </onrefresh>
     <modifier key="Wit_Artist_1" modpriority="80"
      movespeedslowpercharge="0.02"
     />
     <modifier key="Wit_Artist_2" modpriority="80"
      movespeedslowpercharge="0.04"
     />
     
     <modifier key="Wit_Artist_3" modpriority="80"
      movespeedslowpercharge="0.06"
     />
     
     <modifier key="Wit_Artist_4" modpriority="80"
      movespeedslowpercharge="0.08"
     />
    </state>


    Ability 2:
    No changes here
    ability.entity

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ability
     name="Ability_Wit2"
     icon="icon.tga"
     maxlevel="4"
     requiredlevel="1,3,5,7"
     actiontype="passive"
     modifierkey="Wit_Artist_1,Wit_Artist_2,Wit_Artist_3,Wit_Artist_4"
    >
    </ability>



    About stack_entity:

    HoN uses stack to store variables used last time. There are 2 stacks: one for numbers (result variable) and second for entities (stack_entity). Numbers are pushed after almost every action (Check updated guide) and entities only in few actions (moreover only if they have pushentity="true" attribute). To be honest I'm not sure when is used pop function, but I never had to know it.

    I hope this code will be working :P

    tojo

  5. #5
    Thank you very much Tojo! I had alleready started recoding the code to implement a state that will handle the knifejuggling. I have to say I learn plenty of your post about the mechanics! Brilliant work!

    I'll post a finished version of Wit when I have all the tweaks done. If that is interesting. Next problem is to link the knifethrowing to the charges of the knifejuggling ability, but I think I can handle that with the enlightenment I got from your post.

    Hope you vote him up if you like him


    -Lirion
    Last edited by Lirion; 01-23-2012 at 05:51 PM.

  6. #6
    Welk tojo already answered all your questions. Feel free to share your code with the community, resources are allways welcome

    [Custom Map]
    Valkyrie Wars [Dream]
    [Guide] How to create a neutral creep spot | [Map] Borderland [Dream]
    [MineCraft Server] CraftCraft 20Slot 24/7 [84.200.47.30]

  7. #7
    Hi again!

    I have started to work on the ultimate, even thou someone said it was not possible
    So I have a question:
    Is it possible to test which hero is beeing targeted? I know that the target_entity will have the information about the targeted unit, but I want to test if the target is for example Hero_Arachna.

    I tried to use the <pushentitybyname name="Hero_Arachna" /> too put that entity on top of the stack, but it does not work. Any ideas?

  8. #8
    Hero_Arachna is not entity's name but type
    You can test it with <condition/> tag:
    <condition test="not_entity_type State_Succubis_Ability3" target="inflictor_entity" >It's from succubis\ability_03\state.entity file.

    So your test will be :
    <condition test="entity_type Hero_Arachna" >
    target="target_entity"
    is not required, because it is default value.

    You can set name of entity when spawning it or in map editor. It's rarely used though.

    About stealing/copying skills: It is possible, but very boring to code :P

  9. #9
    Thanks again for your reply!

    I'll have to give it a shot since I have all of the other abilities sorted out. At least to test it for a few spesific types of heroes. I need to code every ulti into my code sort of, or can you refer to it from a <useability> code?

    -Lirion

  10. #10
    You have to code every ulti
    That's why I called it boring. :P

    I'm wondering, what with Aluna's or BS's ults?

  11. #11
    Yeah, there are a few ulities out there that is going to be hard to interpret. Well I have to start with the ones that are straight forward. Like Pyromancer, Witch Slayer and Arachna. Ulities like Midas will have to be none imitateble I think. BS's ultimate will cause a lot of damage output, and i think it will be a pain to work it into the codes

    Have to do this in portions i think. Thanks again for your replies, they have realy help med out. And thumb Wit up on Dream, he is starting to fall

  12. #12
    Hi again,

    I have found a good method to code the ulties of the target into Wit, but have hit an other snag. Is there a limit of how many modifiers you can have? When i have more the 16 my hero is no longer visible, the model just disapears. If that is so, I will have a hard time making Wit be able to copy all ulties. So it seems he is only able to copy 16 ulties...

    -Lirion

  13. #13
    As far as I know it's only possible to use about 20 modifiers per entity.

    Quote Originally Posted by Oloko View Post
    Getting a random number is not an issue, its pretty easy, and that is what I'm already doing:

    <damage min="0" max="255" target="this_entity" /> -> this will random between 0 and 255
    <setcharges a="result" /> -> This will round up the random number, since we can get things like 0.9424325
    <setvar0 a="charges" /> -> Here we got, a real random integer!

    The issue is this:
    PLEASE FOR THE LOVE OF GOD READ THIS BEFORE POSTING
    The only way known to give spells to a hero is by using modifier. But there is a limit of something like 20 modifiers. So we don't have enough modifier for every spell. We would need on a hero 3 modifiers for every normal spell and 1 modifier for every ult.
    We either need a way to have more that 20 modifiers or to find another way to change an hero spells that is not using modifier.
    From the "is OMG Mode possible?" (OMG mode is about having random spells from heroes, so in fact you need all spells like you need them)
    Last edited by Schm0ftie; 01-28-2012 at 06:21 AM.

    [Custom Map]
    Valkyrie Wars [Dream]
    [Guide] How to create a neutral creep spot | [Map] Borderland [Dream]
    [MineCraft Server] CraftCraft 20Slot 24/7 [84.200.47.30]

  14. #14
    I've only one idea right now and it's bit complicated
    So, almost every entity in HoN has default maximum level set to 25 (it can be changed in custom maps though).
    In abilities we use only 4 and in ultimates 3. Theoretically we can use all these levels to code more abilities in one ability.entity file (6 normal or 8 ultimates). Moreover 16 modifiers could allow us to code 16*6=96 abilities or 16*8=128 ultimates.
    I'll show it on simple example, which uses only 6 levels and 1 modifier, bigger ones are analogous.

    I must add that in my opinion it's not worth to code all ultimates manually, writing program to mechanize it is more interesting challange . (All in all no need for program, good Excel document can be helpful as well)

    Anyway, there is example code, main ability can steal ultimate from heroes A and B:

    abilityA.entity - example of stolen ability

    <ability
    icon="icon.tga"

    anim="ability_4"
    casttime="casttimeA"
    castactiontime="castactiontimeA"

    maxlevel="3"
    requiredlevel="6,11,16"

    actiontype="target_entity"
    targetscheme="enemy_units"
    casteffecttype="Magic"

    manacost="manacostA1,manacostA2,manacostA3"
    cooldowntime="cooldowntimeA1,cooldowntimeA2,cooldo wntimeA3"
    casteffect="effects/sound.effect"
    range="rangeA">

    <onimpact>
    <spawnprojectile name="ProjectileA" source="source_entity" target="target_entity"/>
    </onimpact>

    </ability>



    steal.entity


    <ability
    name="Steal_Ability"
    icon="icon.tga"

    casttime="300"
    castactiontime="400"

    maxlevel="3"
    requiredlevel="6,11,16"

    actiontype="target_entity"
    targetscheme="enemy_units"
    casteffecttype="SuperiorMagic"

    manacost="300,400,500"
    casteffect="effects/steal.effect"
    range="500,600,700">
    nosilence="true"

    </ability>
    <onimpact>
    <condition test="entity_type Hero_A" >
    <setactivemodifierkey name="modAB"/>
    <setlevel value="1,2,3"/>
    </condition>

    <condition test="entity_type Hero_B" >
    <setactivemodifierkey name="modAB"/>
    <setlevel value="4,5,6"/>
    </condition>
    </onimpact>

    <modifier key="modAB" modpriority="100"
    maxlevel="6"
    requiredlevel="100" // blocks leveling after stealing
    icon="/heroes/A/ability_04/icon.tga,/heroes/A/ability_04/icon.tga,/heroes/A/ability_04/icon.tga,/heroes/B/ability_04/icon.tga,/heroes/B/ability_04/icon.tga,/heroes/B/ability_04/icon.tga"

    casttime="casttimeA,casttimeA,casttimeA,casttimeB, casttimeB,casttimeB" // number values took from abilities A and B
    castactiontime="castactiontimeA,castactiontimeA,ca stactiontimeA,castactiontimeB,castactiontimeB,cast actiontimeB"

    actiontype="target_entity"
    targetscheme="enemy_units"
    casteffecttype="Magic"

    manacost="manacostA1,manacostA2,manacostA3,manacos tB1,manacostB2,manacostB3"
    cooldowntime="cooldowntimeA1,cooldowntimeA2,cooldo wntimeA3,cooldowntimeAB1,cooldowntimeB2,cooldownti meB3"
    casteffect="/heroes/A/ability_04/effects/sound.effect,/heroes/A/ability_04/effects/sound.effect,/heroes/A/ability_04/effects/sound.effect,,,"
    // 2nd ult doesn't have effect so it's ,,,
    range="rangeA,rangeA,rangeA,rangeB,rangeB,rangeB"
    >
    <onimpact>
    <spawnprojectile level="1,2,3,1,2,3" name="ProjectileA,ProjectileA,ProjectileA,Projecti leB,ProjectileB,ProjectileB" source="source_entity" target="target_entity" pushentity="true" noresponse="true" offset="-20 100 100" />
    <setproxy entity="stack_entity" target="target_entity" />

    <setactivemodifierkey name=""/>
    <setlevel value="1,2,3,1,2,3"/> // Returns level change
    </onimpact>

    <onaction> //only 1st ability have <onaction>
    <compare a="1,1,1,0,0,0" b="1" op="eq"> <!-- This trick should be used wisely, I don't recommend it in <onframe> -->
    <playeffect effect="/heroes/A/ability_04/effects/cast.effect" target="source_entity" source="source_entity"/>
    </compare>
    </onaction>

    </modifier>


    You see that I've coded here 2 very similar abilities, not hard to guess whom
    I think it's the best solution, for both: easy scripting and optimization reasons.

    I've no idea what to do with ability tooltip
    No clue about SoTM as well, at least this boosting stolen ultimate. Cooldown reduction shouldn't be so hard with <reducecooldown/> action


    I've tested it, you can download working code if my explanation is not clear:

    Hero_Stealer is Parasite with reworked ultimate + he is in Legion (He took last free intelligence cell in legion, left bottom corner)

    He can steal ults only form Witch Slayer and Pyromancer

    LINK

    It's map file, to run it copy it to HoN\game\maps and run with console command (CTRL + F8):
    StartGame practice "qwe" "map:stealer"

    I prefer scripting in maps because you don't have to reset HoN to reload added files.
    Last edited by tojooko; 01-28-2012 at 07:51 AM.

  15. #15

    Trying, but failing

    I have given this some thougth and experimented some on how to do this, as menchened in my previous post I had a good method for changing the Ultimate which uses modifiers.

    The method simply changed the inventory to the desired ultimate:
    Code:
    <modifier key="Arachna" modpriority="100" inventory3="Ability_Arachna4" />
    So with this metode the tooltip and everthing will be working for a lot of heroes. (Will be problems with ultimates that affects other abilities on the hero. Such as and )

    Next thougth was to use this methode combined with pets, so that for a group of heroes I would spawn a pet that would have the targeted heroes ultimate. This way I could spawn different pets based on what hero was targeted, and then bypassing the limitation of number of modifiers. The problem with this method was that the leeching effect from or will only effect the pet.

    I'll have to think more on how to do this. I hope to find a way to do this.


    The technique you use will have a hard time with ulties from would it not?

    -Lirion

  16. #16
    ult spawns projectile, isn't it?

    The most tricky thing in my method is grouping similar ultimates in one modifier. For my code ultimates are same thing, they send projectile.

    Lot of ultimates spawns affector or are single target spells etc. etc...
    States, passives and so on

    As you said the most problematic in general are ulties which have synergy, like ...

    In your method 20 modifiers blocks you
    So do these problematic ulties.

    Anyway good luck in searching

    EDIT:
    There is hero in DoTA which steals skills, isn't it? Do you know how do he deal with synergy abilities?
    Last edited by tojooko; 01-28-2012 at 04:19 PM.

  17. #17
    EDIT:
    There is hero in DoTA which steals skills, isn't it? Do you know how do he deal with synergy abilities?
    No, sorry. Have never played DoTA.

    I found this post from Bangerz, where he refers to the problem with 20 modifiers and also gives hit of that a workaround is coming on that post.
    Semms that the post is a little old, so I sent a PM to Bangerz and asked what he had planed when he wrote this:

    Coming Soon ™
    ... have more than 4 abilities on a unit?

    ... have more than 20 modifiers/abilities?
    ... have more than 20 items in the shop?
    ... control unit respawning?
    ... create a scoring system?

    ... control shop access?
    ... create a round/zoning system with teleportation?

    http://forums.heroesofnewerth.com/sh...hlight=ontimer

    -Lirion

  18. #18
    Well, I'm waiting for response with you.
    But I don't hope for positive one

  19. #19

    Got it working!

    Finaly I got the ultimate working. The method I now used is based on the first method of my second last post, but duo to the restriction of 20 modifiers I had to do some workarounds. The solution was to make multiple Wit Heroes that each can handle about 13 different ultimates and then morhp the main character into the Wit hero which can handle the given ultimate.

    Off course there are a few problems, as we menchened in the earlier posts. I have concluded with that some of the ultimates just wont give any effects. Surch as:
    Code:
    Aluna
    Midas
    Pebbels
    Revanent
    Soulstealer - will work but Wit dont have any souls. so it doesnt do any damage. Just causes the other effects.
    Blacksmith is currently not working but there should be a small matter to implement the chance of multicast into the other skills. Thou this will only affect Knife Juggle.

    There are some other ultimates that will last even after Wit copies another one. Like Shadowblades ulitmate. So need to tweak the individual ultimate a bit before its finished.
    I'll post the code here when im done.

    -Lirion
    Last edited by Lirion; 01-29-2012 at 01:30 PM.

  20. #20
    Hm, I'm not sure how it could in real game
    How are you swapping it? Are you using <morph/> tag?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •