HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Better skills with practice

11-17-2005, 03:25 PM#1
Father_Chaos
I would like to do something like in Ultima Online - the more you do something, the better you become at it.

Would it be possible using real variables for the skills? For example a lumberjacking skill: when your hero harvests lumber from a tree he has a certain percent chance to increase the "SkillLumberjack" real variable, which at certain levels would make him harvest more at once...

Any trigger ideas for this project?
11-17-2005, 03:29 PM#2
HEZZA
use intergers, but first determain how many times a hero needs to attack/chop a tree in order for it to increase.

like e.g

Your hero attacks tree

set variable = IntergerTREE +1

and in a new trigger

Interger becomes equal to 50

add ability (new ability for the level he becomes)

if you understand me? :P
11-17-2005, 04:12 PM#3
Captain Griffen
For chances, have a random number (under maths), and then a real/integer comparison.

For increasing its effectiveness, you could increase the level of it.

You might have some complications with the lumberjack skill though...not sure how that fires.
11-17-2005, 06:34 PM#4
Thunder_Eye
I use this as my macefighting skill in my map (not exactly like UO but somewhere one the way)
Code:
Mace
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set tempInteger = (Player number of (Owner of (Attacking unit)))
        Set Chance_On_Hit = (Random integer number between 0 and 10)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Attacked unit)) Equal to Peasant
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Chance_On_Hit Less than or equal to SkillMace[tempInteger]
                    Then - Actions
                        Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 20.00 damage of attack type Normal and damage type Normal
                        Set Chance_On_Exp = (Random integer number between 0 and 10)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Chance_On_Exp Greater than or equal to SkillMace[tempInteger]
                            Then - Actions
                                Set SkillMace[tempInteger] = (SkillMace[tempInteger] + 1)
                                Game - Display to (All players matching ((Matching player) Equal to (Owner of (Attacking unit)))) the text: (Your Mace skill has increased by 1. It is now  + ((String(SkillMace[tempInteger])) + .))
                            Else - Actions
                                Do nothing
                    Else - Actions
                        Do nothing
            Else - Actions

ok this isnt my real trigger, just one of the test ones, this one is much bigger then the one im using, but I hope you atleast understand how it works.
11-17-2005, 06:56 PM#5
Father_Chaos
Thanks for the examples, but how can I make it work for lumberjacking? The only thing I thought of was:
Code:
Lumberjacking
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
        (Destructible-type of (Target destructible of issued order)) Equal to Summer Tree Wall
    Actions
        Set SkillLumberjack = (SkillLumberjack + 0.10)
        Game - Display to (All players matching ((Owner of (Ordered unit)) Equal to (Matching player))) the text: (|cff00aeefLumberjacking:  + (String(SkillLumberjack, 0, 1)))
But it does it only by ordering the unit. How can I make it so it fires the trigger when the hero hits the tree?
11-17-2005, 10:01 PM#6
Thunder_Eye
Either you could make the trees only have 1 hp meaning they die on one hit, then ressurect the tree again so you can use it again.
that way you should use "Destructible Dies"
else..
Else maybe you could use your trigger but add 2 variables
make the trigger something like this, not sure if it works.
Code:
Lumberjacking
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
        (Destructible-type of (Target destructible of issued order)) Equal to Summer Tree Wall
    Actions
        Set TreeLifeBefore = (Current life of (Target destructible of issued order))
        Wait 1.00 seconds
        Set TreeLifeAfter = (Current life of (Target destructible of issued order))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TreeLifeAfter Less than TreeLifeBefore
            Then - Actions
                Set SkillLumberjack = (SkillLumberjack + 0.10)
                Game - Display to (All players matching ((Owner of (Ordered unit)) Equal to (Matching player))) the text: (|cff00aeefLumberjacking:  + (String(SkillLumberjack, 0, 1)))
            Else - Actions
                Do nothing
you might have to change the wait for the timing.
11-18-2005, 01:48 AM#7
Father_Chaos
Quote:
Originally Posted by Thunder_Eye
Either you could make the trees only have 1 hp meaning they die on one hit, then ressurect the tree again so you can use it again.
that way you should use "Destructible Dies"
else..
Else maybe you could use your trigger but add 2 variables
make the trigger something like this, not sure if it works.
Code:
Lumberjacking
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
        (Destructible-type of (Target destructible of issued order)) Equal to Summer Tree Wall
    Actions
        Set TreeLifeBefore = (Current life of (Target destructible of issued order))
        Wait 1.00 seconds
        Set TreeLifeAfter = (Current life of (Target destructible of issued order))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TreeLifeAfter Less than TreeLifeBefore
            Then - Actions
                Set SkillLumberjack = (SkillLumberjack + 0.10)
                Game - Display to (All players matching ((Owner of (Ordered unit)) Equal to (Matching player))) the text: (|cff00aeefLumberjacking:  + (String(SkillLumberjack, 0, 1)))
            Else - Actions
                Do nothing
you might have to change the wait for the timing.
But what if the hero targets the tree from far away? The wait time would never be the same...
11-18-2005, 09:33 AM#8
Thunder_Eye
When you order unit, It saves the trees current health, and then after 1 sec It saves the current health again.
So if youve hit it I should probably have lesser health and If youre far away you wouldnt hurt it would you

just a question, how did you get that Lumberjacking + 0.10?
I cant make it 0.1 so how did you?
11-18-2005, 12:06 PM#9
Father_Chaos
Quote:
Originally Posted by Thunder_Eye
When you order unit, It saves the trees current health, and then after 1 sec It saves the current health again.
So if youve hit it I should probably have lesser health and If youre far away you wouldnt hurt it would you

just a question, how did you get that Lumberjacking + 0.10?
I cant make it 0.1 so how did you?
I just made "SkillLumberjack" a real variable. When displayed I made it a formatting trigger to show only [0.1, 0.2, 0.3...] instead of [0.100, 0.200, 0.300...].

And for the order trigger, what you say makes sense, but it would mean the hero would only gain skill by ordering when close to the tree... When it would target it from far, even if he hits the tree a thousand times, he would not get a gain...

The only way I see would be to be able to use "is attacked" trigger event, but I would need a tree unit ...
11-18-2005, 05:36 PM#10
Thunder_Eye
No, the unit gains skill when he hurt the tree, no matter if its melee or ranged damage as long as he damage it.
11-18-2005, 11:34 PM#11
Father_Chaos
For the second time I'm telling you it only works if the hero targets the tree each time and is near the tree. Look:
Code:
Lumberjacking
    Events
        Unit - A unit Is issued an order targeting an object
This means the trigger fires when you right-click a tree with the hero, NOT when he attacks it.
11-19-2005, 07:26 PM#12
Thunder_Eye
Yeah but the hero doesnt need to be near the tree for you to right click it. And the trigger doesnt check how far the hero is from the tree!! You could stand on the other side of the map and right-click the tree and still gain as long as you damage it.
11-19-2005, 08:22 PM#13
Father_Chaos
You would need to right-click the tree each time to gain skill...
11-19-2005, 08:34 PM#14
Thunder_Eye
Yeah I know that. You need to click in Ultima everytime you wanna chop a tree too. (unless you're using a macro)