cybore Posted September 15, 2015 Share Posted September 15, 2015 Has "jetting" capabilities for AI ever been successfully accomplished in Torque 3d? Quote Link to comment Share on other sites More sharing options...
rlranft Posted September 17, 2015 Share Posted September 17, 2015 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. Quote Link to comment Share on other sites More sharing options...
cybore Posted September 17, 2015 Author Share Posted September 17, 2015 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. Quote Link to comment Share on other sites More sharing options...
Steve_Yorkshire Posted September 17, 2015 Share Posted September 17, 2015 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. Quote Link to comment Share on other sites More sharing options...
rlranft Posted September 18, 2015 Share Posted September 18, 2015 I think it should be:%aiplayerobj.setMoveTrigger(1); //this is alt trigger, but pretty sure that's default for jet // to stop %aiplayerobj.clearMoveTrigger(1); Quote Link to comment Share on other sites More sharing options...
cybore Posted September 18, 2015 Author Share Posted September 18, 2015 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! Quote Link to comment Share on other sites More sharing options...
cybore Posted September 18, 2015 Author Share Posted September 18, 2015 Has anything changed with "air control" in 3.7? I can't seem to get it working for my player or for the ai. Quote Link to comment Share on other sites More sharing options...
rlranft Posted September 19, 2015 Share Posted September 19, 2015 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. Quote Link to comment Share on other sites More sharing options...
cybore Posted September 19, 2015 Author Share Posted September 19, 2015 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. Quote Link to comment Share on other sites More sharing options...
rlranft Posted September 19, 2015 Share Posted September 19, 2015 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. Quote Link to comment Share on other sites More sharing options...
cybore Posted September 19, 2015 Author Share Posted September 19, 2015 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. :? Quote Link to comment Share on other sites More sharing options...
rlranft Posted September 20, 2015 Share Posted September 20, 2015 The value is set in the datablocks, for both the player and the aiSet 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... Quote Link to comment Share on other sites More sharing options...
cybore Posted September 20, 2015 Author Share Posted September 20, 2015 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. Quote Link to comment Share on other sites More sharing options...
cybore Posted September 20, 2015 Author Share Posted September 20, 2015 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. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted September 21, 2015 Share Posted September 21, 2015 an if statement and a bool will help you here Quote Link to comment Share on other sites More sharing options...
Caleb Posted September 21, 2015 Share Posted September 21, 2015 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). Quote Link to comment Share on other sites More sharing options...
cybore Posted January 5, 2016 Author Share Posted January 5, 2016 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 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.