Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Singh on May 24, 2004, 05:05:04 am

Title: Interesting Idea
Post by: Singh on May 24, 2004, 05:05:04 am
Kill me if this is a stupid idea, but is it possible to combine the code from the "Set-ship-facing" SexP with the AI code?

What I'm talking about is perhaps something using similar (or maybe even the same) code as the abovementioned to implement a new SexP for the AI, where by the ship would move naturally and come to face a certain point (wheter by moving forwards and turning or standing in one place and turning) or ship, as opposed to simply chasing it around.

Is this possible at all?

Or am I going to be shot for this.:nervous:
Title: Interesting Idea
Post by: karajorma on May 24, 2004, 04:28:54 pm
You're not the first to ask Singh.

Apparently this would require quite a lot of tampering with the AI code.  I doubt anyone is going to try it.

*hopes that having thrown down the gauntlet one the coders will try to prove me wrong* :)
Title: Interesting Idea
Post by: Lightspeed on May 24, 2004, 05:54:11 pm
You could simulate it pretty easily by giving the AI a fake command to attack the target (AI will turn towards it sooner or later) and checking every xx milliseconds if the ship faces the target. Once it does, cancel the attack command and stop the ship.

Something like that should be possible - but dunno how much effort it'd be to code it in.
Title: Interesting Idea
Post by: Gregster2k on May 24, 2004, 06:43:02 pm
LS, one problem with that, its a good idea and all, but...would it still work if the ship is supposed to turn towards a ship while firing at a different one at the same time......?

OT/debunking my own credibility: i don't know squat about SEXP's, so maybe I'm wrong. I do know they're often hard to combine, and i find SEXP construction very hard to understand. I wish someday FRED2_Open can be modified to have SEXPs look more like a nice big expanding/contracting flow chart than a hierarchical list...I work better with images than text, its how my mind thinks (I'm right brain dominant, hehe) ;)
Title: Interesting Idea
Post by: Lightspeed on May 24, 2004, 08:38:18 pm
right brain = nonsense.

Almost every brain is a 'custom design' :)

And how should it be firing at something else? If it turns towards the point you set it will have to cancel any other actions anyway.
Title: Interesting Idea
Post by: Gregster2k on May 24, 2004, 09:28:27 pm
like i said, i dunno squat. i just thought that making it attack to turn it might screw up things if its supposed to fire at something else the whole time whilst it turns :)
Title: Interesting Idea
Post by: Black Wolf on May 25, 2004, 05:22:59 am
I just wish there was a "Weapons in front" flag or something that would make a ship attack from the front. All the Shivan ships should have this ideally, and a lot of others too. It seems crazy - every FS ship circles around their opponents trying to broadside, even when 90% of their heavy weaponry is up the front.