Jump to content

Jetting for AI?


cybore

Recommended Posts

It's on my to-do list (it's not a very long list but I rarely get around to it) because a game I'm tinkering with needs it, too. For a player you'd just do something like this:

function altTrigger(%val)
{
   $mvTriggerCount1++;
}
 
moveMap.bind( mouse, button1, altTrigger );

For an AIPlayer though - I don't think it applies because they don't even use the move map. I'll have to think about this. If I get it working I'll drop it here.

Link to comment
Share on other sites

Thanks riranft. I have tried several different approaches, "altTrigger" being one of them, to no avail. I've also tried getting AI to recognize "z" co-ordinates, but the AI will only recognize x and y. In the original Tribes, I believed they used a "gainHeight" function for the AI to "simulate" jetting. I have yet to figure that out though.

Link to comment
Share on other sites

Check the value in the AIPlayer datablock - the default should be set in the DefaultPlayerData datablock in art/datablocks:

 

datablock PlayerData(DefaultPlayerData)
{
 
// ....
   jumpForce = "747";
   jumpEnergyDrain = 0;
   minJumpEnergy = 0;
   jumpDelay = "15";
   airControl = 0.3;
 
// ....
};

 

You can override it for your AIPlayers in their separate datablocks, for instance to have heavier units have less control and ligher units more:

datablock PlayerData(DemoPlayer : DefaultPlayerData)
{
   shootingDelay = 2000;
   // added:
   airControl = 0.6; // or whatever you like
};

 

In theory, this should allow you to tune your AI movement.

Link to comment
Share on other sites

The value is set in the datablocks, for both the player and the ai. Problem is, there is very little movement in any direction when "jetting" (other than straight up). I dunno if this is an issue on my end or an issue in 3.7. After checking, the last version that I used that I don't have trouble with Air Control is version 3.0. I'm baffled. :?

Link to comment
Share on other sites

Value is set to 0.3, and air control works fine up to version 3.5.


I was able to get jetting working for the ai in 3.0. Since that is the best version of T3D that I could get "aircontrol" to work correctly, I did what Steve_Yorkshire suggested. I exposed the getAI()Move function to script and activated the mJetting Trigger. The "setMoveTrigger" function is already set up in 3.7, so I copied that function and moved it over to 3.0. Easier than I thought it would be.


It works pretty good, but I'll need to beef it up a bit to make the ai more aggressive. Thanks for the help! I'll keep this thread updated with my progress.

Link to comment
Share on other sites

I was wondering, can maxForwardSpeed be changed "on the fly" via script? I noticed the higher my maxForwardSpeed was set, the more "air control" I had. If I could set maxForwardSpeed to a higher variable upon using the "mJetting" trigger via script, it would solve my "air control" issues.

Link to comment
Share on other sites

I was wondering, can maxForwardSpeed be changed "on the fly" via script? I noticed the higher my maxForwardSpeed was set, the more "air control" I had. If I could set maxForwardSpeed to a higher variable upon using the "mJetting" trigger via script, it would solve my "air control" issues.

 

You can't (or rather shouldn't) change DataBlock values during runtime, but you can use setMoveSpeed instead. Have the maxForwardSpeed set to something high like 20 or so, then when the AIPlayer is spawned just reduce the speed with %bot.setMoveSpeed(0.5). Then when the AIPlayer is in the air set it back to max with %bot.setMoveSpeed(1).

Link to comment
Share on other sites

  • 3 months later...

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...