Author Topic: Changing a ship's $Autoaim FOV value during a mission  (Read 1764 times)

0 Members and 1 Guest are viewing this topic.

Changing a ship's $Autoaim FOV value during a mission
Hi,

I'd like to disable the autoaim feature at the start of a mission, but I don't want to have to change the $Autoaim FOV setting in ships.tbl - is there anyway to do this in FRED? Could I use something like script-eval to acheive it.

I am working with somebody else's mod, and I'd rather not have to change the ships settings if possible.

Thanks

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Changing a ship's $Autoaim FOV value during a mission
In LUA there's a ship object variable called AutoaimFOV; if you set this to zero it effectively disables autoaim.  Something like this to disable it for all ships:

 (warning, I haven't tested this!)

Code: [Select]
$On Gameplay Start: [

    local num_ships = #mn.Ships
    for i=1,num_ships do
        local ship = mn.Ships[i]

        if ship ~= nil and ship:isValid() then
            ship.AutoaimFOV = 0
        end
    end

]
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: Changing a ship's $Autoaim FOV value during a mission
Many thanks for the pointer - I will give this a try.

I am quite new to Fredding so this is a bit of a learning curve at the moment.

Thanks again

 
Re: Changing a ship's $Autoaim FOV value during a mission
Also, do you have a link to where I can get started finding out about thins like #mn and it's properties, and where I can find things like ship properties?

I just need somewhere to start :D

Thanks

  

Offline niffiwan

  • 211
  • Eluder Class
Re: Changing a ship's $Autoaim FOV value during a mission
If you run FSO with the "-output_scripting" command line parameter, it'll create a scripting.html file which documents all the scripting commands.  This wiki page will also help, especially the "Useful references" section.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: Changing a ship's $Autoaim FOV value during a mission
If you run FSO with the "-output_scripting" command line parameter, it'll create a scripting.html file which documents all the scripting commands.  This wiki page will also help, especially the "Useful references" section.

Again, many thanks for the info - page bookmarked and now lots of experimenting to get on with :D

Cheers