Modding Weapons...

This is the place for all questions related to modding Starshatter.
Post Reply
smaff
Posts: 34
Joined: Mon Apr 26, 2004 2:29 pm

Modding Weapons...

Post by smaff »

Don't recall seeing this here, so I thought I'd mention it, in case people are having issues with modding weapons - specifically low end beam lasers.

In the damage calculations there appears to be an integer conversion, or at least some form of clamp... in that:

For a weapon with: damage = 10, charge = 0.8, life = 0.2, you will see no damage at all. Even if you make damage = 8, charge = 1, you still see no damage.

However, if you change charge to 10, so that life * charge > 1, suddenly you get some actual damage!

What I suspect is that there's something like:
(int)true_charge=(int)(charge*life)
real_damage=(damage*true_charge*(length-actual_range))/length

Not sure if damage is a float or not (ie. whether damage =0 .5, charge = 20, life =0.2 would actually result in any damage). Systematic testing is not my forte, but I may get round to it.



--
"I've never met a piece of chocolate I didn't like.."
User avatar
wdboyd
Posts: 628
Joined: Tue Jun 14, 2005 9:52 pm
Location: Ohio U.S.A

RE: Modding Weapons...

Post by wdboyd »

The damage of a weapon is dictated by the charge and damage setting.

A charge:10 and a Damage:1 equates to 10 points of damage.

Note: The life setting dictates how far the weapon will travel or last for 1 second.

The speed of the weapon must then be considered. This setting dictates how far the weapon travels/exists in one second.

If the target is 10 seconds away in distance, based upon the speed of the weapon, and your weapons life is less than 10... there will be no hit. The beam will simply peter out.

If a target is close and the weapons life exceeds that distance, it may continue to damage the target continuously for the life of the shot, if a beam, doing it's charge X Damage  damage for that duration of time.

Of course the weapon may simply use up all of it capacitor charge and not be able to fire at all until it is recharged to the minimum charge setting for the weapon.

If you want limited damage weapons... simply ensure that the DAMAGE/Charge setting is low regardless of the weapons life setting. 1 point of damage over 10 seconds of target contact could still only inflict 10 points of damage. 

Don't over complicate all of this. [:-]

Remember Charge X Damage = damage
Life = how long the weapon can travel/exist in seconds
Speed = how far the weapon can travel in 1 second

Keep it simple. [:)]

"Time is a great teacher, but unfortunately it kills all its pupils!"
Post Reply

Return to “Starshatter Modding Forum”