Missiles and MobjCollide help.

Status
Not open for further replies.

Lat'

Absolute territory where
Kart Krew™️
EDIT: Nevermind, I found out adding MF_SPECIAL to the hitbox lets the missile be detected by Mobj(Move)Collide.

Blah blah I've been working on Silver's new Telekinesis; but the hitbox object that detects if yes or no the object can be grabbed by using MobjMoveCollide does not seem to even detect missile objects within its range.

At first, I noticed the MF_NOBLOCMAP flag that seemed to have an inpact with collision detection, but removing it (Both tried in Lua AND SOC) did not change anything

I also tried making a copy of the Hook in MobjCollide and all, but the only thing that worked is basically making the hitbox solid or shootable for missiles to actually go on and collide with it, but that leads to unwanted behaviors.

Here's the script if it matters, the specific checks (thrown and telekinified) don't affect missile detection at all.

Code:
addHook("MobjMoveCollide", function(hb, grabit)
	
	if not hb.valid return end
	
	if hb and hb.valid
	and hb.target and hb.target.valid // obligatory SILVER PARANOIA
	and grabit and grabit.valid
		
		if hb.aimbox
			
			local mo = hb.target
			
			if (grabit.flags & MF_MISSILE or grabit.flags & MF_MONITOR or grabit.flags & MF_ENEMY or grabit.flags & MF_PUSHABLE
			or grabit.type == MT_PLAYER and grabit.player and canwegrabPlayer(mo.player, grabit.player))	// only grab that kind of stuff.
			
			and not (grabit.telekinified or grabit.thrown)
			and grabit ~= hb.target

				grabit.time = 2
				if not grabit.aimed
						
					if mo.aimingat == nil
						mo.aimingat = {}
					end
							
					table.insert(mo.aimingat, grabit)
							
					if mo.player.locksound
						S_StartSound(mo, sfx_tlock, mo.player)
					end	
					grabit.aimed = true
				end
			end	
		end
          (Script goes on to unrelated stuff after this)

I guess I'll provide the file if needed, because this is really annoying to deal with. :/
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top