Jump to content
The Dark Mod Forums

Project: Extinguish small lights with a blow


snatcher

Recommended Posts

1 hour ago, wesp5 said:

I did add a line to ignition functions, but this only works on lamps that can be turned off and on, so it's not really needed as I will keep them frobable anyway. Normal oil lamps need a fire stim to be relit though and I haven't dared yet to change anything there because the stim code looks even more difficult than the normal one ;)! It's in tdm_light_holders.script, no?

When an oilflame is exposed to a fire stim it calls a script function "response_ignite" of its light_ext scriptobject, which in turn calls the function "LightsOn" of the tdm_light_holder scriptobject on any light holder it's attached to. That's where you would add the line setFrobable(1) to make them frobable again.

Link to comment
Share on other sites

2 hours ago, Dragofer said:

That's where you would add the line setFrobable(1) to make them frobable again.

I tried the following, but it does not work. Is this the wrong position in tdm_light_holder?

void tdm_light_holder::LightsToggle()
{
    if (m_bExtinguished)
    {
        // turn on
        //sys.println(sys.getTime() + ": DEBUG (holder::LightsToggle): on " + getKey("name") + " calling LightsOn()");
        LightsOn();
        setFrobable(1);    // added by wesp
    } else
    {
        // turn off
        //sys.println(sys.getTime() + ": DEBUG (holder::LightsToggle): off " + getKey("name") + " calling LightsOff()");
        LightsOff();
        setFrobable(0);    // added by wesp
    }
}

 

Link to comment
Share on other sites

@wesp5Your code would only work if the entity that got extinguished is the one that got frobbed, I assume. In case of torches and candles and alike this won't work. Check the code for how attached light entities are handled and try to mimic that.

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

Thanks, I think I found the right line now :)! Also while testing this in the training mission I added a flint and all the other common tools there. Dragofer, if you plan to update the mission in the core game because of the chest typo, it might make sense to use my updated version. I can send it to you!

Link to comment
Share on other sites

44 minutes ago, wesp5 said:

Thanks, I think I found the right line now :)! Also while testing this in the training mission I added a flint and all the other common tools there. Dragofer, if you plan to update the mission in the core game because of the chest typo, it might make sense to use my updated version. I can send it to you!

Thanks for the offer, but you would also need explanations and training scenarios for these tools, just like for the other mechanics. You didn't mention doing that, so I assume that you just added the entities to the map.

Your code example is from the LightsToggle function, but what was meant is the LightsOn function, since this is what gets called by a fire stim. I suppose that's the function you added the line to now.

Link to comment
Share on other sites

11 hours ago, Dragofer said:

Thanks for the offer, but you would also need explanations and training scenarios for these tools, just like for the other mechanics. You didn't mention doing that, so I assume that you just added the entities to the map.

In the Objects & Handling section where the player tools are displayed, there is no additional info to any of them. Maybe in some other areas of the training mission, but right there the inventory names of the tools are all we get.

Speaking of which, would it be possible to display the long descriptions from the shop menu when we highlight a player tool on the big inventory screen? This way players could always take a look to remember what tool does what.

P.S.: I just took a look at "The Bakery Job", because I know that it includes oil lamps that can not be extinguished and I wanted to learn the reason. I found that they were hand made, but some had "canBeBlownOut" set. What is this?

Edited by wesp5
Link to comment
Share on other sites

P.P.S.: I just took a look at other missions and it still isn't clear to me what "canBeBlownOut" means, because light sources that have this set to 1 often can't be extinguished by frobing. Is this some leftover of a feature like snatches proposes?

Edited by wesp5
Link to comment
Share on other sites

@wesp5, our universes shall collide someday. In the meantime, keep up the good work 😉

----------------------------------------------------------

Strictly sticking to the sample I shared a few posts back... can I detect the moment a nearby flame has been extinguished?

I am thinking... if players perform a blow on large flames (torches, fireplaces...) and this large flame gets extinguished... ok you get away with it but you also get a penalty in the form of big health hit, to the point of death. Because, you know, that's what happens when you put meat in the grill 😄

TDM Modpack 4.0

Link to comment
Share on other sites

On 7/15/2022 at 8:26 AM, wesp5 said:

Speaking of which, would it be possible to display the long descriptions from the shop menu when we highlight a player tool on the big inventory screen? This way players could always take a look to remember what tool does what.

Yeah, try looking at how popup tooltips were done for main menu settings. Shop item descriptions are found after #str_02256 in strings/english.lang

canBeBlownOut seems to exist to stop flames from being extinguished by fire arrow blasts.

Link to comment
Share on other sites

2 hours ago, Dragofer said:

Yeah, try looking at how popup tooltips were done for main menu settings. Shop item descriptions are found after #str_02256 in strings/english.lang

canBeBlownOut seems to exist to stop flames from being extinguished by fire arrow blasts.

About the popups, I will take a look. About canBeBlownOut, thanks for the explanation, now it makes sense!

Link to comment
Share on other sites

3 hours ago, snatcher said:

Strictly sticking to the sample I shared a few posts back... can I detect the moment a nearby flame has been extinguished?

I don't know about your blow idea, but Obsttorte and Dragofer helped me find a way to detect if a light source has been lit or extinguished via frobing so I fixed the original issue you had with my solution. Download the latest UP 1.6 and check tdm_light_holders.script to see how it is done (I marked all changes with my alias), maybe you can use that somehow too...

