Mateos Posted November 9, 2023 Share Posted November 9, 2023 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 Quote Link to comment Share on other sites More sharing options...
Moderators palota Posted November 10, 2023 Moderators Share Posted November 10, 2023 I modified goal_mobilemortar.gm and commited it to SVN. Position in front of the tank is GetEntityWorldSpace( GetGoal("MOVER_tank").GetEntity(), Vec3(0,250,0) ) Mateos 1 Quote Link to comment Share on other sites More sharing options...
Mateos Posted November 10, 2023 Author Share Posted November 10, 2023 Thank you very much! Ah yes, with the worldspace the entity orientation is taken into account, so it remains on the Y axis, noice Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.