Jump to content
pognivet

Make player freeze to death (take damage) when not wearing uniform

Recommended Posts

Hello

 

I'm making a mission set in the arctic that is modeled on Metal Gear Solid 1. It's not really a strict interpretation of it by rather inspired by its setting and story.

 

A central aspect of this mission is the fact that there's several compounds of buildings that are very urban separated by miles of frozen wasteland. I want the environment outside of structures to feel very hostile.

 

I want to add in a basic hypothermia system whereby not wearing a uniform while outdoors makes you slowly freeze to death. I'd also like it so that if you're in the freezing ocean you also start to freeze or get hypothermia unless wearing a wetsuit.

 

If possible I'd like to tie it in with ACE medical somehow. Ideally there also should be some way to treat the hypothermia once it has already begun to happen to you.

 

What is the easiest way to accomplish this with scripting?

Share this post


Link to post
Share on other sites

Uniform command is a good start. If it returns an empty string, then player is in his crusties.

You might want to have weather influence his health too. If there is rain or wind, the health effect should be even worse.

Share this post


Link to post
Share on other sites

You could utilize

 

Which calculate air and sea temperature, can tell pretty accurate if a unit is in shadow and all kinds of useful stuff. Can't recommend this enough.

 

Also don't use setDamage for that sort of thing, but make the player aware of his cold/warmth state either through hints/text pop ups and/or sounds.

You could also use setAnimSpeedCoef to slow a player down once he's cold enough.

After your evaluated hypothermia value reaches a certain threshold simply setdamage 1 to the player.

 

Also: Loops.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
On 7/15/2017 at 6:46 AM, pognivet said:

I want to add in a basic hypothermia system whereby not wearing a uniform while outdoors makes you slowly freeze to death.

 

Hello, here's my suggestion

private _trg = createTrigger ["EmptyDetector", [0, 0, 0], false];
_trg setTriggerStatements [
		"uniform player isEqualTo ''",
		"thisTrigger spawn {while {triggerActivated _this} do {player setDammage getDammage player + 0.3; sleep 3}}",
		""
]

I hope this helps

Share this post


Link to post
Share on other sites
On 7/14/2017 at 11:01 PM, Tankbuster said:

Uniform command is a good start. If it returns an empty string, then player is in his crusties.

You might want to have weather influence his health too. If there is rain or wind, the health effect should be even worse.

I like the way you think.

 

On 7/19/2017 at 2:59 AM, Nikander said:

 

Hello, here's my suggestion


private _trg = createTrigger ["EmptyDetector", [0, 0, 0], false];
_trg setTriggerStatements [
		"uniform player isEqualTo ''",
		"thisTrigger spawn {while {triggerActivated _this} do {player setDammage getDammage player + 0.3; sleep 3}}",
		""
]

I hope this helps

Thanks. This is a good simple solution that I can use in a lot of missions. I might tweak it a bit to give you some time before you start taking damage. For this mission in particular however I kind of want to take it to the next level.

 

On 7/15/2017 at 0:27 AM, Grumpy Old Man said:

You could utilize

 

Which calculate air and sea temperature, can tell pretty accurate if a unit is in shadow and all kinds of useful stuff. Can't recommend this enough.

 

Also don't use setDamage for that sort of thing, but make the player aware of his cold/warmth state either through hints/text pop ups and/or sounds.

You could also use setAnimSpeedCoef to slow a player down once he's cold enough.

After your evaluated hypothermia value reaches a certain threshold simply setdamage 1 to the player.

 

Also: Loops.

 

Cheers

That's pretty neat. I'm trying to dump as much work into this mission as possible to make you consider your actions. I want to make it very unique with a lot of depth where even though you're just one or a few men alone you're constantly thinking. As much as is possible in the Arma engine using rock objects I already made an underground cave area with a roadway (Like the Space Center in Independence, Missouri) that has offices and parking. I hope to eventually have things like the ability to poison guard dogs with shellfish toxin and using keycards to open blast doors.

 

I'm not very good at scripting. I can accomplish the most basic things (usually in the most weird, indirect and inefficient way possible), but I've never used third party functions.

 

Do you think you could write a small example script that I can build off of? Just something simple taking into account air/sea temperature and shadow and slowing him down and what not. Maybe try to use as many functions as possible in it so I have some good practical samples to mess around with.

 

And do you think it would be possible to allow such conditions to exist on many simultaneous AI? Maybe it would lag too much having scripts constantly checking temperatures of people's bodies, but it would be interesting to be able to do Space Station 13/Dwarf Fortress style things such as knock someone unconscious, strip them of their clothes and leave them handcuffed in the snow to die without having to shoot them.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×