Jump to content


Photo

Choking Gas


20 replies to this topic

#1 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted 12 August 2017 - 06:49 AM

Regarding the water GUI: do you know how difficult it would be to only have the breath bar appearing without the player being under water? I am thinking about some kind of "choking gas", so the player cannot breathe, but without the player being able to swim around. Do you know if something like this has alredy been done? If not, I will look for myself how I can achieve this.

#2 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36408 posts

Posted 12 August 2017 - 07:55 AM

Regarding the water GUI: do you know how difficult it would be to only have the breath bar appearing without the player being under water? I am thinking about some kind of "choking gas", so the player cannot breathe, but without the player being able to swim around. Do you know if something like this has alredy been done? If not, I will look for myself how I can achieve this.

 

I had thought about something like that, but never got around to experimenting with it. 



#3 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted 12 August 2017 - 01:25 PM

Ok, I will have a look at it myself, as soon as I have access to my PC again.

#4 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5151 posts

Posted 12 August 2017 - 01:54 PM

Regarding the water GUI: do you know how difficult it would be to only have the breath bar appearing without the player being under water? I am thinking about some kind of "choking gas", so the player cannot breathe, but without the player being able to swim around. Do you know if something like this has alredy been done? If not, I will look for myself how I can achieve this.

Try applying "damage_noair" to the player.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#5 Dragofer

Dragofer

    Modeler

  • Member
  • PipPip
  • 462 posts

Posted 12 August 2017 - 02:11 PM

Maybe you can tweak the entity def for liquid_water? The swimmable property seems to be linked to the top surface of the brush being water, while the breath limit and overlay seems to come from being inside a liquid_water entity.

#6 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted 22 August 2017 - 02:36 AM

I am finally coming back to this. My first thought also was to base this on the liquid_water def. However, after searching the def files I have hit a wall pretty quick. I could not determine the source of the swimmable property. The liquid definitions are not very extensive and the spawnargs I thought might influence movement (i.e. density and viscosity) have no effect on the ability to swim itself. I used a "nodraw" surface on all sides, so this also seems not to influence the ability to swim.

 

Try applying "damage_noair" to the player.

How would I do that most easily? I tried to set up an entity with a S/R, but this did not work. I created a custom Stim and put it on an func_static:

"sr_class_5" "S"
"sr_magintude_5" "10"
"sr_type_5" "1000"
"sr_state_5" "1"
"sr_radius_5" "80"

and added the corresponding response to the player def:

// Choking Damage
    "sr_class_5"                    "R"
    "sr_type_5"                        "1000"
    "sr_state_5"                    "1"
    "sr_effect_5_1"                "effect_damage"
    "sr_effect_5_1_arg1"            "_SELF"
    "sr_effect_5_1_arg2"            "atdm:damage_noair"

But when I get near the func_static in game, nothing happens. Now, the only other thing I could think of would be a script that gets called, when the player gets inside a radius around the func_static, but I have no idea how to set that up...



#7 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5151 posts

Posted 22 August 2017 - 02:42 AM

It's "damage_noair", not "atdm:damage_noair" (inconsistent, I know).


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted 22 August 2017 - 02:58 AM

