Jump to content
The Dark Mod Forums

Choking Gas


Destined

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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...

Link to comment
Share on other sites

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

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

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"?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

I wonder whether there's a way of scripting around this. http://forums.thedarkmod.com/topic/9082-newbie-darkradiant-questions/page-243?do=findComment&comment=374726 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

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...