Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend point_bugbait functionality #229

Merged
merged 3 commits into from
Oct 25, 2023
Merged

Conversation

arbabf
Copy link
Collaborator

@arbabf arbabf commented Feb 19, 2023

This PR adds a SetRadius input to point_bugbait, as well as a new functionality that allows point_bugbait to use mins and maxs. This is a super-niche situation where spheres don't work well but a big box does. It annoyed me enough for me to add such a functionality.

Possible uses for this:

  • Throwing bugbait into areas (like big targets, or hallways) where a sphere would allow the output to be triggered erroneously (e.g. on the other side of a brush), but smaller spheres miss a small area (and/or take up many entities)
  • Squeezing bugbait while standing on a platform or set of platforms
  • Dynamic point_bugbait zones that change depending on gamestate.

One could theoretically use a trigger_multiple with a filter set to npc_grenade_bugbait, but this only covers thrown bugbait and would need to conform to the geometry very tightly, making it somewhat infeasible.


Does this PR close any issues?

None.

PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

FGD entry:

@PointClass base(Targetname, Parentname) size(16 16 16) wirebox(bmins, bmaxs) sphere(radius) color( 255 255 0 ) = point_bugbait : "Bugbait sensor point"
[

	Enabled(choices) : "Start Enabled" : 1 =
	[
		0 : "No"
		1 : "Yes"
	]

	spawnflags(Flags) =
	[
		1: "[1] Do not call antlions to position" : 0
		2: "[2] Don't activate on thrown bugbait splashes" : 0
		4: "[4] Don't activate on squeezed bugbait" : 0
	]
	
	useradius(choices) : "Use Radius Keyvalue" : 1 : "If disabled, use mins and maxs." =
	[
		0 : "No"
		1 : "Yes"
	]
	
	radius(integer) : "Sensor Radius" : 512
	
	bmins(vector) : "Mins" : "0 0 0"
	bmaxs(vector) : "Maxs" : "0 0 0"

	// Inputs
	input	Enable(void) : "Enable the sensor."
	input	Disable(void): "Disable the sensor."
	input	Toggle(void) : "Toggle the sensor."
	input 	EnableRadius(void) : "Use the Radius keyvalue of the sensor."
	input	DisableRadius(void) : "Use the mins/maxs keyvalues of the sensor."
	input	SetRadius(integer) : "Sets the radius of the sensor."
	input	SetMins(vector) : "Sets the mins of the sensor."
	input	SetMaxs(vector) : "Sets the maxs of the sensor."

	// Outputs
	output OnBaited(void) : "Fires when bugbait lands within a radius of the sensor"
]

@arbabf arbabf changed the title Allow point_bugbait to use mins and maxs Extend point_bugbait functionality Feb 20, 2023
@Blixibon Blixibon merged commit 68ea86e into mapbase-source:develop Oct 25, 2023
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants