Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

MoveTrigger's are all simulated in the AIPlayer.cpp getAIMove() function. You'd have to write a function (and expose it to TS) to activate the jetting moveTrigger. Navmeshes do the same with the "jump" moveTrigger in AiPlayer.cpp line ~585 and I wrote some functions for AI to use the "pose" moveTrigger.

Posted

That actually works riranft. Once the trigger is enabled, the ai player jets straight up. I need to tweek my ai scripts to regulate air control, but it does work. Thanks!

Posted

Air control should be the same - but the AIPlayer has to be moving in the desired direction as well as jetting. It helps if they're moving before they leave the ground. You may need to tweak the value in the datablock.

Posted

I may have something screwed up. When I set my air control, my player barely moves in the direction I aim it. The jetting is working fine, but I get very little air control.

Posted

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.

Posted

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

Posted
The value is set in the datablocks, for both the player and the ai

Set to what?


And if you're confirming that this works as expected in 3.0 but not in, say, 3.1 then that would give a better starting point for someone to start looking into this...

Posted

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.

Posted

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.

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

  • 3 months later...
Posted

The video is not of high quality (I need to work on that), but here is a video of the AI "jetting" and "skiing" around. Still needs some tweaking, but it's getting there.


pngoAs_uaSo

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