Tutorial Bear Form Adding Effects

RedRage

New Member
Reaction score
7
Bear Form
What will this teach?
How do add attribute bonus, hp bonus, armour bonus, ect when bear form is turned on.
How to remove bonus when bear form is turned off.
*EDIT* How to make it so hero doesn't lose attribute once they level spell in dragon form.

Making bear form
First make your hero, then make the unit/hero it will turn into
Go into object editor, click abilities and right click, press new custom ability. Then unit ability, and locate bear form. Name it what ever you want, I named my spell Dragon Form, and my two triggers, Dragon Spell, and Dragon Spell Undo.

Delete tech tree req


To make it an hero ability just locate, then make it true:
Stats - Hero Ability [True]

To change the model it will turn into, and normal form.
Level 1 - Date - Normal Form
Level 1 - Date - Alternate Form

Starting the trigger
Go into Trigger editor, make new category, then make your trigger
First make this :
Code:
Events
    Unit - A unit Starts the effect of an ability

Conditions
    (Ability being cast) Equal to Dragon Form

Now we need a variable to represent the caster. INFO DragonCaster is an unit
Code:
Set DragonCaster = (Triggering unit)


Next we will make a IF/THEN/ELSE
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    Then - Actions
    Else - Actions

Now make two triggers which are almost the same, except change the second spell Starts the effect of an ability to, Finishes casting an ability.
IMPORTANT!!!! CHECK THE INITIALLY ON BOX SO IT'S OFF FOR THE DRAGON SPELL UNDO!

Code:
Dragon Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
            Else - Actions
Code:
Dragon Spell Undo
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
            Else - Actions
Adding the heart of the trigger, this will remove the effects when the spell is turned off, then add the effects when the spell is turned on
Code:
Set DragonCasterCheck = 0
and
Code:
DragonCasterCheck Equal to 0

Now lets add this in to the first trigger:
Code:
Dragon Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        Set DragonCasterCheck = 0
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 0
            Then - Actions
                Set DragonCasterCheck = 0
            Else - Actions
                Set DragonCasterCheck = 0

The second trigger should look like this:
Code:
Dragon Spell Undo
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 1
            Then - Actions
                Set DragonCasterCheck = 1
            Else - Actions
                Set DragonCasterCheck = 1
Now we will add the turn off/on part of this trigger, this turns on/off the 2nd trigger, and the 2nd trigger turns on/off the first.
Code:
Dragon Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        Set DragonCasterCheck = 0
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 0
            Then - Actions
                Set DragonCasterCheck = 0
                Trigger - Turn on Dragon Spell Undo <gen>
                Trigger - Turn off (This trigger)
            Else - Actions
                Set DragonCasterCheck = 0

Code:
Dragon Spell Undo
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 1
            Then - Actions
                Set DragonCasterCheck = 1
                Trigger - Turn on Dragon Spell <gen>
                Trigger - Turn off (This trigger)
            Else - Actions
                Set DragonCasterCheck = 1


Adding Effect
Now you've finished the hardest part it's time for you to add effects! The effects will always go between the THEN ACTIONS

Adding Attribute Bonus
We will do this by the level of the ability, you can change strength to agility, or intelligence. This is how it would look like. BE SURE TO ADD THIS TO Dragon Spell
Code:
Dragon Spell 
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 1
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Dragon Form  for DragonCaster) Equal to 1
                    Then - Actions
                        Hero - Modify Strength of DragonCaster: Add 10
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of Dragon Form  for DragonCaster) Equal to 2
                            Then - Actions
                                Hero - Modify Strength of DragonCaster: Add 20
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Level of Dragon Form  for DragonCaster) Equal to 3
                                    Then - Actions
                                        Hero - Modify Strength of DragonCaster: Add 30
                                    Else - Actions
                                        Do nothing
                Set DragonCasterCheck = 1
                Trigger - Turn on Dragon Spell <gen>
                Trigger - Turn off (This trigger)
            Else - Actions
                Set DragonCasterCheck = 1


And this is how Dragon Spell Undo would look like:
Code:
Dragon Spell Undo
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 1
            Then - Actions
                Set DragonCasterCheck = 1
                Trigger - Turn on Dragon Spell <gen>
                Trigger - Turn off (This trigger)
            Else - Actions
                Set DragonCasterCheck = 1
Ok you're done this, but now when the person levels their spell while Dragon Form is on, then changes back they lose attribute, the solution? Another trigger! INFO DragonCasterStat is integer
Code:
DragonCasterAttributeChanger
    Events
        Unit - A unit Learns a skill
    Conditions
        ((Level of Dragon Form  for DragonCaster) Equal to 1) or (((Level of Dragon Form  for DragonCaster) Equal to 2) or ((Level of Dragon Form  for DragonCaster) Equal to 3))
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Learned Hero Skill) Equal to Dragon Form 
                (Learned skill level) Equal to 3
            Then - Actions
                Set DragonCasterStat = ((Strength of DragonCaster (Exclude bonuses)) - 20)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Learned Hero Skill) Equal to Dragon Form 
                        (Level of Dragon Form  for DragonCaster) Equal to 2
                    Then - Actions
                        Set DragonCasterStat = ((Strength of DragonCaster (Exclude bonuses)) - 10)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Learned Hero Skill) Equal to Dragon Form 
                                (Level of Dragon Form  for DragonCaster) Equal to 1
                            Then - Actions
                                Set DragonCasterStat = ((Strength of DragonCaster (Exclude bonuses)) - 0)
                            Else - Actions
                                Do nothing
