Jump to content

Mortar to track MOVER - Aim is adjusted after shooting, not right before


Recommended Posts

Good afternoon,

I've wrote a little system to adjust MOBILEMORTAR target/orientation to track a MOVER, based on mapgoal_mobilemortar.gm SetProperty callback handling target case (basically replaced player position by MOVER origin), in a thread looping until the given MOBILEMORTAR goal gets unavailable, initially sleep 3 seconds because you'll still hit the vehicle that moved during this interval

It works well until the bot runs out of charge, after which it seems to adjust after having shot, but not right before shooting the next one, thus shooting behind the MOVER

I think so because lowering the sleep to 0.1 doesn't help (or is it due to some goal refresh timer?)

Example of function called in a thread:

	// TODO Own table + check if target obj has moved, borrow usual EntityDefenceManagement stuff
	TestThread = function()
	{
		tstAxisMortar = GetGoal( "MOBILEMORTAR_AxisAlphaTest" );
		tank = GetGoal( "MOVER_tank" );

		while ( tstAxisMortar.IsAvailable( TEAM.AXIS ) )
		{
			tbl = CalcTrajectory( tstAxisMortar.GetPosition() + Vector3( 0,0,32 ), tank.GetPosition(), 2350, 1 );
			if ( !tbl )
			{
				Util.MapDebugPrint( "^8Mortar trajectory not found for target " + tank.GetName() + " " + ToString( tank.GetPosition() ), true );
			}
			else
			{
				dir = tbl[ tableCount( tbl ) - 1 ];
				playerFace = Vec3FromSpherical( dir.GetYaw(), dir.GetPitch() - DegToRad( 60 ) );
				tstAxisMortar.MortarAim[ 0 ] = playerFace;
				//Util.MapDebugPrint( tstAxisMortar.GetName() + " aim set to " + ToString( playerFace ), true );
				tstAxisMortar.AdjustOrientation();
			}

			sleep( .1 );
		}

		Util.MapDebugPrint( "Exiting Mortar aim management thread", true );
	}

Tried that on the following map: Wolffiles.de - your filebase

Attached the WIP waypoints to try that out directly

Do you think I'm doing this right/this is a right thing to do?

---

I'm planning on trying to determine the MOVER direction to move an ARTILLERY_S goal to stay in front of it, so there's a single goal that gets adjusted on its own all along

There's just an origin for the MOVER and splines aren't readable, what do you think?

---

Thanks in advance

Regards,

Mateos

Christmas Hills Beta - Mortar tracking system test.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...