HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help wanted: Calculations in JASS format.

12-14-2008, 06:58 PM#1
bowzerbro
Notes: Suggestions to the bellow would be helpful, these are only plans at the moment.

I'll start with the JASS question:
Part of my gold gain JASS. How do I implement the above calculations for gold gain in the bellow JASS code?
Collapse JASS:
function Trig_Obtain_Gold_Actions takes nothing returns nothing
    if ( Trig_Obtain_Gold_Func001C() ) then
        call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I000'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I000')) + 1 ) )
    else
        call UnitAddItemToSlotById(GetManipulatingUnit(), 'I000', 5)
    endif
endfunction
I'll probably know how to do the rest once I know how to do the above.
However, how to include items in calculations would be helpful too.



Bellow is my current stat balancing:
Power(STR):
Increase carry weight by 50 per point.
Increase mining speed by 0.5% per point.
Increase chance of accidents accuring by 0.25%
Increase stamina by 1 per point.
Stat requirement used for various items.

Efficiency(AGI):
Increase gold gained.
1+floor(1*EFF/5)
Increase movement speed.
150+(150*EFF/100)
Increase HP regeneration rate when resting.
1HP+floor(1HP*EFF/10)
Increase stamina loss by 0.5% per point.
Increase stamina by 1 per point.
Stat requirement used for various items.

Skill(INT):
Increase chance of getting gold.
(50+(50*EFF/150))/1000
Add a chance per hit to double chance of getting gold.
(50+(50*EFF/200))/1000
Decrease chance of accidents accuring 0.25%
Decrease stamina loss by 1% per 10 points.
Stat requirement used for various items.

Gold:
Weight 2.5, value 5 per unit.

Pickaxe upgrades: 1/3/8/12/18/28/40/60/78/100 POW
Lower damage to rock, for longer mining. 1 less damage per level. Initial damage is 15.
Slightly higher gold extracted.
- Gold gain * 1.05, increase 5%(0.05) per item level.
Lower chance of accidents. 2% per level.
Weight more than previous one.
Weight: Initial 30, 30 more per level.

Hard Hat and upgrades. Same as Pickaxe but EFF
Lower damage taken from accidents and rock bulders falling.
- 5% less damage per item upgrade.
Doesn't weigh a lot.
Increase chance of finding gold slightly.
- CHANCE + 0.25% per item lvl.
Slightly increased sight radius. 2% per level.
Weight: Initial 10, 5 per level.

Working Gloves upgrades: Same as Pickaxe but SKL
Decrease stamina loss from being over weighted and working.
- Initially 10% increase 5% per level.
Increase mining speed by 1.5% per upgrade.
Doesn't weigh a lot.
Weight: Initial 5, 2.5 per level.

/Bowzerbro
12-14-2008, 10:28 PM#2
Monstah
You already have a code there, what is it that you don't know how to do?

What your script does, is to use charges of an item to represent the gold the unit is carrying, is that correct?
12-14-2008, 10:35 PM#3
Zerzax
He wants it optimized, but I have no idea what's going on :(

EDIT: You can probably cut out some of the BJ functions you use and replace them with regular function.
12-15-2008, 05:42 PM#4
bowzerbro
Update
I've updated to some triggers and changed inventory system and a few things. Anyway I'm stuck at attack speed from stat points. I've go no idea how to make STR give attack speed, and how to make it increase 1.25% attack speed per point instead of 2%. I can not find SetUnitMoveSpeed attack speed equivalent for jass. :|

Old post 1
Well I'm not familiar with JASS, well very very slightly :p Since I converted some and added some script I was given. The code posted is without calculations and is 99% converted original map editor triggers.
Gold gained goes up with stats and gear, I don't know how to code those things in jass. But will attempt again once I've got stat adding to work, don't want simple for each level skill adding. I've tried using spells but failed. Will post the scripts in a bit, first I have to cook.

I've messed up the trigger however...
Note: Not sure how to add skills that do nothing just to use them as "stat adders"
What I made:
1. Made a trigger that reacts once the Miner gains a level, as following:
a. Hide miner and create a "level up unit" which lets you add stats by using the skills it has. The used skill in terms has a trigger adding the stat point.
b. Bugged the whole thing since copies of spells have the same ID and using one of them adds all stats.. I think :p
c. Tried using items, but this worked even worse and I do not like using inventory for adding stat points. At least not when I am only using 3.
2. For when all stats were added I used another trigger.
a. When a var with custom value 3 has gone down to 0 (after using skill) the level up unit is removed and the miner unit can be controlled again.
b. This works... above doesn't :p
What I rather use and some questions:
1. Some sort of active adding of stats, I've not been able to find any system for stats on the forum. Just some inventory systems. I need no inventory system just stat-system that works.
2. I've got no idea how to add spells with custom IDs, however I'll search for that now! :P


... Can't find anything, everything in graveyard or something? I remember I used to find everything I needed here, now searches come up with other peoples questions or maps :(