Page 2 of 3

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 06:18
by rohan
Since it seems I too have 8 MDLs to correct, I don't suppose anyone would care to give me / us some detailed instructions on doing those edits using MCX and Notepad++ (as I haven't a clue about how to use MCX). I'd also like to change the lights to a DG alternative if possible, though that may depend on which of his models I don't have (as I have most but probably not all).

Thanks in advance for any help ...
:S

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 10:13
by DaveB
Hi Ro :hello:

DG showed me how to do it last year and is probably the best person to explain properly what should be done. However.. I'll have a go :lol:

You need, as already mentioned, MCX and a hex editor (Notepad++ will do because it doesn't change the format of the model).. and suitable replacements for the duff lights. Check the model in MCX to see what effects the model is using and their location then note the name of the effects in use. With the ND AS332, it uses navgrem, navredm and navwhih.
Next.. make copies of the nav lights you want to use and name them something memorable.. eg, navgre_DG to navgnem.. navred_DG to navrnem and navwhi_DG to navwnem. You must make sure that the number of characters used for naming the new lights matches that of the models lights or you'll break the model.. it won't display in FS (make backups!) :lol:

With most models, the naming/changing convention is straight forward as you're changing a green for a green and a red for a red e t c.. the AS332 was slightly more challenging because you have to find the green references and changed them to red and the red references to green.. white for white less so :)

OK.. open the mdl in Notepad++ and you'll be confronted with lines of letters, symbols and numbers.. the model in it's raw form. Using Find/search.. look for the first instance of navgrem (type navgrem into the search box). The first navgrem will highlight. Carefully change that to the new name.. in this case, navrnem. Hit the find key again and the next instance will appear. Do the same with that entry. Hit the find key again and the 3rd instance will highlight. Carefully change that entry too. At this stage.. you've changed all your duff ND green lights to DG's red.
Next.. type navredm into the search box then hit FIND. The first instance will highlight.. change that to (in this instance) navgnem. Hit the FIND key again and the next instance will highlight.. do the same with that. Hit the FIND key a 3rd and final time and change that entry.

If you're happy with the nav white.. you can 'save' at this point. If you're not.. follow the same procedure to change the nav white then save. You can nip into FSX and select an aircraft that has used this model to see the fruits of your hard work. If all has gone well, the model will display perfectly with your new lights in place. If FS throws up an error.. you've made an error with one of the entries. Don't panic! :lol: Go back to Notepad++ and re-open the model then check your entries again.. there will be a mistake in one (or more) of them. Alternatively.. bin the model you've changed and start again on the backup you made (making sure you still have a backup) ;)
If you open the sim and the model shows fine.. you'll know you've done it right so close down.. open Notepad++ again and select the next model. The ND AS332 has 2 models for each version.. I presume with and without crew.. so chip away and change the rest. ;)

On some models, you may have to change the interior model (mdl) too but this wasn't necessary with the Puma.. thank goodness :lol: (EDIT: may only be necessary to do the interior model if you're changing prop effects). On other models, the same effect may be used more than once in the model (you'll see this in MCX) and changing these can be a little more hit and miss because you won't know which is which with the model opened in Notepad++. However, effects are numbered in the model (you'll see this in MCX too) so it may still be possible to edit entries with a reasonable amount of confidence. If it all goes pear shaped.. bin what you've done and drag a backup into service. I can't over-estimate the need to backup as you can physically break the model doing this and if you've not made a backup and something goes wrong.. you will have lost it. Don't let this put you off though.. backups are your friend ;)

Use the little paperclip icon in MCX to show your model attachments (where the effects are attached) and selecting one in the dialogue box will highlight it in the model pane so you can see exactly what effect is attached where. All of this only works if there are 3 (or more) effects entries in the mdl (when checking in Notepad++). If there are only 2.. you may not be able to edit. I'd call DG at this point if it came up :lol:

Hope I've not missed anything so give it a go. MAKE BACKUPS FIRST! :thumbsup: If there's anything you're not sure of.. call back. We'll get you sorted ;)

ATB
DaveB B)smk

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 12:38
by DaveG
That looks pretty much correct DB. :) I tend to use the "find and replace" function in Notepad++ and replace all the instances in one go.

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 12:58
by DaveB
Ah.. good one Dave :rock: Not so bad with one model but when there are multiple versions all 'inflicted' with duff lights.. Find and Replace sounds excellent :thumbsup:

