Experience Points/Leveling up?

Experience Points/Leveling up?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
techprophet
Posts: 6
Joined: 16 Jun 2008, 19:42

Experience Points/Leveling up?

Post 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!)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Experience Points/Leveling up?

Post 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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Experience Points/Leveling up?

Post 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.
techprophet
Posts: 6
Joined: 16 Jun 2008, 19:42

Re: Experience Points/Leveling up?

Post by techprophet »

The various stats would influence damage, range, move/fire speed, and a couple of other things.

Thanks for the tips.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: Experience Points/Leveling up?

Post 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.
Last edited by Zpock on 17 Jun 2008, 20:08, edited 1 time in total.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Experience Points/Leveling up?

Post 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.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: Experience Points/Leveling up?

Post 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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Experience Points/Leveling up?

Post 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).
techprophet
Posts: 6
Joined: 16 Jun 2008, 19:42

Re: Experience Points/Leveling up?

Post by techprophet »

is there a way to modify the damage value directly? Like dmg = dmg*2 ?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Experience Points/Leveling up?

Post by rattle »

Uh HitByWeaponId (cob) had a damage parameter I think
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Experience Points/Leveling up?

Post by KDR_11k »

The receiving unit can modify it in HitByWeaponID but for attacker-side boosts I wouldn't use that.
Post Reply

Return to “Game Development”