Skip to content

[3.0] Hit Detection #7

Description

@NickMBR

Hit Detection

The hit detection system will use the DamageCore Extension to detect damage on props linked to the E2.

Configuration

The targets of the game are consisted of 5 parts:

  1. Head
  2. Chest
  3. Stomach
  4. Legs
  5. Base
  • Set an array with only the base props
  • Set an array with the head, chest, stomach and legs order for each distance
  • Detect the part hit by reading the model
  • Count points based on the model hit by a factor
  • Count a miss when none of the props from the array was detected
  • Avoid penetration hit detection by not counting sequential hits?
  • Store points, parts hit, total hits, total misses and total targets down

Model Parts Reference

Head
models/props/props_gameplay/target_ct_head.mdl
models/props/props_gameplay/target_t_head.mdl

Chest
models/props/props_gameplay/target_ct_chest.mdl
models/props/props_gameplay/target_t_chest.mdl

Stomach
models/props/props_gameplay/target_ct_stomach.mdl
models/props/props_gameplay/target_t_stomach.mdl

Legs
models/props/props_gameplay/target_ct_legs.mdl
models/props/props_gameplay/target_t_legs.mdl

Base
models/sprops/rectangles/size_1/rect_3x30x3.mdl

Code References

// Init damage detection
runOnDmg(1)

// Detect if damage was caused by a bullet
lastDamage():isBulletDamage()

// Prop/Player Detection
dmgVictim()
dmgAttacker()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions