Page 1 of 1
Experience Points/Leveling up?
Posted: 16 Jun 2008, 19:46
by techprophet
Hello, I was thinking about writing a mod for Spring, but I wanted to check something first. I know that I can have 'experience' for units. But can I have 5 different experience bars (Level,Strength,Agility,Dexterity,Intelligence) that go up independently? Would I implement it using Lua or BOS/COB files?
Thanks! (Spring is awesome, keep up the work!)
Re: Experience Points/Leveling up?
Posted: 16 Jun 2008, 20:08
by smoth
yes, I would recommend looking at the healthbars widget for some idea on how to do the bars. As far as the individual stats you can do that in lua yes.
Re: Experience Points/Leveling up?
Posted: 16 Jun 2008, 20:38
by KDR_11k
I'd say use mostly Lua but depending on what you want those stats to mean you'll probably need COB too.
Re: Experience Points/Leveling up?
Posted: 17 Jun 2008, 01:41
by techprophet
The various stats would influence damage, range, move/fire speed, and a couple of other things.
Thanks for the tips.
Re: Experience Points/Leveling up?
Posted: 17 Jun 2008, 15:39
by Zpock
Edit: this is incorrect
Unless things changed alot that I'm not aware of as usual you will have a bit of a problem there. Spring is built in a way that assumes everything about weapons stays constant. So unfortunately you can't just say "I want this unit here to now do 10% more damage", or "have 50% more range" in LUA.
Re: Experience Points/Leveling up?
Posted: 17 Jun 2008, 16:42
by KDR_11k
You can add damage by using Lua in UnitDamaged to add the difference (or boost the health to reduce damage), you can change the range and rate of fire with SetUnitWeaponState I think.
Re: Experience Points/Leveling up?
Posted: 17 Jun 2008, 19:52
by Zpock
Oh nice, just the thing I have been waiting for, this is from the wiki:
Spring.SetUnitWeaponState
( number unitID, number weaponNum, table states ) -> nil
format of the states table:
{
["reloadstate" = number value,]
["reloadtime" = number value,]
["accuracy" = number value,]
["sprayangle" = number value,]
["range" = number value,]
["projectilespeed" = number value,]
}
I wonder if those are the only variables that can be changed or just examples? I hope you can change everything, even the type of weapon, that would make switching around what weapons a unit has feasible. Directly changing the weapons would be useful too tough.
Re: Experience Points/Leveling up?
Posted: 17 Jun 2008, 20:56
by KDR_11k
Those are the only ones because they happened to be stored locally in the weapon object instead of pulled from the def every time. Changing its type is definitely not feasible as you'd have to delete the weapon and create a new one for that (different class).
Re: Experience Points/Leveling up?
Posted: 17 Jun 2008, 21:33
by techprophet
is there a way to modify the damage value directly? Like dmg = dmg*2 ?
Re: Experience Points/Leveling up?
Posted: 18 Jun 2008, 01:03
by rattle
Uh HitByWeaponId (cob) had a damage parameter I think
Re: Experience Points/Leveling up?
Posted: 18 Jun 2008, 01:48
by KDR_11k
The receiving unit can modify it in HitByWeaponID but for attacker-side boosts I wouldn't use that.