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

Mon Apr 04, 2016 10:47 am

Is hitscan anything more than a continuous beam? And how to use it?

PM
Fleet Admiral
Fleet Admiral
Posts: 2316
Joined: Wed Sep 01, 2010 12:54 am

Mon Apr 04, 2016 12:30 pm

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.8 Beta...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Download and Play in 1.7...
Star Castle Arcade: Relive classic arcade gaming in a new Transcendence adventure!
Playership Drones v7 (Beta): (OUTDATED!) Acquire and command almost any ship in Stars of the Pilgrim or Eternity Port.
Work in progress... Playership Drones v8: Work just started! Details to come later...

User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Mon Apr 04, 2016 1:35 pm

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

Mon Apr 04, 2016 1:41 pm

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: 2316
Joined: Wed Sep 01, 2010 12:54 am

Mon Apr 04, 2016 3:22 pm

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.8 Beta...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Download and Play in 1.7...
Star Castle Arcade: Relive classic arcade gaming in a new Transcendence adventure!
Playership Drones v7 (Beta): (OUTDATED!) Acquire and command almost any ship in Stars of the Pilgrim or Eternity Port.
Work in progress... Playership Drones v8: Work just started! Details to come later...

User avatar
TheLoneWolf
Militia Captain
Militia Captain
Posts: 802
Joined: Thu Nov 28, 2013 5:03 pm
Location: Aboard the CSS Radiant

Mon Apr 04, 2016 3:48 pm

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