Incidentally Ro.. I did the ND EC135's ages ago and checked one of them to see if it looked ok and it was fine. Some time later (weeks) I realised there weren't any 'Medic' versions showing in the 'Choose Aircraft' window. WTF!! :-O I checked the model folders and they were all there.. the cfg entries looked fine so why weren't they showing?? *-) Ah yes.. I changed the lights didn't I but didn't check all the models! I opened the 'Medic' mdl up in Notepad++ then looked for the light entries. Found the error straight away.. 1 letter misplaced on one entry :wall: Edit then save.. Bob's your uncle.. all models showing :cpu: I still had a backup original btw so if I'd not found the error and/or been able to fix it.. I'd not have been up that famous creek without a paddle but this illustrates that one wrong character and the model won't show ;)
Also Ro.. don't get too worried about using MCX if you're not au fait with it. For changing lights like this, you only use it to check which lights are being used and where they are. MCX is open for as long as it takes to load the model, look at the light entries then close it down again. ;)

ATB
DaveB B)smk

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 14:04
by rohan
Gee, thank you kindly, Dave and Dave.

I'm glad I asked because my assumption was that MCX had taken over the role of a hex editor that I know was used in this sort of exercise some time ago. It certainly sounds like it's much easier to find the little strings this way, and I've been using Notepad-like replacements for many years but would never have thought of using one to edit an MDL ...

On the other hand, when I was working, I was the one who had the job of telling almost everyone I met that they should be taking backups, but even more important is to test the backup recovery process every now and then - otherwise how do you know whether your backups are actually going to work properly when you need them ...

Thanks again. I'll grab a copy of the latest version of MCX then have a test / play in a few days,
regs,
Ro
B-)

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 14:52
by DaveB
No problem Ro :thumbsup: Nothing worse than flying something with nuclear powered lights and there are a LOT of em out there :wall:

Notepad++ is easy to use too. I'm a dummy at this sort of thing and if I can use it, almost everyone else will have no problems :lol: I didn't know which version to download and their help page is very good.. 'if you don't know which version you need.. download this one' :cpu: I like that :)
You can 'dry run' a model through it too using FIND. Hit the find button having put the effect name in there and do that 3 times to find the 3 instances. Hit it a 4th time and the box will flash letting you know there are no more instances. If you only find 2.. come back and DG will help you :lol: If you find more than 3 (if the same effect is used elsewhere).. I'm sure DG will offer sound advice. This hasn't happened often for me. One model used the same effect for VC and nav white (so the VC effect was given a dummy name.. of the same number of characters) and the second was where there were 2 nav whites (ND Mil24). You could only see one huge one 'in sim'!! 8) In this instance, both were changed to the 'new' light and hey presto.. 2 tiddly little whites now clearly visible ;)

In reality.. if dev's got this sorted in the first place, we shouldn't be arsing around. Not so bad with freeware because you get what you get but with payware.. one tends to expect these things to be sorted. The ND AS332 having huge lights and worse.. huge lights on the wrong sides is, quite frankly, disgusting :| Anywho.. you'll be able to fix it now ;) I sent Bill Ortis (of Lionheart fame) an email asking if he could change the nav's on the TriPacer and he told me it couldn't be done! I sent him screenshots back of the fixed lights and didn't hear back :lol:

ATB
DaveB B)smk

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 18:46
by rohan
Dave,
There's probably something I don't understand about this process as I seem to have thought of a silly question.

Why can't you just replace the original effect file with a copy of the desired effect file, giving the copy the same file name as the original (in effect overwriting that original) ?

:guinn:

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 19:14
by DaveG
You can do that, but in many cases the files needed to be replaced are default effects.

Re: Plain, white and still ugly

Posted: 14 Jul 2014, 23:26
by rohan
... which work perfectly well in some models but not in this particular case. Since these are, as both you and DaveB have said, default effects, there must be something different within this model that produces such an unwelcome result. I assume that, if you knew where to look, you could edit the code within the model to correct the problem, but because you would be changing actual code rather than an external reference you would almost certainly break the model !

Sorry, but I seem to be having a problem expressing what I'm struggling to understand about these problems and why the solution above works. If default effects work OK in some models but not in others, how is it that your effects work well in both your models and in problematic models like this ?

Or is it that installing these models overwrites (or otherwise substitutes) the default effects with ones of their own design but which retain the same names as the default effects ?

:help:

Re: Plain, white and still ugly

Posted: 15 Jul 2014, 04:18
by Airspeed
Now I have to put my keyboard in the washing machine.
My brain melted all over it, just reading this tech-talk. :rtfm: