fighter lua
Moderator: Moderators
fighter lua
http://pastebin.com/m529b89a4
This is a lua script made by CarRepairer(thx a lot)that makes gunships do flybys as they attack.
There is an issue however since it does not work in many cases for example when you give an attack command to several fighters.
Can anyone see a better way of implementing this?or maybe an easy way to patch this up?
Is there a chance someone will add some options to air behavior in the engine so it is more flexible?
This is a lua script made by CarRepairer(thx a lot)that makes gunships do flybys as they attack.
There is an issue however since it does not work in many cases for example when you give an attack command to several fighters.
Can anyone see a better way of implementing this?or maybe an easy way to patch this up?
Is there a chance someone will add some options to air behavior in the engine so it is more flexible?
Re: fighter lua
seriously... asking the same question over and over again does not make people want to comply.Gota wrote:Is there a chance someone will add some options to air behavior in the engine so it is more flexible?
Re: fighter lua
Well i know of at least one other game maker that would like it to be more flexible.smoth wrote:seriously... asking the same question over and over again does not make people want to comply.Gota wrote:Is there a chance someone will add some options to air behavior in the engine so it is more flexible?
The more people are in need of a certain implementation the more chances it will get implemented?
Especially since this is not(from what i understand) some grandiose undertaking(not that i disrespect anyone's time).
Re: fighter lua
Indeed, it is well known that you want ota flight behaviors and the bugs*features* that come with it. However, as mentioned in that moderator thread. you seem to not understand no is the end of it. You continue to ask over and over and over again. As a child this may work when begging for toys or candy but as an adult you will find this approach actually makes people less likely to do it. Not that I am trying to pick on you but lately you say you want to get better. This is one of the key things that alienates you from other content devs who actually could help you.
Re: fighter lua
If you want to make enemies, try to change something. ~Woodrow Wilson
Re: fighter lua
its been a while since GOTA last made an OTA flight behaviour thread good to know hes trying to change... :p
Re: fighter lua
If you could make a bomber attack like a gunship, then you'd be in business, with all the fly-by stuff done for you. Some sort of fake bomb weapon to get the behavior, then another weapon which shoots down on things in it's path. Will be a lot less buggy then trying to hack it in with lua.
Re: fighter lua
what i need is gunship movement but without gunship attack.the attacking needs to be fly bys.
How would i make bombers move like gunships...If i knew that there would be no problem.
How would i make bombers move like gunships...If i knew that there would be no problem.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: fighter lua
just drop maxBank (about 0.3 should do) and keep buffing maxRudder (try 0.02 first, small increments are the key) until it's working as you want. this will work 100% of the time, and wont crapout nomatter how many planes you have selected.In may 2009 I wrote:Solution to Gota's problem, will probably need some tweaks.
Fake weapon!
Code:
[LOCKBREAKER]
{
name=Lock Breaker;
rendertype=0;
lineofsight=1;
turret=1;
range=360;
minintensity=1;
reloadtime=1;
energypershot=0;
weaponvelocity=2500;
areaofeffect=14;
firestarter=90;
beamlaser=1;
thickness=3;
corethickness=0.2;
laserflaresize=10;
targetmoveerror=0.2;
beamtime=0.15;
rgbcolor=0 0 1;
tolerance=10000;
impulsefactor=0.123;
impulseboost=0.123;
cratermult=0;
craterboost=0;
noselfdamage=1;
projectiles=0;
toairweapon=1;
[DAMAGE]
{
default=1;
}
}
In the unit .fbi/.lua!
Code:
weapon2=LOCKBREAKER;
OnlyTargetCategory2=VTOL;
weaponmaindir2=0 0 -1;
maxangledif2=180;
weaponslaveto2=1;
Code:
Drag=0.00;
maxBank=0.4; //0.8
maxPitch=0.225; //0.45
maxRudder=0.016; //0.004
In the script!
At the start or in an include...
Code:
#define CHANGE_TARGET 98
With the rest of the weapon code...
Code:
QueryWeapon2(piecenum)
{
piecenum = rearthrust; //or some other suitable location, it doesn't really matter.
}
AimWeapon2(heading, pitch)
{
return( TRUE );
}
FireWeapon2()
{
set CHANGE_TARGET to 1;
}
This stuff should break the target lock of a fighter if its intended (air) target is too close behind it, forcing it to choose another target. It also has changes to .fbi/.lua values to make the figters handle more like ota gunships. Tested, seems to work quite well, but ymmv.
NOW SHUT UP BECAUSE I DON'T WANT TO HEAR ANY MORE ABOUT IT!
Re: fighter lua
THX i will try this but the biggest issue with fighters is that even if they turn sharply they still have this tag that tells them how long they should fly before turning around and flying back to the target(air or land target).
This also controls you ability to turn them around.
If a fighter is flying forward and you want it to turn around you have to click behind it at a certain distance that is the number in that tag.
If you do not click far enough behind him he will keep flying until he reaches this minimum distance and than he will turn around.
This makes microing them annoying as hell (same with bombers).
If this tag was split to when the airplane is controlled by the ai and when the player controls it and gives it move orders the issue would have been solved but ...
Hmm perhaps this "splitting" can be done with lua?
The tag is called turnradius and it not only controls the minimal radius the fighter will fly before turning back to the target but also the movement to any point.
When you click behind it it treats it liek its that place is a target and keeps moving forward until the distance from it to the clicked location is = to the turn radius.
This also controls you ability to turn them around.
If a fighter is flying forward and you want it to turn around you have to click behind it at a certain distance that is the number in that tag.
If you do not click far enough behind him he will keep flying until he reaches this minimum distance and than he will turn around.
This makes microing them annoying as hell (same with bombers).
If this tag was split to when the airplane is controlled by the ai and when the player controls it and gives it move orders the issue would have been solved but ...
Hmm perhaps this "splitting" can be done with lua?
The tag is called turnradius and it not only controls the minimal radius the fighter will fly before turning back to the target but also the movement to any point.
When you click behind it it treats it liek its that place is a target and keeps moving forward until the distance from it to the clicked location is = to the turn radius.
Last edited by Gota on 04 Dec 2009, 10:07, edited 2 times in total.
Re: fighter lua
Your solution is meant to work when the unit is a fighter or when it has hoverattack=1?
Re: fighter lua
There isn't any way to do a dual-state for flying things atm. Aircraft parameters are not currently accessible via Gadgets.
Seriously... what needs to be done is for somebody to write a complete MoveCtrl solution for aircraft, and ditch the current aircraft code entirely. No, I don't have time atm, too much other crap piled up, don't ask.
Seriously... what needs to be done is for somebody to write a complete MoveCtrl solution for aircraft, and ditch the current aircraft code entirely. No, I don't have time atm, too much other crap piled up, don't ask.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: fighter lua
fighter.Gota wrote:Your solution is meant to work when the unit is a fighter or when it has hoverattack=1?