Hitscan

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Is hitscan anything more than a continuous beam? And how to use it?
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

Hitscan is a form of collision detection that traces a line from one point to another and finds whatever is in the way.

These two functions will be of some use for hitscan:
(sysHitScan [source] startPos endPos) -> (obj hitPos) or Nil
(sysFindObjectAtPos source criteria pos [destPos]) -> list of objects


What do you want to do with hitscan? Make a beam weapon that hits instantly? I posted an example mod for a hitscan beam weapon, though that plots a line of points instead of a line.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

I want to make a weapon that fires a continuos beam.
gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

PM, would you suggest using those hitscan functions for friendly fire avoidance, or is there a better way to do it? Thanks if you can help with suggestions.
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

TheLoneWolf wrote:I want to make a weapon that fires a continuos beam.
Continuous does not necessarily mean hitscan. Continuous fire is easy, just set fireRate to 2 and you get a stream of shots. Want do you want? A beam weapon that strikes at maximum range instantly, and can fire continuously? If so, just cut-and-paste the example mod and change its fireRate to 20 (it is a repeating ten-shot) for a quick weapon. There is probably is a simpler way to make hitscan weapons (but I have not bothered with it yet).
gunship256 wrote:PM, would you suggest using those hitscan functions for friendly fire avoidance, or is there a better way to do it? Thanks if you can help with suggestions.
I think I used one of the hitscan functions to detect friendly fire for my ZapSats (and AutoBeamer), and it reduces, but not eliminate, friendly fire incidents. If the weapon is hitscan, friendly fire avoidance will be almost perfect, but if not, it is possible for others to get hit since hitscan only detects things in the way now, not later.

Would I suggest it? It is probably the way I would think of. I do not know if there is a better way.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

PM wrote:
TheLoneWolf wrote:I want to make a weapon that fires a continuos beam.
Continuous does not necessarily mean hitscan. Continuous fire is easy, just set fireRate to 2 and you get a stream of shots. Want do you want? A beam weapon that strikes at maximum range instantly, and can fire continuously? If so, just cut-and-paste the example mod and change its fireRate to 20 (it is a repeating ten-shot) for a quick weapon. There is probably is a simpler way to make hitscan weapons (but I have not bothered with it yet).
gunship256 wrote:PM, would you suggest using those hitscan functions for friendly fire avoidance, or is there a better way to do it? Thanks if you can help with suggestions.
I think I used one of the hitscan functions to detect friendly fire for my ZapSats (and AutoBeamer), and it reduces, but not eliminate, friendly fire incidents. If the weapon is hitscan, friendly fire avoidance will be almost perfect, but if not, it is possible for others to get hit since hitscan only detects things in the way now, not later.

Would I suggest it? It is probably the way I would think of. I do not know if there is a better way.
A beam weapon that doesn't hit instantly, but fires continuously.
Post Reply