You must be logged in to post messages.
Please login or register

Scenario Design and Discussion
Moderated by Sebastien, Mr Wednesday

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Install Script Tutorial: Part 1
posted 11-10-06 00:38 AM CT (US)   
Part 1: Introduction

Before we begin you’ll need tp download the following file from the blacksmith:

http://aok.heavengames.com/blacksmith/showfile.php?fileid=8056

The .zip file contains three elements: The .pdf is the same as this document. The .exe you can unload anywhere. The .txt is a script template you’ll use later. I'd recommend download even for people who don't want to actually follow the tutorial, as it includes a demo scenario you might find entertaining.

So you know where I’m coming from, unzip the .exe and run it. Play the campaign “Install Script Demo Campaign.” Uninstall it by either selecting "Making Angels\Uninstall Making Angels" from your start menu, or running "Uninstall_Script_Demo.exe" from your default AoK folder. When you’re finished, come back.

How did I do all that? Well, in a number of ways. What I want to focus on here, though, is the way that everything was installed and uninstalled. But first, a run down of what happened.

i) The first thing I did was modify the language files. I used resource hacker (http://www.download.com/3001-2352_4-10178588.html) to edit the language.dll and language_x1.dll. This has changed the name of various things, including me, woad raiders (which ultimately became Angel Anastasias), and Tree As (which have always bugged me). Search the modpack forum for info on how to edit the .dll files.

ii) The second thing I’ve done is edit the empires2_x1_p1.dat file. I’ve done a number of things here, including some technology editing (see http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=ct&f=9,35712,0,10), some stat editing using Genied2 Enhanced (http://gesneo.hp.infoseek.co.jp/genied.exe), and some unit graphics editing (see Olly’s guide at http://tsuniversity.com/articlepreview.php?199).

iii) Thirdly, I’ve tweaked the map using AoK Trigger Studio (http://www.digitization.org).

iv) Fourthly, and finally, I replaced a number of resources in graphics.drs, interfac.drs, and sounds.drs. These are the resource files that provide most of the visual and aural information for AoK:TC, and these are the areas I’ll concentrate on in this tutorial.


Credits

