| 11-17-2005, 03:25 PM | #1 |
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 |
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 |
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 |
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 - Actionsok 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 |
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))) |
| 11-17-2005, 10:01 PM | #6 |
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 |
| 11-18-2005, 01:48 AM | #7 | |
Quote:
|
| 11-18-2005, 09:33 AM | #8 |
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 | |
Quote:
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 |
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 |
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 |
| 11-19-2005, 07:26 PM | #12 |
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 |
You would need to right-click the tree each time to gain skill... |
| 11-19-2005, 08:34 PM | #14 |
Yeah I know that. You need to click in Ultima everytime you wanna chop a tree too. (unless you're using a macro) |
