ZnasVecKo wrote:
pasik wrote:
ZnasVecKo wrote:
I have several questions about certain possibilities in modding:
1. Is it possible to make several secondary weapons usable?
2. Is it possible to make several hand grenade items usable?
3. Is it possible to make a weapon with an arcing projectile?
4. Can you please make projectile speed and travel distance separate?
1. If I recall correctly, I had a pistol made as secondary weapon once, I was able to pick it up instead of LAW. I'm not sure how well it all works (anymore), secondary weapon support has been largely tested only with one collectable single-use weapon.
2. No, not yet.
3. The projectile has a variable called pulldown_in_air. Note, the soldier doesn't take it into account when shooting currently, so he isn't trying to compensate for it by shooting partially upwards to reach the target he shoots at.
4. I may be missing something here, but there's no such thing as travel distance tracking in RWR. Currently everything is based on time, you can set the time to live for a projectile and you can set the initial speed. Use t=s/v to determine time from distance and speed
I believe there's a chance this
viewtopic.php?f=7&t=1008 might have the calculation built in.
1,2. Aww...
I was hoping I could make these.
3. I'll try to make something that works using that. Thanks!
4. How do I get S? There is no way to determine S directly. It just baffles me because I once made a rifle with speed 10 projectiles and complete accuracy (accuracy=1,spread_range=0) and after a few seconds, without hitting anything, the bullets disappeared.
Also, how does the grenade falling work?
4. t=s/v <=> s=tv. You can set the time_to_live in a projectile, it is 3.0 seconds if you leave it undefined. The vanilla bullets use 1 second.
In other words, if you want to set a projectile to travel max 100m (after which it either vanishes or explodes depending on its result), and you want it to leave the barrel with 200m/s speed, you set the projectile_speed="200.0" in the weapon specification, and resolve time with t=s/v, t=100m / 200m/s = 0.5s, and set time_to_live="0.5" in the projectile tag.
Or another example, if you want your projectile extra slow like with 10.0m/s setting but be able to travel 100m, you can set t = 100m / 10m/s = 10s.
Pull down in air, i.e. "gravity", is 10 by default, vanilla bullets use 4. For a slow projectile you may need to make it smaller so that it won't drop too fast to the ground. Like said, pull down factor isn't taken into account when shot currently, so the soldier doesn't compensate for it by shooting upwards to shoot in a curve.
Grenade throwing is hardcoded in throw logic. It's currently using all sorts of control variables like a throw distance limit to consider throwing in a curve or just directly to target, throwing speed for the curved throw and direct throw, target max height for the curve middle point to get the direction and magnitude for the throw, max throw speed to cap it, final randomization, and a few helper factors that just seem to help it all function better.
I will expose these once the game needs to support multiple throwables, and it will.