We're done this, but where will it come into effect?
Lets add this into Dragon Undo, because it will change the casters attribute onec the spell is done
Code:
Hero - Modify Strength of DragonCaster: Set to DragonCasterStat
Code:
Dragon Spell Undo
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 1
            Then - Actions
               Hero - Modify Strength of DragonCaster: Set to DragonCasterStat
                Set DragonCasterCheck = 1
                Trigger - Turn on Dragon Spell <gen>
                Trigger - Turn off (This trigger)
            Else - Actions
                Set DragonCasterCheck = 1
You can change the str to what ever attribute you want, i just used str as my attribute


Adding Range, attack, armour, hp, ect

First make an upgrade, then after you made it, add it to the unit your hero turns into Techtree - Upgrades Used, and this upgrade will affect that unit only.
But we will make it so depending on what level Dragon Form is.
Code:
Dragon Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        Set DragonCasterCheck = 0
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 0
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Dragon Form  for DragonCaster) Equal to 1
                    Then - Actions
                        Player - Set the current research level of Attack Bonus  to 1 for (Owner of DragonCaster)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of Dragon Form  for DragonCaster) Equal to 2
                            Then - Actions
                                Player - Set the current research level of Attack Bonus  to 2 for (Owner of DragonCaster)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Level of Dragon Form  for DragonCaster) Equal to 3
                                    Then - Actions
                                        Player - Set the current research level of Attack Bonus  to 3 for (Owner of DragonCaster)
                                    Else - Actions
                                        Do nothing
                Set DragonCasterCheck = 0
                Trigger - Turn on Dragon Spell Undo <gen>
                Trigger - Turn off (This trigger)
            Else - Actions
                Set DragonCasterCheck = 0


Code:
Dragon Spell Undo
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DragonCasterCheck Equal to 1
            Then - Actions
 Player - Set the current research level of Attack Bonus  to 0 for (Owner of DragonCaster)
                Set DragonCasterCheck = 1
                Trigger - Turn on Dragon Spell <gen>
                Trigger - Turn off (This trigger)
            Else - Actions
                Set DragonCasterCheck = 1

Better Explained

How Does this work??
When the spell is activated, it sets DragonCasterCheck to 0, which activates the action of the IF/THEN/ELSE, which would be your effect, then it turns on Dragon Spell Undo, and turns itself off. But since Dragon Spell Undo only works when the spell is finished, it then sets DragonCasterCheck to 1. Then since Dragon Spell is turned off, and DragonCasterCheck is 1, it activates the IF/THEN/ELSE action, which takes away the effects, then turns on Dragon Spell, but it can't take effect right away because it only works when the ability is activated.

Adding Special Effects
You can add effects to make it cooler when you activate the spell
Code:
Untitled Trigger 001
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Dragon Form 
    Actions
        Set DragonCaster = (Triggering unit)
        Set TempDragonCaster = (Position of DragonCaster)
        Special Effect - Create a special effect attached to the chest of DragonCaster using Abilities\Spells\Other\Doom\DoomDeath.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest of DragonCaster using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest of DragonCaster using Objects\Spawnmodels\Undead\UCancelDeath\UCancelDeath.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest of DragonCaster using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script:   call RemoveLocation (udg_TempDragonCaster)
INFO TempDragonCaster is point

Sorry if i couldn't explain this better
You're done! :p
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
609
Very nice, this should answer some questions ask here a lot.
 

RedRage

New Member
Reaction score
7
Thxs, and i know because i was asking same question few days ago, then i came up with this.
 

elmstfreddie

The Finglonger
Reaction score
203
But isn't this not MUI?
Wouldn't it make more sense so it modifies the unit's custom value, not a global variable? Then it would be MUI.
 

RedRage

New Member
Reaction score
7
Guess it would :eek: but, this is meant for a hero, and that would mean more work figuring that out, and i'm trying to make it GUI no jass involved.
BTW you can't modify the units values with bonus mod, and thats jass, well actually you can with upgrades.
 

RedRage

New Member
Reaction score
7
Er.. Yes you can.
Unit - Set Unit Value or Custom Value something like that. It's there..!
Ugh, you can only add attribute bonus, i already got that so..... and you can't add hp, mana, ect.

*bump*?
:rolleyes:

Oh srry about this triple post but, i changed the above ATTRIBUTE add, so the person doesn't lose their attribute when they level dragon form =D

Though a comment on what you think about this tut would be appreciated

*Bump*
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top