Before we continue, though, I need to thank a number of people for their input: Oliver (Pershaf) for his feedback, DiGit (David Tombs) for helping me nut out some problems, Anastasia for pointing me towards NSIS, Ykkrosh for giving me some advice on interface.drs, Stephen Richards for simply being a nice guy, Jorgito_Agua27 for his graphic pack (http://aok.heavengames.com/blacksmith/showfile.php?fileid=7856), which I used for the Tavern building, Derfel Cadarn and Andrew Dunn (Kor and Mechstra) for their inspirational “Age of Chivalry” (http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=ct&f=9,35235,,all and http://aok.heavengames.com/blacksmith/showfile.php?fileid=5400) and soon to be inspirational Hegemony (http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=ct&f=4,36979,0,10), Ballista_Turtle for his adaptation of the Poser graphic, posted as “Female Warrior Princess” (http://aok.heavengames.com/blacksmith/showfile.php?fileid=5241), and my partner Sabrina.

I also need to especially thank all the people whose utilities I’ve used either to create this tutorial or the attached scenario. They are mentioned throughout the text, although Scenario_TC deserves an extra special mention.


The basics: what you’ll need.

Now that’s out of the way, let’s get on with it.

Two key programs were used in this install system. The first is “Nullsoft Scriptable Install System” (NSIS) (http://www.nsis.sourceforge.net/Main_Page). This is a free, open-source install scripting system. Awesome. The second is drsbuild (http://artho.com/age/files/drs.html). This is a very handy program by Stoyan Ratchev, which is only 40k in size, yet can extract, replace and otherwise tweak items in .drs. files. Download them both.

You might also want to download HM NS Edit (http://nsis.sourceforge.net/HM_NIS_Edit), which is a script editor for NSIS scripts. You can use notepad, or any text editor instead, but HM NS Edit makes it so much easier- pretty colours and all.

This is all you need to continue. There are, however, many, many other programs you could use., many of which are listed in the following section.


How this is useful, and some resources

Nowadays, it seems anything is possible with the Genie engine (the genie engine is what runs AoK:TC). You can easily edit the language files using Resource Hacker (http://www.download.com/3001-2352_4-10178588.html). You can edit many of the statistics of any unit using Genied2 Enhanced Version (http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=ct&f=9,36314,,all). You can edit technologies (http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=ct&f=9,36396,,all) using a hex editor such as Hex Workshop (http://www.bpsoft.com/downloads/) in conjunction with DiGit’s impressive AoK Decompressor (http://www.digitization.org/download/zlibnoh.rar). You can also easily change the number of frames in a graphic slot by following Oliver’s straightforward guide (http://tsuniversity.com/articlepreview.php?199).

I hear, though I can’t do it yet, that you can create entirely new units, civilisations and technologies using Genied1 (see http://aok.heavengames.com/cgi-bin/aokcgi/display.cgi?action=ct&f=9,36392,,10).

The problem is that the only self-installing system we have for AoK is Modpack Studio (MPS) (http://aok.heavengames.com/blacksmith/showfile.php?fileid=5537). Don’t get me wrong! This is a fantastic application, but it has some shortcomings. Firstly, to use a MPS mod, the player has to have had MPS installed. Secondly, MPS doesn’t support the backing-up of .dat files, .dll files, or any other files that we might want to change. Thirdly, MPS seems to go haywire if the basic structure of .drs files are changed (i.e. to add an entirely new graphic). Finally, you can’t change the number of frames that the game expects in a .slp file.

This is where the system I’ll be explaining in the following two tutorials is useful.

For, as you have seen, it enables the seamless installation and un-installation of changes to almost every aspect of the game. In a compact package. In the demo, the .dat, the .dll, and the .drs files were all backed up and replaced. Campaign, sound, and other image files were extracted and subsequently moved. All, essentially, at the press of a button. This has quite a lot of potential for scenario designers, because, on top of simplifying the “unzip” system, it allows us to add custom graphics, sounds, and whatever we can possibly imagine to our campaigns and scenarios.

Part 2

Part 3


Don't post if you haven't checked this thread.
I am a card-carrying Tsunami Studios member. | Macbeth | Install Script Tutorial | Nineteen Years... | Put a timer in your scenario!
Piece By Piece (2) Progress Bar: | █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ | Download it now!

[This message has been edited by dave_earl (edited 11-14-2006 @ 04:07 AM).]

Replies:
posted 11-10-06 06:31 AM CT (US)     1 / 21  
instead of posting 3 posts, you could pre type it out in word or something than just copy and paste in rapid succession...mods are gonna be pissed

In A.D. 2101 War was beginning. Captain: What happen? Mechanic: Somebody set up us the bomb. Operator: We get signal. Captain: What ! Operator: Main screen turn on. Captain: It's You !! Cats: How are you gentlemen !! Cats: All your base are belong to us. Cats: You are on the way to destruction. Captain: What you say !! Cats: You have no chance to survive make your time. Cats: HA HA HA HA .... ALL YOR BASE.
posted 11-10-06 07:10 AM CT (US)     2 / 21  
The mods won't be "pissed", Darkjedi.

Very good work, Dave even though, like Stephen, I have no idea about any of it.

posted 11-10-06 07:32 AM CT (US)     3 / 21  
I've been asking alot of people this question and hopfully this thing of yours cna be the answer (I have to questions)

1) is there a way to edit something so that you can change tecnologies so they go backwards? Like what I'm trying to achive is being able say, if you have a crossbowman, then you can research arblast, but then you can research crossbowman again so then it goes back. So you creat a circle going on forever.

2) Is there a way to edit something so that a gold miner, forager etc. (all the other types of villes) so that they can attack something without changing back into a normal ville.

Thanks in advance

Lance O Lot

-ps I'm going to try and figure out that install script thing.

posted 11-10-06 08:35 AM CT (US)     4 / 21  
Now this seems interesting... only one question: how do you uninstall the Angles program? Delete the files or anything else?

__[]_________
|||||||||||||||||
The ||||||||||||||||| Hus
OF | [/ \] |¯| [/ \] | ME
______________________________________________________________________________ |__ _ |¯|____|_______________________________________________________________________________
The Relics of Athalën (5.0) | AoK Opus - 100,000+ downloads | StormWind Studios | "I consider the conversion of Basse to be one of the great triumphs of my modding crusade" - Matt LiVecchi
posted 11-10-06 09:09 AM CT (US)     5 / 21  

Quoted from Lance O Lot:

1) is there a way to edit something so that you can change tecnologies so they go backwards? Like what I'm trying to achive is being able say, if you have a crossbowman, then you can research arblast, but then you can research crossbowman again so then it goes back. So you creat a circle going on forever.


Why do you want to achieve that? I can't imagine anyone wanting to downgrade his units.


          Hussarknight
posted 11-10-06 11:21 AM CT (US)     6 / 21  
It's hard to explain. But I reallyneed to know.

          L a n c e O L o t
               Member of
       My Downloads | I m p e r i a l C r e a t i o n s
        Contact Mee Sig Version 1.6
posted 11-10-06 03:14 PM CT (US)     7 / 21  
Hi everyone,

First off. I was thinking one of the mods might want to close parts two and three so discussion on this subject continues in just one thread. I've added a link at the bottom of this one to the other two.

Basse, there should be an uninstall link in your start menu under Programs-> Making Angels-> Uninstall Making Angels. Otherwise, look in your root AoK directory for "Uninstall_Script_Demo.exe."

Lance, I'm not sure. 1) Have a look at Scenario_TC's tech editing notes in the Modpack forum. I think you'll finf it hard to make a technology able to be researched more than once. 2) Probably not either. If you can, it'd be tricky. Try looking at the "changing unit graphics" stuff.

I'm going on holidays for the next four days or so I probably won't be at the computer till then. Sabrina just reminded me she has a blackberry, so I'll stay in touch!

Regards, Dave.


Don't post if you haven't checked this thread.
I am a card-carrying Tsunami Studios member. | Macbeth | Install Script Tutorial | Nineteen Years... | Put a timer in your scenario!
Piece By Piece (2) Progress Bar: | █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ | Download it now!

[This message has been edited by dave_earl (edited 11-10-2006 @ 03:27 PM).]

posted 11-10-06 03:49 PM CT (US)     8 / 21  
Is there a way to change the unit's class durring the game using a tecnology or something. Because if there is I think I might be able to do question 2.

          L a n c e O L o t
               Member of
       My Downloads | I m p e r i a l C r e a t i o n s
        Contact Mee Sig Version 1.6
posted 11-11-06 07:55 AM CT (US)     9 / 21  
dave, if you haven't already got this in hand, I suggest submitting the whole thing as an article to TSU and the university here.
posted 11-11-06 01:24 PM CT (US)     10 / 21  
A phenomenal tutorial!

Dave:
I must admit that beyond being ecstatic about the world of possibilities this opens up for scenario design enthusiasts, that I was quite touched by the characterization of my AOKH role in the demo campaign. *tear* Of course, I still don't know what to make of the fact that my character keeps getting killed in these types of scenarios! This can't be good, can it?

Anyway, I had to kung fu fight my way to use the computer with the 1.0c patch version on it, and I have yet to create a test file using the tutorial but I plan to ASAP. I guess the first thing I thought upon installing the demo and reading the tutorial was whether or not it's possible to create an install script that will accommodate the other patch version (1.0b if present) within the same script?

The only misgiving I had for the demo was that you didn't explain in the Aftermath message where the uninstall.exe was for the inexperienced user. I also thought about the possibility of creating desktop shortcuts too.

This is the way forward to a new acceptable standard for scenario and campaign creations for both designers and players alike. Thank you for showing us the way!


"I take it that this is the Anastasia Scud pines for?" - Epic Commander
"What Ana said. Use sugar and the whip." - aka the Pilot
"I think you will realize the emphasis was on Ana and Cake." - Monk
posted 11-11-06 01:33 PM CT (US)     11 / 21  
This link don't work correct:http://www.nsis.sourceforge.net

Admiral_Loki

posted 11-11-06 02:02 PM CT (US)     12 / 21  
That's strange it was working when I first read this. Anyway, here is some working links:
Nullsoft Scriptable Install System (NSIS):
http://nsis.sourceforge.net/Main_Page

HM NS Edit (script editor for NSIS scripts):
http://hmne.sourceforge.net/


"I take it that this is the Anastasia Scud pines for?" - Epic Commander
"What Ana said. Use sugar and the whip." - aka the Pilot
"I think you will realize the emphasis was on Ana and Cake." - Monk
posted 11-12-06 09:47 AM CT (US)     13 / 21  
How do you uninstall dave? I reinstalled my Aoc but when I went to edit the dat file in genied2 one unit was still named dave. I think this is because of my langue.dll files. So could someone please send me the orianal.

          L a n c e O L o t
               Member of
       My Downloads | I m p e r i a l C r e a t i o n s
        Contact Mee Sig Version 1.6
posted 11-12-06 12:34 PM CT (US)     14 / 21  

Hey Lance!
I'm not sure this will work now that you've reinstalled the game, but the image shows you how to uninstall the 'Making Angels' Demo.


"I take it that this is the Anastasia Scud pines for?" - Epic Commander
"What Ana said. Use sugar and the whip." - aka the Pilot
"I think you will realize the emphasis was on Ana and Cake." - Monk
posted 11-12-06 04:47 PM CT (US)     15 / 21  
nope it's not there (nice background btw)

Could someone just send me the orignal dll files please.

e-mail = basketball_327@hotmail.com

nvm I got them.


          L a n c e O L o t
               Member of
       My Downloads | I m p e r i a l C r e a t i o n s
        Contact Mee Sig Version 1.6

[This message has been edited by Lance O Lot (edited 11-13-2006 @ 06:58 AM).]

posted 11-12-06 09:05 PM CT (US)     16 / 21  
bleh, no macness. its ok though, ill be getting a new mac that can run boot camp soon, then mabye itll work. looks quite interesting from what i can see, allthough i still have no idea whats going on :P.

In A.D. 2101 War was beginning. Captain: What happen? Mechanic: Somebody set up us the bomb. Operator: We get signal. Captain: What ! Operator: Main screen turn on. Captain: It's You !! Cats: How are you gentlemen !! Cats: All your base are belong to us. Cats: You are on the way to destruction. Captain: What you say !! Cats: You have no chance to survive make your time. Cats: HA HA HA HA .... ALL YOR BASE.
posted 11-13-06 09:11 PM CT (US)     17 / 21  
The utility is at the blacksmith.

To uninstall, button left of your comp, click Start (where the Windows icon is), get your pointer over 'all programs', it is at the button. Put your pointer over 'Making Angels', you get three options to click: play The Conquerors with Making Angels, Uninstall Making Angels and Visit Dave Earl's website.

posted 11-14-06 04:06 AM CT (US)     18 / 21  
Hi everyone,

The file's been approved at the Blacksmith so I've removed the RapidShare link. Hate that site, anyway!

Quoted from darkjedilarry:

bleh, no macness.

That is definitely a shortcoming with this system. I actually know nothing whatsoever about Macs, but I can't imagine that these kind of install scripts would ever work on a Mac.

Quoted from Angel Anastasia:

The only misgiving I had for the demo was that you didn't explain in the Aftermath message where the uninstall.exe was for the inexperienced user.

Yes, I noticed that myself as soon as I saw Lance's post. I'm planning an update in a few days with that amendment as well as a readme.txt in the zip file.

Quoted from Angel Anastasia:

I also thought about the possibility of creating desktop shortcuts too.

Personally, desktop shortcuts make me want to cry. However, it would be dead easy to do. Include something like:

 CreateShortCut "$DESKTOP\${CAMPAIGN_NAME}\Play The Conquerors with ${CAMPAIGN_NAME}.lnk

After line 247, for a "Play with..." icon, and include something similar to:

CreateShortCut "$DESKTOP\${CAMPAIGN_NAME}\Uninstall ${CAMPAIGN_NAME}.lnk" "$INSTDIR\${UNINSTALLER_NAME}.exe"

For an uninstall shortcut.

One thing that I've been experimenting with, though didn't bother including in the tutorial because it gets a bit complicated and isn't so useful, is a "components" option. i.e., after the EULA page, the user is presented with a number of checkboxes allowing them to choose which sections of the uninstall they want. They could then be given the option of installing start menu and desktop icons. Of course, they could be offered the option of, say, not installing changes to the .dll files, or the .drs files, or whatever. But allowing that kind of option would, I imagine, kind of ruin the point of the system.

On a side note, all of this should work just as well for AoM, AoE or SWGB, though some of the default files will need to be changed.

On reflection, there's a few problems with the system which I haven't quite resolved.

The first is with .drs build. I've found that on occasions .drs build encounters troubles with .drs files, giving an "Error 5: Cannot read file" (or something similar) message. This seems to occur if the file has been somehow corrupted. I think MPS studio does this. It's hard to notice when this has happened, as the game itself seems to struggle valiantly on even if there is a problem with the file's structure. However, Drsbuild doesn't cope so well with this problem, and simply aborts whatever it is doing. The result is that the changes to the .drs file don't actually occur, but the installer still tells the user that "Installation was successful". I am trying to find a work around for this.

The second big issue is multiple installation. If someone runs the install file twice, the installer will effectively copy over the backup files, hence permanently installing the mod. I've been thinking about a work-around for this, and it should be straight forward. However, I've been away for the last few days, and real life will intervene for the next few days. Expect a solution in about five days or so.

A final issue, and one that's been bugging me since I started writing this tutorial, is the issue of unscrupulous or incompetent scripters. Basically, the inclusion of exe files at the Blacksmith is an open door to the spread of viruses (just include one to be written as part of the install script). Worse, perhaps, is that if a new or incompetent scripter writes a script which fails to back-up files correctly, or writes the uninstaller section wrongly, then they could seriously break other people's AoKs. In theory, this is not a problem, as we all have the re-installation discs handy. In practice, this could become an issue.

Oliver tells me that there's been some murmurs on msn that the system corrupts .dat files or otherwise has trouble coping with different patch versions. This may well be the case. I have "Gold Edition" so C patch is automatically installed for me. The next stage, I suspect, is to make the installer check that C patch is actually installed, or installation is disallowed. This should be quite straightforward to solve, and I imagine a solution similar to the double-installation problem. In the long term, the installer could include several different .dat files, and choose the correct one to install based on the configuration of the AoK files on the user's computer. I won't be trying to do that, of course, because I only work with C patch.


Quoted from Angel Anastasia:

I guess the first thing I thought upon installing the demo and reading the tutorial was whether or not it's possible to create an install script that will accommodate the other patch version (1.0b if present) within the same script?

As I'm not really familiar with the format of 1.0b, I can't really comment.


Quoted from Admiral Loki:

This link don't work correct: http://www.nsis.sourceforge.net

</a>

I'm just about to fix that, and the AoK Trigger Studio link.

Quoted from Stephen Richards:

dave, if you haven't already got this in hand, I suggest submitting the whole thing as an article to TSU and the university here.

Hi Steve. Of course, Tsuniversity's welcome to the tutorial. If the relevant person could contact me I'd happily forward him or her a copy of the tutorial in the appropriate format. In return, of course, I'd want a flashy blue "VIP" tag when I visit the Tsunami forums, rather than the boring old black "guest: tag ... For now, however, I suspect AoK Heaven is happy with its "exclusive" presence.

Any other problems, ideas, or issues? I'd love to know.

Regards,

Dave.


Don't post if you haven't checked this thread.
I am a card-carrying Tsunami Studios member. | Macbeth | Install Script Tutorial | Nineteen Years... | Put a timer in your scenario!
Piece By Piece (2) Progress Bar: | █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ | Download it now!

[This message has been edited by Dave_Earl (edited 11-18-2006 @ 07:53 AM).]

posted 11-14-06 05:12 PM CT (US)     19 / 21  

Quote:

Worse, perhaps, is that if a new or incompetent scripter writes a script which fails to back-up files correctly, or writes the uninstaller section wrongly, then they could seriously break other people's AoKs.

Someone (like you Dave) should just create a back up exe with all the orginal files and put it in utilites in the blacksmith. That way if anyone messes up all their files they can just download that and cha ching, back to normal.

-Lance O Lot

posted 11-15-06 03:16 AM CT (US)     20 / 21  

Quote:

Personally, desktop shortcuts make me want to cry.

*laughs* I think that was a temporary lapse of sanity on my part too.

Quote:

The second big issue is multiple installation. If someone runs the install file twice, the installer will effectively copy over the backup files, hence permanently installing the mod.

This happens with other programs too, and I don't think we should take on the responsibility of the user to that degree. At some point you have to say if all else fails, there's the CD.

Quote:

Oliver tells me that there's been some murmurs on msn that the system corrupts .dat files or otherwise has trouble coping with different patch versions. This may well be the case. I have "Gold Edition" so C patch is automatically installed for me.

You indicated the need for C patch well enough for me. However, a feature to search for it would be that much better. 1.0b patch can be altered using the same procedures with drs build and all. I have the older version of the game and Gold edition. Right now I have my one version set up with 1.0b only...I would think that C patch is C patch, but perhaps I can help with testing any new developments in the future. The difference aside from what is patched is the name of the file. Ykrosh might be able to help because the GeniEd2 program seems to accommodate all patches.



"I take it that this is the Anastasia Scud pines for?" - Epic Commander
"What Ana said. Use sugar and the whip." - aka the Pilot
"I think you will realize the emphasis was on Ana and Cake." - Monk
posted 11-15-06 07:11 AM CT (US)     21 / 21  

Quote:

That is definitely a shortcoming with this system. I actually know nothing whatsoever about Macs, but I can't imagine that these kind of install scripts would ever work on a Mac.


yeah, from what I can understand, macs have entirely different scriping requirements(if thats what you call it).

In A.D. 2101 War was beginning. Captain: What happen? Mechanic: Somebody set up us the bomb. Operator: We get signal. Captain: What ! Operator: Main screen turn on. Captain: It's You !! Cats: How are you gentlemen !! Cats: All your base are belong to us. Cats: You are on the way to destruction. Captain: What you say !! Cats: You have no chance to survive make your time. Cats: HA HA HA HA .... ALL YOR BASE.
Age of Kings Heaven » Forums » Scenario Design and Discussion » Install Script Tutorial: Part 1
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames