HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Remember learned skills

09-11-2003, 11:36 AM#1
Brugsy
Im trying to make somekind of altanative spell book...

I have a main hero, when I click on hes ability like "fire spells" it replace the hero with fire spells, then I learn a fire spell with the new hero, like "fireball" the new hero have an ability to change back to the orginal hero so I could choice "ice spells" etc. But when I change back to fire hero it doesn't safe my learned skills. How can I make these skills safe. So i don't have to click them in unlearned button each time.

Brugs
09-11-2003, 12:02 PM#2
Guest
Your best bet would be to add the ability to the hero and using upgrades upgrade it to the proper lvl.
09-11-2003, 04:11 PM#3
HyperNox
I had the same problem with my map if you are talking about the skill spellbook on a hero that has a morphing skill. I solved it by triggers took 5 integers cus I had 5 spells here is the triggers from my map:
Code:
Dracula learns
    Events
        Unit - A unit Learns a skill
    Conditions
        (Owner of (Triggering unit)) Equal to Player 1 (Red)
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Triggering unit)) Equal to Vampire
                (Unit-type of (Triggering unit)) Equal to Vampire (Bat Form)
    Actions
        -------- Draculas Spell Book --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Learned Hero Skill) Equal to Custom - 2
            Then - Actions
                Set Spell_SpellBook_Dracula = (Spell_SpellBook_Dracula + 1)
            Else - Actions
                Do nothing
        -------- Devour Magic --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Learned Hero Skill) Equal to Custom - 3
            Then - Actions
                Set Spell_DevourMagic_Dracula = (Spell_DevourMagic_Dracula + 1)
            Else - Actions
                Do nothing
        -------- Fear of the Dark --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Learned Hero Skill) Equal to Custom - 4
            Then - Actions
                Set Spell_Fear_of_the_Dark_Dracula = (Spell_Fear_of_the_Dark_Dracula + 1)
            Else - Actions
                Do nothing
        -------- Vampiric Attack --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Learned Hero Skill) Equal to Custom - 1
            Then - Actions
                Set Spell_VampiricAttack_Dracula = (Spell_VampiricAttack_Dracula + 1)
            Else - Actions
                Do nothing
        -------- Bat Form --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Learned Hero Skill) Equal to Custom - 5
            Then - Actions
                Set Spell_BatForm_Dracula = (Spell_BatForm_Dracula + 1)
            Else - Actions
                Do nothing

Code:
Dracula Trains
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Vampire) or ((Unit-type of (Matching unit)) Equal to Vampire (Bat Form)))) and do (Actions)
            Loop - Actions
                -------- Agility --------
                Set DraculasAgiStrInt[1] = (Agility of (Picked unit) (Exclude bonuses))
                -------- Strenght --------
                Set DraculasAgiStrInt[2] = (Strength of (Picked unit) (Exclude bonuses))
                -------- Inteligence --------
                Set DraculasAgiStrInt[3] = (Intelligence of (Picked unit) (Exclude bonuses))
                -------- Hp and Mp --------
                Set HpandMp_Dracula[1] = (Percentage life of (Picked unit))
                Set HpandMp_Dracula[2] = (Percentage mana of (Picked unit))

Code:
Bat Form
    Events
        Unit - A unit owned by Player 1 (Red) Finishes casting an ability
    Conditions
        (Ability being cast) Equal to BatForm 
    Actions
        Trigger - Run Dracula Trains <gen> (ignoring conditions)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Batform Equal to True
            Then - Actions
                Unit - Replace (Triggering unit) with a Vampire using The old unit's life and mana
                Set Batform = False
            Else - Actions
                Unit - Replace (Triggering unit) with a Vampire (Bat Form) using The old unit's life and mana
                Set Batform = True
        Wait 0.10 seconds
        Trigger - Run ReLearnSkills Train Dracula <gen> (ignoring conditions)
