Jump to content
The Dark Mod Forums

Recommended Posts

Loving that presence lamp setup! That could be very useful to mappers. I've wanted to make a lost city style map for a long time, and that is one piece that I wouldn't have to worry about, should I pursue that idea!

My Fan Missions:

   Series:                                                                           Standalone:

Chronicles of Skulduggery 1: Pearls and Swine                     The Night of Reluctant Benefaction

Chronicles of Skulduggery 2: A Precarious Position              Langhorne Lodge

Chronicles of Skulduggery 3: Sacricide

 

 

 

Link to post
Share on other sites
  • 2 weeks later...

When I tried to make Lost City lamps with trigger_inactivity, I found it worked for the player but the trigger_multiple would repeatedly trigger its target with an AI inside it only if the AI was pathing, not if it was standing still. Have you found differently?

  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites

@VanishedOneThat's indeed the case. Note that Dragofer doesn't directly triggers the light via the trigger_multiple, but instead uses it to reset a timer that turns the light off once it ran out.

  • Like 1

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

Texture Blending in DR: DR ASE Blend Exporter

Link to post
Share on other sites

Right: that's basically what I did as well. If the AI stood still for long enough the timer would run out and the AI would be plunged into darkness. If memory serves, the last time I mentioned this you suggested using a different set-up with a modified AI scriptobject.

  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites

I can confirm that trigger_multiple brushes stop firing triggers if an AI stands still within them. So I see 3 options:

  1. Report this for 2.09 so it hopefully gets fixed, or keep both mechanisms so we have both motion sensors and presence sensors.
  2. Develop a different presence mechanism that doesn't (wholly) rely on trigger brushes
  3. Turn this into a feature and rename to  "motion lamp" instead of "presence lamp". Change the script so the lamp only responds to player movements that exceed a certain velocity.
  • Like 1
Link to post
Share on other sites

I favour (1) unless there are technical reasons not to, because it would remove a disparity between how AI and the player are treated by the trigger.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites

You could check whether ai emit a visual stim, they player should. The lamps could than do a proximity test. Otherwise a custom stim applied to the ai could serve the purpose. It would probably good to allow both versions, either by using a trigger to control the lamp or the stim variant.

19 hours ago, Dragofer said:

Turn this into a feature and rename to  "motion lamp" instead of "presence lamp". Change the script so the lamp only responds to player movements that exceed a certain velocity.

You could basically have both. If the minimum velocity needed for the lamp to turn on is controlled via a spawnarg, mappers would have the choice to set it to zero if the want a "presence lamp". A "motion lamp" could be interesting in respect to gameplay. Besides the magical lamp type of Lost City style one could also think of such lamps in manor missions or similar, whereas those are something by the inventors guild. Sneaking by lamps that go on if you are to fast while there is ai around could create quiet some tensive moments.

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

Texture Blending in DR: DR ASE Blend Exporter

Link to post
Share on other sites

A motion lamp should be quite feasible if I can get trigger_multiple brushes to inform the script who activated it. Trigger_touch has such a function (pass_activator and pass_self spawnargs) but I don't see that for trigger_multiple. Surely that possibility exists?

For making stim-triggered presence lamps, a problem will be that the radius of the stim is defined on the humanoid and not on the lamp, and any existing stims might be too short-ranged for general use. Would likely need to put custom stims with a large radius on all AIs and the player and only let the lamp react if the humanoid is within a certain spawnarg-specified radius. Alternatively each lamp lamp could check every second whether it can see someone, though then it'd frequently switch on/off when the player or AI moves around objects that provide cover.

Another potential problem is that the AI might be very close but on a different floor/in an adjacent room. Visibility checks can't be used to identify this because the humanoid might be hidden behind cover, so it'll have to be location-based: each room should be its own location. Looks like this is a more involved route than the trigger brush method.

Link to post
Share on other sites

Even if a stim is used to initiate the lamp behaviour, you can specifically define on how you want to do the detection. So to mimic the trigger behaviour (assuming you are using cuboid shaped triggers) you could do a coordinate check (via mins/maxs as done by some entities for example).

To apply the custom stim you only have to modify the ai_base and player_base definitions. So you don't have to add the stim to all affected entities manually.

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

Texture Blending in DR: DR ASE Blend Exporter

Link to post
Share on other sites
  • 1 month later...

Here's a .pk4 containing @Sotha's great automaton guards from Ulysses: Genesis as well as an alternative design for the charging station that I had already made on another occasion, as requested by @JackFarmer. The reason I'm posting this in my scripting thread is that I've made a straightforward scriptobject for the charging station, allowing an automaton to switch it on and off as part of its patrol, thereby saving a lot of money on the lord's electricity bill and preventing the station from getting out of sync. It also switches off after a specified time (time_max), in case the automaton is destroyed while it was charging.

Mapping wise, it works by having path_anim nodes activating callobjectfunctions, calling either station_on or station_off on the station. The station toggles its targets, unless it's already in the desired state. Prefabs can be found under prefabs/mechanical/automaton_station.

Here's the simple scriptobject:

Spoiler


object automaton_station
{
	void	init();
	void	station_on();
	void	station_off();

	//INTERNAL
	float	m_station_state;

	//SPAWNARGS
	float	m_time_max;		//station automatically switches off after this time if bot fails to switch it off (i.e. because it's been killed at the station). 0 = infinite.
};


void automaton_station::init()
{
	m_time_max		= getFloatKey("time_max");
}

void automaton_station::station_on()
{
	if(!m_station_state)
	{
		activateTargets(self);
		m_station_state = 1;
	}

	if(m_time_max)
	{
		sys.wait(m_time_max);
		thread station_off();	
	}
}

void automaton_station::station_off()
{
	if (m_station_state)
	{
		activateTargets(self);
		m_station_state = 0;
	}
}

 

Under the hood, I've taken the opportunity to clean up the assets a fair amount, trimming unused components and ensuring it follows TDM's conventions, which is a necessary step towards an inclusion in the core assets.

The download can be found in section D of the original post.

  • Like 1
  • Thanks 1
Link to post
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.

×
×
  • Create New...