Skip to content

Conversation

@Wikot235
Copy link

This PR adds three new Console Variables that mappers can use to change the maximum jump distance for npcs. Mappers can make npcs jump down or up any height they please. They can also make npcs be able to jump across bigger gaps.

Here are the new commands:

  • ai_jump_max_up
  • ai_jump_max_distance
  • ai_jump_max_down

It solves issue #425

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

@Yankumo-Koishi
Copy link

Yankumo-Koishi commented May 27, 2025

wow you're so fast
I notice that this PR directly exposure the Meters in ai_basenpc_movement.cpp as Cvar, I'm not a programmer but what if the NPC code has its own conditions to change the meters (more specifically, the Longjump Rebel in EZ2)
I don't mean this PR is bad, it's better than nothing tho, but I'm worry about if this may not apply to all NPCs (?) or I'm just overthinking lol

@Wikot235
Copy link
Author

Just looked into the code, yeah, it won't apply to:
npc_antlion
npc_fastzombie
npc_hunter
npc_monk

And here is the problem, all of them have different values for MAX_JUMP_RISE, MAX_JUMP_DISTANCE and MAX_JUMP_DROP.
I am really not sure about assigning the same convars to all of them. Now I could create seperate convars for all of them but that would inflate the amount of new convars from 3 to 15. And that would be a total mess, or I could just assign these values to keyvalues for every npc, problem with this solution is that you can't modify the jump distances after the map is compiled.

@Bronzehawk75
Copy link

I don't think global console commands are the correct approach here. Even setting aside the NPCs with special jump parameters, it seems inflexible. For example, maybe the mapper wants to allow some Combine soldiers to jump over a large gap but not let the player's citizens do the same thing.

I did a little bit of experimenting today and got this working on a per-NPC basis. Pull request here: #439

@Wikot235 Wikot235 closed this Jun 22, 2025
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.

3 participants