and
Code:
ReLearnSkills Train Dracula
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Vampire (Bat Form)) and do (Actions)
            Loop - Actions
                -------- ReLearn Skills --------
                Trigger - Turn off Dracula learns <gen>
                Hero - Modify unspent skill points of (Picked unit): Set to ((Hero level of (Picked unit)) - (Spell_Fear_of_the_Dark_Dracula + (Spell_SpellBook_Dracula + Spell_DevourMagic_Dracula))) points
                -------- Bat Form --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Spell_BatForm_Dracula Greater than or equal to 1
                    Then - Actions
                        For each (Integer A) from 1 to Spell_BatForm_Dracula, do (Actions)
                            Loop - Actions
                                Hero - Learn skill for (Picked unit): Custom - 5
                    Else - Actions
                        Do nothing
                -------- Vampiric Attack --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Spell_VampiricAttack_Dracula Greater than or equal to 1
                    Then - Actions
                        For each (Integer A) from 1 to Spell_VampiricAttack_Dracula, do (Actions)
                            Loop - Actions
                                Hero - Learn skill for (Picked unit): Custom - 1
                    Else - Actions
                        Do nothing
                Trigger - Turn on Dracula learns <gen>
                -------- ReTrain Stats --------
                -------- Bat Get minus 5 to str and agi --------
                Hero - Modify Agility of (Picked unit): Set to (DraculasAgiStrInt[1] - 5)
                Hero - Modify Strength of (Picked unit): Set to (DraculasAgiStrInt[2] - 5)
                Hero - Modify Intelligence of (Picked unit): Set to (DraculasAgiStrInt[3] - 0)
                -------- Set Life and Mana --------
                Unit - Set life of (Picked unit) to HpandMp_Dracula[1]%
                Unit - Set mana of (Picked unit) to HpandMp_Dracula[2]%
                Camera - Lock camera target for Player 1 (Red) to (Picked unit), offset by (0.00, 0.00) using Default rotation
                Selection - Select (Picked unit) for Player 1 (Red)
        Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Vampire) and do (Actions)
            Loop - Actions
                -------- ReLearn Skills --------
                Trigger - Turn off Dracula learns <gen>
                -------- Bat Form --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Spell_BatForm_Dracula Greater than or equal to 1
                    Then - Actions
                        For each (Integer A) from 1 to Spell_BatForm_Dracula, do (Actions)
                            Loop - Actions
                                Hero - Learn skill for (Picked unit): Custom - 5
                    Else - Actions
                        Do nothing
                -------- Draculs SpellBook --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Spell_SpellBook_Dracula Greater than or equal to 1
                    Then - Actions
                        For each (Integer A) from 1 to Spell_SpellBook_Dracula, do (Actions)
                            Loop - Actions
                                Hero - Learn skill for (Picked unit): Custom - 2
                    Else - Actions
                        Do nothing
                -------- Fear of the Dark --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Spell_Fear_of_the_Dark_Dracula Greater than or equal to 1
                    Then - Actions
                        For each (Integer A) from 1 to Spell_Fear_of_the_Dark_Dracula, do (Actions)
                            Loop - Actions
                                Hero - Learn skill for (Picked unit): Custom - 4
                    Else - Actions
                        Do nothing
                -------- Devour Magic --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Spell_DevourMagic_Dracula Greater than or equal to 1
                    Then - Actions
                        For each (Integer A) from 1 to Spell_DevourMagic_Dracula, do (Actions)
                            Loop - Actions
                                Hero - Learn skill for (Picked unit): Custom - 3
                    Else - Actions
                        Do nothing
                -------- Vampiric Attack --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Spell_VampiricAttack_Dracula Greater than or equal to 1
                    Then - Actions
                        For each (Integer A) from 1 to Spell_VampiricAttack_Dracula, do (Actions)
                            Loop - Actions
                                Hero - Learn skill for (Picked unit): Custom - 1
                    Else - Actions
                        Do nothing
                Trigger - Turn on Dracula learns <gen>
                -------- ReTrain Stats --------
                Hero - Modify Agility of (Picked unit): Set to (DraculasAgiStrInt[1] + 5)
                Hero - Modify Strength of (Picked unit): Set to (DraculasAgiStrInt[2] + 5)
                Hero - Modify Intelligence of (Picked unit): Set to (DraculasAgiStrInt[3] + 0)
                -------- Set Life and Mana --------
                Unit - Set life of (Picked unit) to HpandMp_Dracula[1]%
                Unit - Set mana of (Picked unit) to HpandMp_Dracula[2]%
                Selection - Add (Picked unit) to selection for Player 1 (Red)
                Camera - Lock camera target for Player 1 (Red) to (Picked unit), offset by (0.00, 0.00) using Default rotation

and changed some in the TriggerData.txt and WorldEditStrings.txt
(cus i used custom spells)
There could be another way, however this is my way to solve the problem I relearn all spells, stats and hp/mp to the compared with the previous form and the skills previously learned works pretty well.
09-12-2003, 10:59 AM#4
Brugsy
Can you please include a demo map....

that would be a big help, thanks


Brugsy
09-12-2003, 02:43 PM#5
HyperNox
I'm a lazy person that doesn't like doing demo maps however you can check my Dracula map out it is unfinished so you please don't play it online. You and anyone else can pick any idea from my map as long as you don't "steal" the whole concept and just changes the creator name or releasing it unfinished in any way. But I hardly think anyone here would do that people that is registerd here usually like to work on their own maps and not ripoff someone elses map (even tho this map is kind a wannabe the map dracula that already is played on internet the big diffrent is that this is nicer and has more of a story and is better written when it comes to triggers. The dracula that you can play on the internet is laggy in the latest ver. that is one of the reasons Im doing this map) anyway here is my unfinished map unprotected of course. If anyone want to help me with the map please PM me
09-12-2003, 05:33 PM#6
Brugsy
Thanks for the help, your map will stay safe :)