I changed it, but it had no effect :(



#9 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5151 posts

Posted 22 August 2017 - 03:10 AM

I'm not sure whether you need the magnitude on the stim, but you should probably set the stim interval (sr_time_interval_5) in ms.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#10 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted 22 August 2017 - 06:11 AM

I added an interval of 200 ms, still no effect. I alos tried to set up a frob response with the effect "damage" with the arguments "target" "player0" and "damage def" "damage_noair". This also did nothing.

Additionally, I tried to make a script with a damage script event, but TDM complains that it does not know "damage_noair".



#11 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5214 posts

Posted 22 August 2017 - 07:49 AM

My first intuition is I'd make a tiny water func_stat and attach it somewhere on the player that they can't see but makes the game think the player is underwater. Then you can just use trigger brushes or the location system scripts or whatever to manipulate that object to take the player in and out of that state as needed.

 

If that didn't work, then I'd go to the sourcecode for the underwater player state to get clear about what's really happening. I recall seeing the no-air stim (or whatever it was) and thinking about something like a puzzle involving a vacuum, but that was a long time ago.


Posted Image

#12 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 727 posts

Posted 17 September 2017 - 06:26 PM

I wonder whether any of D3's vacuum handling remains usable. There are commented-out defs for info_vacuum and info_vacuumSeparator in d3_junk.def.


Some things I'm repeatedly thinking about...

- louder scream when you're dying


#13 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted 18 September 2017 - 01:48 AM

Great find! The info_vacuum is exacly what I was searching for. Unfortunately I could not get the info_vacuumSeparator to work yet. But I did not have much time for testing. So far it was a simple big visportal with the separator touching it. Maybe the visportal has to close or something like that. I will do further testing this week.



#14 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted 19 September 2017 - 01:02 AM

I tested the vacuum entities and unfotunately, they do not do, what I want them to do. The main problem is to contain the vacuum flooding. If the vacuum is surrounded by any one non-solid brush, it will flood the whole area. The only exception is, if it has a visportal in combination with a door. In this case, the area is under vacuum as long as you open the door and not under vacuum, as long as the door is closed. The info_vacuumSeparator will remove the door/visportals ability to contain the vacuum, but is not able to reinstate it. So the intended use appears to have been for airlocks with the info_vacuumSeparator being used if a window/door is broken, which could not be repaired and as a consequence it was not necessary to reverse the containing ability.

 

EDIT: I had some success by using a non-solid door and a func_portal to create a room that is full of vacuum and does not fill the whole room. The non-solid door with a nodraw texture tricks the enginge to think that there is a barrier between the vacuum and the rest of the room. The func_portal is necessary to manually open the visportal, so the inside of the evacuated room is actually rendered.

This works on a basic level, but if I try to create an open space I issues with the visportals opening and closing, even though I try to force them open with a func_portal. As a consequence, it may be possible to fill rooms with vacuum, but it is not possible to create a smaller room (like an area of heavy smoke in a room) that has the vacuum in it. I will try demagogues suggestion next, but not with a water entity around the player, but rather teleporting the vacuum entity in and out with the location system.


Edited by Destined, 19 September 2017 - 01:47 AM.

  • VanishedOne likes this

#15 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted Yesterday, 12:56 AM

I have now set up the whole thing with the location system, but get the following error as soon as I enter the location that should move the info_vacuum entity to the player location:

"script\tdm_location_settings.script(495): Thread 'atdm_location_settings_1': Function 'VacuumOn' has the wrong number of parameters for 'callGlobalFunction' "

The Script I used looks like this:

vector VacuumStart;

void main()
{
	VacuumStart = $info_vacuum_1.getOrigin();
}

void VacuumOn()
{
	$info_vacuum_1.setOrigin($player1.getOrigin());
	sys.println("Vacuum is on"+VacuumStart);
}

void VacuumOff()
{
	$info_vacuum_1.setOrigin(VacuumStart);
	sys.println("Vacuum is off");
}

Can anyone tell me, which number of parameters is meant? I was so sure that the script should work this time :(

 

EDIT: I could run the script via a S/R setup, so the error has to be somewhere in my location setup. Unfortunately, teleporting the info_vacuum entity does not activate the vacuum. I assume that an area is flooded with vacuum at map start and after that the vacuum can only be propagated by opening visportal that separated it before. Unless there is a way to repeat the "flood with vacuum" process.


Edited by Destined, Yesterday, 01:05 AM.


#16 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5151 posts

Posted Yesterday, 01:51 AM

If you are calling the function from the location entities (via call_on_entry for example), the location name is passed as an argument. So the functions should look like

void VacuumOn(entity location)
{
...
}

How you name the parameter is your choice.

 

Also note that the info_vacuum entity won't move with the player just by teleporting it to his location. It will stay were it is afterwards.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#17 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted Yesterday, 03:07 AM

Ah, thanks! Is there a general rule, when you have to specify the entity from which the function is called? In most other cases I did not have to put anything into the brackets.

 

I know that the info_vacuum does not move with the player (unless I would bind to the player head, if this is possible). If I remember correctly that was also a problem for Sotha's version of the ambient light (no idea how this was called), which is why he used a cirlcing script that moves the light to the location of the player's head every couple of seconds. But I digress. The problem I encountered was, that moving the info_vacuum entity does not fill the room with a vacuum. I assume it works similar to AAS flooding, so it is determined at map start, which areas are under vacuum. This is why I would have to somehow update that the area should be flooded with vacuum and I am not sure how to do that. As this is a remnant from Doom, the Wiki also has no documentation about it. Is there a general "reload info_entities"?



#18 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted Yesterday, 11:22 AM

I tried to search in some Doom Wikis and forums about how to update the vacuum status, but could find nothing, so I revisited Obsttorte's suggestion to use a damage stim. I wanted to recheck if I might have made any errors before and treid to set up a simple damage stim, which took me a while and was another indicator that I had another error before. After some time I finally could set up a custom S/R, that used "damage_noair", but had to find out that this does not "damage" the breath bar of the player, but damages the player while making drowning sounds. This leads me to the question: how can I reduce the breath bar of the player without using water? For the breath potion, there is a "heal_def" "air". However, replacing "damage_noair" with "air" for the damage type does nothing...



#19 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 727 posts

Posted Yesterday, 03:05 PM

I wonder whether there's a way of scripting around this. http://forums.thedar...243#entry374726 gives a way of accessing the player's breath level in a script via the GUI system. Maybe a script could use setGuiInt() to decrement the visible breath level, and start applying damage_noair once it's reached zero. Edit: it could run into trouble if e.g. breath potions are available, since you'd be manipulating the GUI rather than the 'real' breath level. But if there's no better way it might be worth a try.


Edited by VanishedOne, Yesterday, 03:11 PM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#20 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted Today, 01:38 AM

I found another workaround: I placed the info_vacuum inside a room with a door and used the location system to trigger the door. Thus, every time the player moves into the specified region, the door gets opened and the breath bar appears. As soon as the player leaves, the door is triggered again and the player can breathe again. The final problem I encountered is that at map start you hear a splashing sound (I think it is the "player gets out of water" sound) and every time the breath bar appears there is a watery splash sound (I think the "player gets submerged in water" sound). But in general it works. It would be so much easier of we had a "damage air" option. I mean, we have a "heal air" option. Hm, this gives me another idea. I maybe could use a "heal" stim with the heal type "air" and a negative value. However, in the S/R system I could not find a way to specify the healing type. I will look into that a bit more, but will have to leave for work right now.



#21 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1258 posts

Posted Today, 12:41 PM

I changed the breath potion to heal a negative value and it actually decreases the berath. Unfortunately, upon reaching zero, it does not start to lower health. Instead, the breath bar simply disappears. Does not seem to be the way to go...





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users