FOMM Scripted Install Question

Post » Sun Jul 17, 2011 12:26 pm

This script...

using System;using System.Windows.Forms;using fomm.Scripting;class Script : FalloutNewVegasBaseScript {	public static bool OnActivate() {        //Install all files from the fomod and activate any esps        PerformBasicInstall();		return true;			DialogResult dr = MessageBox("Would you like FALLOUT.INI to be modified to use the default DUI F3 font setup?", "Edit INI", MessageBoxButtons.YesNo);				if (dr == DialogResult.Yes) {			string pfx = @"Textures\Fonts\";			EditFalloutINI("Fonts", "sFontFile_1", pfx + "r_BlueHighway_18.fnt", true);			EditFalloutINI("Fonts", "sFontFile_2", pfx + "r_BlueHighway_20.fnt", true);			EditFalloutINI("Fonts", "sFontFile_3", pfx + "Glow_Monofonto_Medium.fnt", true);			EditFalloutINI("Fonts", "sFontFile_4", pfx + "r_Headline_Otl_21.fnt", true);			EditFalloutINI("Fonts", "sFontFile_5", pfx + "Fixedsys_Comp_uniform_width.fnt", true);			EditFalloutINI("Fonts", "sFontFile_6", pfx + "r_Headline_Otl_24.fnt", true);			EditFalloutINI("Fonts", "sFontFile_7", pfx + "DarN_Libel_Suit_Otl_24.fnt", true);			EditFalloutINI("Fonts", "sFontFile_8", pfx + "Glow_Futura_Caps_Large.fnt", true);			EditFalloutINI("Fonts", "sFontFile_9", pfx + "NVFont_Test.fnt", true);		}				if (GetFalloutIniInt("Archive", "bInvalidateOlderFiles") == 0) {			//System.Windows.Forms.MessageBox.Show("bInvalidateOlderFiles toggled ON", "InvalidateOlderFiles");			EditFalloutINI("Archive", "bInvalidateOlderFiles", "1", false);		}        		return true;	}}


...doesn't work like it's supposed to. It compiles, but I don't get a message box asking for confirmation to edit the INI. Plus I don't know if the INI actually gets edited.

Can someone spot any glaring errors? Like I said, it compiles, so FOMM "likes" the script. It's a copy and paste from Fallout 3 DarNified FOMOD, basically. I just changed the fonts.
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Sun Jul 17, 2011 4:38 pm

Is there an online repository of examples for FOMM? There is something like that for OBMM.
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Sun Jul 17, 2011 1:04 pm

Well, on comparing yours to the one that I'm using (which I know works), the only difference is your
PerformBasicInstall();return true;

If I remember my C#, then that'll just return out from that point (since that part always processes) and prevent the rest of the script from running.
User avatar
Casey
 
Posts: 3376
Joined: Mon Nov 12, 2007 8:38 am

Post » Sun Jul 17, 2011 5:35 pm

Well, on comparing yours to the one that I'm using (which I know works), the only difference is your
PerformBasicInstall();return true;

If I remember my C#, then that'll just return out from that point (since that part always processes) and prevent the rest of the script from running.


Oh, okay. Thanks. So I should just remove that line from the script?
User avatar
saharen beauty
 
Posts: 3456
Joined: Wed Nov 22, 2006 12:54 am

Post » Sun Jul 17, 2011 11:26 am

Oh, okay. Thanks. So I should just remove that line from the script?

Yes.
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Sun Jul 17, 2011 7:16 am

Yep. That's what I did and it works properly. I'm not happy about one thing though: I would prefer to have the mod install after I modify the INI. So, the first thing is "woukld you like to modify ioni", and then install. I assume I should just move the
PerformBasicInstall();

to the bottom of the script, correct?

(I'l try it anyway)

EDIT

Yep. Good stuff.
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm


Return to Fallout: New Vegas