project-navigation
Personal tools

Author Topic: Health values vs stun, smoke grenade  (Read 3561 times)

Offline kottis2

  • Cannon Fodder
  • **
  • Posts: 2
    • View Profile
Health values vs stun, smoke grenade
« on: July 01, 2013, 12:39:16 pm »
Hello everyone,
Actually I playing little bit with the script files to change weapon and armor states. My goal is to come to an more intensive combat feeling, i.e. longer fights, more shooting and so on (like Jagged Alliance 2 in the beginning of the campaign).  Additional I want only very few causalities (I like the RPG aspect UFOAI)
So what I did is to decrease all weapon/alien damage with a factor of 3-4 and same for the armor (alien + equipment) values.
So far its working quit nice, my guys can take ~ 3-4 hits, the aliens a little more. This results in longer fights with a more combat feeling. Additional my guys are quite often in the hospital , but not dead.
However I have two problems. First, there are several situations where it comes to 4 x phalax vs. 1 x alien. In the original game (i.e. w/o modding) this resulted normally in 1 causality for phalax (one or two hits with alien weapon) and one dead alien. With my modding, it results in 1 dead alien only (my soldiers get hit 3-4 times, has 30% health but can still fight).

So what I want is that my soilder get stunned (blacked out) when get hit multiple times and health is below a certain values (50% for example).
One simple way to do this, is to add a stun component to every weapon, however I am not sure if this is even possible, since every weapon has its own damage style yet.
So my question is: Is there a way to set the “get stunned/blacked out” health value using the script files? Are there other solutions to do this? How can I change the healing rate of the hospital? How can I deactivate bleeding (since a stunned soldier will be bleed to death)


A second point is the smoke grenade. Actually it is very powerful and more like a “press this button and the aliens have to use close combat only”. This results normally in a situation where all my guys sitting in a smoke cloud and one guy is spotting outside the cloud. If he sees an alien, all the guys in the cloud starts shooting (no RF from the alien since it can’t see my soldiers)  alien dead. Of course there are maps with much indoor environments, which results in less “smoke cloud sitting/sniping”.
So a solution could be: Change smoke form blocking total view into an accuracy penalty only. This would result in no more “smoke cloud sniping” for your soldiers, since you do not hit your target and the aliens will stop rushing to your cloud and start shooting into your cloud (with much less accuracy of course).

So two things to do for me: First disable total block of smoke and enable accuracy penalty. (the second is more important).
Can I do this with the script files? If not, where have I to look for it in the source code?

Thanks for your answers.
Kottis2

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Health values vs stun, smoke grenade
« Reply #1 on: July 01, 2013, 01:55:14 pm »
No, I think you've come to the limit of what can be done with script files at the moment. The following things can not be changed, as far as I know, in the script files:

- Stun threshold
- Bleeding damage
- Hospital heal rate
- Smoke visibility (the game has no partial visibility at all, btw)
- Smoke accuracy penalty

Regarding smoke, we do hope to implement some drawbacks to its use. I don't think there are any specific plans to reduce accuracy, but it is probably going to be considered at some point.

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: Health values vs stun, smoke grenade
« Reply #2 on: July 01, 2013, 04:46:31 pm »
Ok, here it goes, you can script the following:
Hospital healing rate: campaign.ufo, look for the 'healingrate' property in the campaign definitions.
Bleeding rate: team_templates.ufo, look for the body templates (at the bottom) there's a 'bleed' property (per body part)

As for the rest:
I considered adding stun damage to weapons in general when I was implementing the wounds system, but decided against it, but I left a very basic implementation disabled in the code, look in src/game/g_health.cpp lines 74 - 76, you can enable it if you want, as it is, it'll cause random stun damage (up to 25% of the 'standard' damage received) for every hit.
Finally, altering the smoke mechanics the way you want is not possible without overhauling the whole thing, but if you are determined to do it, just say so, and I should be able to point you to where the current mechanics are in the code.

Offline kottis2

  • Cannon Fodder
  • **
  • Posts: 2
    • View Profile
Re: Health values vs stun, smoke grenade
« Reply #3 on: July 02, 2013, 07:28:40 pm »
Ok, thanks so far. I will play a litte with the code, maybe I come to something interessting.