Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: portej05 on May 22, 2009, 11:30:46 am

Title: remove-goal build
Post by: portej05 on May 22, 2009, 11:30:46 am
OK, this could either go here or in the FRED area. It's gone here :P

This build contains the remove-goal sexp which inadvertantly got left out at some point.
The actual sexp itself has 2 parameters, the ship/wing and the order to remove, and if a priority is specified, uses that while sorting through the goals.
If a priority is not specified, the first goal matching the sexp directive in the Ai_info structure is removed.

A very basic test was done with a mission supplied by The_E, but it was by no means conclusive, only that the general idea worked.
Things that probably need to be beaten to death are:
-removing goals from wings
-removing goals from ships
-removing goals based on priority
-removing every possible goal there is. I might have made a mistake in any one of them (and you'll understand when you see the patch - this turned out to be a lot more hideous than it could have been)

The priority code uses atoi(CTEXT(CDR... atm, so no sub sexps for calculating the priority yet :(

There are 5 builds here: fs2 release, debug, fred release and debug, and mib_cyzrzks modified debug version with a console capable of executing arbitrary sexps in-game.
The patch is also here. Without further ado, and an 'anything that goes wrong is your own damn fault':

The Patch (http://porteous.no-ip.org/FS2Files/remove_goal_testing/remove_goals_fri_22_may.diff)
SCP Release Version (http://porteous.no-ip.org/FS2Files/remove_goal_testing/remove_goals_testing_fs2_open_3_6_11r.exe)
SCP Debug Version (http://porteous.no-ip.org/FS2Files/remove_goal_testing/remove_goals_testing_fs2_open_3_6_11d.exe)
FRED Release Version (http://porteous.no-ip.org/FS2Files/remove_goal_testing/remove_goals_testing_fred2_open_3_6_11r.exe)
FRED Debug Version (http://porteous.no-ip.org/FS2Files/remove_goal_testing/remove_goals_testing_fred2_open_3_6_11d.exe)
Debug with mib_cyzrzks console Version (http://porteous.no-ip.org/FS2Files/remove_goal_testing/mib_cyzrzk_remove_goals_testing_console_fs2_open_3_6_11d.exe)

Please don't hit the server too hard  :nervous:
Title: Re: remove-goal build
Post by: karajorma on May 22, 2009, 11:49:33 am
The priority code uses atoi(CTEXT(CDR... atm, so no sub sexps for calculating the priority yet :(

I wouldn't worry too much about that. I don't think any FREDders actually use SEXPs or variables to supply priorities. I doubt anyone would notice for months or even years if you left it the way it is now.

The reason for using eval_num rather than atoi(CTEXT()) is more to make sure your code is future proof. You never know what someone might do with the code next that might make using a SEXP there much more useful.
Title: Re: remove-goal build
Post by: portej05 on May 26, 2009, 01:49:40 am
I've just realised how close sexps are to Scheme or Lisp (one of the CAD systems here accepts commands in Scheme).  ;)
Title: Re: remove-goal build
Post by: karajorma on May 26, 2009, 01:59:26 am
Goober's commented on that fact several times himself. :D
Title: Re: remove-goal build
Post by: portej05 on May 26, 2009, 09:25:07 am
Thanks to The_E for testing these builds.
Title: Re: remove-goal build
Post by: The E on May 26, 2009, 09:30:22 am
I should hasten to add that I didn't test how it would react with differing priorities. I'll attach my test mission for your consideration and further testing.

[attachment deleted by ninja]
Title: Re: remove-goal build
Post by: portej05 on May 27, 2009, 03:21:13 am
Here's the dealio folks (and Goob has told me I'm allowed to nag you lot).
Test this, or you might regret it when it gets committed.

EDIT: I forgot to add: Post your experiences here, or hit me up on IRC.
Title: Re: remove-goal build
Post by: karajorma on May 27, 2009, 03:54:09 am
This unfortunately is the problem with new SEXPs. They get very little testing when they're new. Often they'll sit around for months before someone comes up with a mission that needs them.
Title: Re: remove-goal build
Post by: SypheDMar on May 27, 2009, 07:45:09 pm
Is it possible for me to just download the patch by itself?
Title: Re: remove-goal build
Post by: portej05 on May 27, 2009, 08:12:44 pm
yep, it's the diff file linked to by 'The Patch' in the first post

EDIT: Here (http://porteous.no-ip.org/FS2Files/remove_goal_testing/remove_goals_fri_22_may.diff)
Title: Re: remove-goal build
Post by: portej05 on June 17, 2009, 06:52:27 am
Recommend this gets committed.

Cheers for the awesome work by The_E and kara and Goober.
Title: Re: remove-goal build
Post by: portej05 on June 20, 2009, 02:41:27 am
Committed