Edited by wesp5
Link to comment
Share on other sites

I will check your results @wesp5, thanks for your work!

Meanwhile...

Here is a more polished version of the "Blow" demo (you need to login to get the download).

What's new in Blow_Ignite_v0.2.zip ?

  • Everything is (or should be) standalone and we can further toy with the files without breaking anything else.
  • I now refer to the Blow and the Tinder as skills or abilities and therefore the tinder has been renamed to "Ignite".
  • Both the Blow and the Ignite skills will be added automatically to your inventory as soon as a mission start. No need to spawn anything via console. This should work right out of the box in most (all?) missions.
  • Blow and Ignite come with brand new "Flashy" icons. I want these icons to be seen as abilities and stand out from other items. Current icons are by no means final, though.
  • The two skills don't work under water (I would like to get at some point the red background on key press but this is secondary).
  • Added a couple of extra "Blow Sounds" for variety.

How to use:

  • Add download contents to your TDM (I recommend using a Mod Enabler)
  • Launch any mission and love it or hate it (feedback is welcome)

Remember: this is a demo to get a feel of the idea and currently you can extinguish any flame, large or small, with no penalties. I really need the gurus to step in and push us in the right direction to figure something out.

Cheers!

Blow_Ignite_v0.2.zip

Edited by snatcher

TDM Modpack 4.0

Link to comment
Share on other sites

I am making some progress.

I managed to detect whether entities with below attachments are nearby:

  • light_candleflame
  • light_candleflame_s
  • light_candleflame_chandelier

And I can now do without the "water stim". Looks promising but I have yet to figure out how to tell if the player is looking at the nearby entity.

TDM Modpack 4.0

Link to comment
Share on other sites

I am unable to tell if the player is currently looking at an entity (non-AI) from any direction (ie: candle in on the floor). Can anyone point me in the right direction?

EDIT - (Clarification) I already know the target entity, let's say: $this_candle.

Edited by snatcher

TDM Modpack 4.0

Link to comment
Share on other sites

Obsttorte wrote a trigger_look script which should be available as an entity in the base assets. Otherwise you could try looking it up on the forums.

Link to comment
Share on other sites

Link to comment
Share on other sites

I can't figure it out @Obsttorte. Your video is interesting but hardly of any help.

These are the basis of what I currently do:

do
{
	this_entity = sys.getNextEntity("def_attach", "light_candleflame_sp", this_entity);
	if (this_entity != $null_entity)
	{
		if (this_entity.distanceToPoint(playerEyePos) < 50 && this_entity.hasFunction("LightsOff"))
		{                                         
			this_entity.callFunction("LightsOff");                                             
		}
	}

} while (this_entity);

 

TDM Modpack 4.0

Link to comment
Share on other sites

@ALL

Is "Blow" the right name for the tool / skill / ability? Any other suggestions?

@ARTISTS

This project requires a nice icon for "The Blow". I am thinking of a dark silhouette of the upper part of the body of a thief, shoulders and above, wearing a hood. The face is in shadows except for the mouth and perhaps, the chin. The format must be a 256x256 dds file. Anyone willing to give it a try? Other ideas for this icon?

TDM Modpack 4.0

Link to comment
Share on other sites

You probably got used to it and don't remember. To extinguish a movable candle you must grab it, press a key, and release it. Not only this is non intuitive but cumbersome and many times frustrating: be honest, you want to extinguish a candle but how many times you - to this day - move on with an extinguished candle in your hands? making noises, moving other items, re-positioning to put it back? I am not sure I will succeed but I believe something is off and it can be done better.

I came to terms with the idea that nothing I propose will ever be part of the core mod. My goal now is to provide usable "proof of concepts". The better a proof of concept works, the merrier.

TDM Modpack 4.0

Link to comment
Share on other sites

There are already candles that can be taken out directly by frobbing them. It's just the choice of the mappers on whether they want to use those or the moveable ones. If you want to overwrite this behaviour I would suggest to alter the entity definitions of the respective base classes.

EDIT: the candlesticks for example inherit from atdm:moveable_candle_base. If you copy the equip_action_script to frobaction script and set grabable to 0, you should already get the desired behaviour.

2 hours ago, snatcher said:

I can't figure it out @Obsttorte. Your video is interesting but hardly of any help.

These are the basis of what I currently do:

do
{
	this_entity = sys.getNextEntity("def_attach", "light_candleflame_sp", this_entity);
	if (this_entity != $null_entity)
	{
		if (this_entity.distanceToPoint(playerEyePos) < 50 && this_entity.hasFunction("LightsOff"))
		{                                         
			this_entity.callFunction("LightsOff");                                             
		}
	}

} while (this_entity);

 

And what is this code supposed to do? I don't understand why you are going for an inventory item to blow out candles.

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

3 hours ago, snatcher said:

To extinguish a movable candle you must grab it, press a key, and release it.

That fixed my patch a long time ago, if you highlight the candle and not the holder you can extinguish it with one frob. You still somehow grab it afterwards, but I will take a look at Obsttorte's comment, which seems like it could fix that :)!

Edited by wesp5
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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • 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
×
×
  • Create New...