Jump to content
GreenXp

Can't make AI airstrike on trigger

Recommended Posts

So I made a plane spawn when someone goes in a trigger zone, the plane will fly over the player and despawn at some point, now I want to add so that plane drops a bomb, It's a wipeout.  

I looked for hours and I only found smth about forcefire that didn't work wich is exactly what I'm looking for, and then I found a thing that spawns a bomb in the trigger zone wich didn't work either and I tried the CAS thingy in modules too but I didn't manage to make it work. I want somethig simple in-game no scripts or other external stuff bc I'm bad at it.

I would appreciate any suggestions even if they are from the one's I already tried, maybe I missed smth.

Share this post


Link to post
Share on other sites

So I finally made a gbu spawn in the air exactly when the plane is above the trigger zone, now the problem is that the bomb is too slow, I need to somehow increase it's velocity if that's a thing

this is the code so far

strike1 = []; if (isServer) then { _strike = "Bo_Mk82_MI08" createVehicle (getpos plane1); };

Edit: So I added 

 _strike setVelocity [0,0,0] }

wich doesn't work properly, the X makes it do an arch then drop, the y will make it go forward and the z will make it go up, I figured  the x would make it fall faster but it goes up for some reason and makes an arch

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

Same thing, I kinda made it work with the bombs but the rockets just go flying straight no matter what I do

Share this post


Link to post
Share on other sites
9 hours ago, beno_83au said:

What about this:

 

 

I saw that some time ago but as I said, I'm very bad at scripts.

People that usually script just give the script and let's you go from there, I can't do shit with that unless you show me exactly what I need to do with it, every detail, lost enough time fixing 1 script on my own with trail and error when the author could've just said, ahh you just need to add that there, and done.

Share this post


Link to post
Share on other sites
6 minutes ago, GreenXp said:

I saw that some time ago but as I said, I'm very bad at scripts.

People that usually script just give the script and let's you go from there, I can't do shit with that unless you show me exactly what I need to do with it, every detail, lost enough time fixing 1 script on my own with trail and error when the author could've just said, ahh you just need to add that there, and done.

What's stopping you from learning how to run third party scripts?

There's at most 3-4 ways to run any third party script, it's not like you're going to waste multiple months on learning how to do it.

In most cases (including the one linked by @beno_83au) there are instructions hiding in plain sight.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
3 minutes ago, Grumpy Old Man said:

What's stopping you from learning how to run third party scripts?

There's at most 3-4 ways to run any third party script, it's not like you're going to waste multiple months on learning how to do it.

In most cases (including the one linked by @beno_83au) there are instructions hiding in plain sight.

 

Cheers

You would be surprised, I'll try to use the script, but I'm 90% sure I'll lose another day on trying to make it work and then I would find a work around and leave it be. I'm too retarded, it's probably very easy but idk where to start. After using a script yesterday I'm done, I had to change 1 thing, get into the game and see if it works then repeat, and 1 thing was literally 1 letter or point.

Share this post


Link to post
Share on other sites
30 minutes ago, GreenXp said:

unless you show me exactly what I need to do with it

 

Simple. As @Grumpy Old Man said the instructions are right there on the page:

 

nul = [_position,_direction,_vehicle,_type] execVM "MIL_CAS.sqf";

This line taken directly out of my instructions is all you need to use to run the script, just place it in the "On Activation" field of your trigger. What I have inside the script takes care of the rest for you. All you need to do is input the right data into the array, as shown in this example (and explained in the instructions):

nul = [getPos player,240,"RHS_A10",3] execVM "MIL_CAS.sqf";

 

The thing is, if you want to do anything remotely tricky you're going to need to use scripts. And there's nothing wrong with not being able to write scripts. Took me a while to get any good (arguably) at it. That's what's so handy about having pre-made scripts available to the community. Then, if you're still struggling to make it work, all you gotta do is ask for help 👍

 

p.s. scripting is painful, yes....... 

  • Like 1

Share this post


Link to post
Share on other sites

Ok, it works, but fuck your "-" I get it you want everything lined up and nice, but in the code that shit doesn't work, see why I say I hate this, a little tiny bit fucks everything.

Ty for wasting your time for me tho, and how do I change it's position so it doesn't hunt me, I want the plane to shoot where the trigger is not where I am.

Share this post


Link to post
Share on other sites

I don't think you know what works and what doesn't work.

As my old granny would say - "learn to walk before you try to run".

  • Like 3

Share this post


Link to post
Share on other sites
13 minutes ago, Tankbuster said:

learn to walk before you try to run

Some folks might be better off to learn how to learn.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, GreenXp said:

 how do I change it's position so it doesn't hunt me, I want the plane to shoot where the trigger is not where I am.

Sometimes, things must be understandable and must have logical sense before scripting.

Share this post


Link to post
Share on other sites
4 hours ago, pierremgi said:

Sometimes, things must be understandable and must have logical sense before scripting.

Well, by my logic it would work if I did getPos M1 wich would be a marker or even  the trigger that the script is in, but it doesn't work, I tried setPos, getPos, only works with getPos player

Share this post


Link to post
Share on other sites

Mate, like i said, if somethings not working for you, all you need to do is show us what's not working and what you're specifically trying to achieve. It actually took me a few minutes realise what you meant by "-". Also, if you had mentioned markers someone would've pointed you towards the Script Command Wiki and getMarkerPos.

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, GreenXp said:

Well, by my logic it would work if I did getPos M1 wich would be a marker or even  the trigger that the script is in, but it doesn't work, I tried setPos, getPos, only works with getPos player

Look in the syntax of getpos on the wiki. Does it say it can accept a marker as a parameter?

The tools you need to achieve what you want are there, but you are choosing not to use them.

Please take a more analytical approach to writing your code and read the errors carefully. Just throwing random code at the problem simply won't work.

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, GreenXp said:

by my logic

It might be logical to use a getPos command and retrieve a position, if it weren't for various data types/coordinate spaces to chime in and ruin your day.

There's many commands that do similar jobs like getPos, getPosASL,  getPosVisual, getPosWorld, etc.

Then there are commands that don't do what their names might suggest (not going into this, out of bananas).

Reading the wiki usually clears things up.

 

Also I strongly suggest using a text editor that supports .sqf syntax, such as the glorious Poseidon, maintained by a dev.

Using such a tool makes syntax problems obvious and if in doubt simply click on a script command, hit F1 and you're on the wiki.

 

It also helps to be as specific as possible in the first post.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

I somehow made everything work so far, ty all for you support.

There are 2 more things I need help with before starting to make the mission

https://imgur.com/a/TGyLuKa

That "HIT 22m" is the distance from where I shot someone, but it also shows the distance that an AI shot another AI, it shows the distance from everyone. I don't want it at all, I've searched for it but I can't find any option about it.

 

And is there any way to edit an already started mission, so if I play on a mission that I made MP with a friend for example, after we get bored and leave, can I eddit the mission from where everything is at the moment ? I'm prty sure I did it before but I can't do it anymore, I assume is when you make the server and instead of resume you hit 3DEditor, but that doesn't work bc I get an error, which I can provide later.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×