UFO:Alien Invasion

General => User modifications => Topic started by: Moon_Dew on October 03, 2013, 03:29:30 pm

Title: How do I increase starting money?
Post by: Moon_Dew on October 03, 2013, 03:29:30 pm
First-time poster, recent player.

Like it says on the tin, how do I increase the amount of money I start with?  I know it has something to do with the difficulty coding, but I'm not sure.
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 03, 2013, 06:31:51 pm
BUMP

Okay, I think I know what to do to modify the code, the only problem is I don't know how to unpack the ufo files.  How does one unpack a PK3 file?
Title: Re: How do I increase starting money?
Post by: AntJam on October 03, 2013, 07:06:39 pm
I believe they are just zip files 7zip opens them fine, or try renaming to .zip
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 03, 2013, 07:26:16 pm
I believe they are just zip files 7zip opens them fine, or try renaming to .zip

I don't know how to rename the files, and everytime I try to download 7zip I get a bunch of crap browser add-ons and no 7zip.
Title: Re: How do I increase starting money?
Post by: MonkeyHead on October 03, 2013, 09:24:02 pm
You need WinRar.
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 03, 2013, 09:34:31 pm
You need WinRar.

I got WinRar...now what?
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 03, 2013, 11:18:15 pm
BUMP

WinRar doesn't work.  Will someone either tell me how to unpack it manually, the name of an unpacking program, or how to rename the file?

Found a file that seems to work so far, it's called PakScape.

EDIT

Okay, now I have access to the code.  How do I change the code in order to give me more starting money, and how do I get the code to work?
Title: Re: How do I increase starting money?
Post by: DarkRain on October 04, 2013, 02:35:46 am
Wait, you mean you don't know how to rename files in your system? (I'd assume that right-click ==> rename would work almost anywhere you can run the game on)
No offence, but, are you sure you up for the slightly more complex task of modding the game?

Anyway, you'll have to learn the UFO-Scripts (http://ufoai.org/wiki/UFO-Scripts) specifically campaign.ufo (http://ufoai.org/wiki/UFO-Scripts/campaign.ufo)
(Hint: search for 'credits', and pay attention to which campaign are you making changes to)

Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 04, 2013, 07:10:06 pm
I'm not really sure what you mean by "rename", do you mean change it from PK3 to Zip, or to literally change the name?

Oh, and I meant to say this earlier, but I'm using the Win32 release of v2.4.
Title: Re: How do I increase starting money?
Post by: DarkRain on October 05, 2013, 01:35:30 am
In fact, in order to change a file's extension (in this case pk3 to zip) you need to rename the file -- of course windows systems have the tendency to hide the file extension from you, but usually only for known file types, I don't think that pk3 would be a known file type in most systems (btw not knowing what type of file you are opening is a security risk)

That aside, did you find the campaign.ufo file among the extracted files? And were you able to make the desired modifications?
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 05, 2013, 02:24:46 pm
In fact, in order to change a file's extension (in this case pk3 to zip) you need to rename the file -- of course windows systems have the tendency to hide the file extension from you, but usually only for known file types, I don't think that pk3 would be a known file type in most systems (btw not knowing what type of file you are opening is a security risk)

That aside, did you find the campaign.ufo file among the extracted files? And were you able to make the desired modifications?

I found them, and, using PakScape, I was able to make the modifications...but they didn't work.  The game still worked, but it was still the plain vanilla version instead of the modded version.
Title: Re: How do I increase starting money?
Post by: DarkRain on October 05, 2013, 03:34:56 pm
Some things come to mind
1. If you extracted the file check that the it is in the right directory (*.ufo files must be in a directory called 'ufos' within the 'base' directory, see the link above about ufo scripts)
2. if you added the modified file back to the pk3 check that it was added correctly
3. Double check that you modded the right campaign? (If you mod the 'standard' campaign and then chose the very 'easy one' for your game you won't see any difference oc)
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 05, 2013, 05:47:43 pm
I don't even know how to extract it!  WinZip isn't working, WinRar isn't working, 7zip isn't working, PakScape doesn't seem to work, and I can't even rename the file!
Title: Re: How do I increase starting money?
Post by: DarkRain on October 05, 2013, 08:05:06 pm
...
...
...

Sorry, but there's only so much we can do to help you if you don't even know how to rename a file, even if the file extension is for some reason hidden when you try to rename the file, a quick Google search for "show file extension windows <insert version here>" would have given you literally thousands of pages that explain step by step how to disable that "feature", allowing you to change the file's extension while renaming it, so... really?

But since I'm feeling helpful today: here (http://sourceforge.net/p/ufoai/code/ci/ufoai_2.4/tree/base/ufos/campaign.ufo?format=raw), that's a link to the original campaign.ufo in our repository, get it, make your changes, put it in the directory that I mentioned before (you'll probably have to create the 'ufos' directory, I really hope you can figure how to do that yourself), that should be enough for what you want.
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 05, 2013, 08:36:56 pm
I probably do know how, but just to be sure, you mean making a new folder, right?

EDIT

Okay, I'm getting some bull-crap about permissions and what not.  I don't really know what to do here since I really, really don't like messing with options like that (my computer's buggy enough as is, you know.)  How do I get the permissions I need?

Oh, and guys, thanks for being patient with me so far.
Title: Re: How do I increase starting money?
Post by: DarkRain on October 06, 2013, 12:31:34 am
Yes, I mean making a new folder.

As for the permissions, I don't know which version of windows you are using, but I think you need to login as an administrator or run windows explorer with admin rights, alternatively you can try going to ufoai's appdata folder (check the location for your version here (http://ufoai.org/wiki/FAQ#General)) and create the 'ufos' folder in the 'base' folder there and put the modded file in it
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 06, 2013, 01:38:56 am
I've tried editing the ufoai's appdata folder...didn't work.  Will editing the campaign file affect all game modes, or just simple campaign?  Because I've been trying to give myself more startup money in the full campaign...the only thing I've got so far is a headache.

EDIT

Okay, managed to change the PK3 file to a ZIP file...still can't extract the thing.

For future reference, I'm using Windows 7.
Title: Re: How do I increase starting money?
Post by: DarkRain on October 06, 2013, 08:49:45 pm
Well, if you were unable to create a new folder in the game's folder I'd guess winzip would be unable to add the extracted files to it, did you try to run it with admin rights?

If you can't get admin rights, then the only option is to put the mod in the appdata folder, it should work, where exactly did you put the file?

Also, can you find the file called ufoconsole.log (see the FAQ I linked above), and may I have a look at it?
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 07, 2013, 12:11:25 am
I put the file here: C:\Users\Owner\AppData\Roaming\UFOAI\2.4\base\ufos  (ufos is the directory name I named in order to get it to work...or so I hoped.)

The log is attached to the post.

As to the admin rights thing, I may have been, but I'm not sure.  How do I get admin rights?

Man, I can't believe one tiny little change is causing so much trouble.
Title: Re: How do I increase starting money?
Post by: DarkRain on October 07, 2013, 12:54:13 am
Found these errors in your log:
Code: [Select]
2013/10/06 08:34:47 Com_ParseBlock: unknown token 'robot_base' ignored (robot_base)
2013/10/06 08:34:47 Com_ParseBlock: unknown token '7500;' ignored (7500;)
2013/10/06 08:34:47 Com_ParseBlock: unknown token 'robot_rankbonus' ignored (robot_rankbonus)
2013/10/06 08:34:47 Com_ParseBlock: unknown token '0;' ignored (0;)
2013/10/06 08:34:47 Com_ParseBlock: unknown token 'admin_robot' ignored (admin_robot)
2013/10/06 08:34:47 Com_ParseBlock: unknown token '150;' ignored (150;)
2013/10/06 08:34:47 Com_ParseBlock: unknown token 'robot_base' ignored (robot_base)
2013/10/06 08:34:47 Com_ParseBlock: unknown token '7500;' ignored (7500;)
2013/10/06 08:34:47 Com_ParseBlock: unknown token 'robot_rankbonus' ignored (robot_rankbonus)
2013/10/06 08:34:47 Com_ParseBlock: unknown token '0;' ignored (0;)
2013/10/06 08:34:47 Com_ParseBlock: unknown token 'admin_robot' ignored (admin_robot)
2013/10/06 08:34:47 Com_ParseBlock: unknown token '150;' ignored (150;)
There seems to be a typo in your campaign.ufo -- probably the moded version in the appdata folder (i'd double check it, that might be the reason it doesn't work)

As for how to run a program with admin rights: link to microsoft (http://windows.microsoft.com/is-is/windows7/how-do-i-run-an-application-once-with-a-full-administrator-access-token)
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 07, 2013, 02:29:07 pm
Think you could fix those while I re-install the game?
Title: Re: How do I increase starting money?
Post by: DarkRain on October 07, 2013, 05:31:09 pm
May I have a look at your moded campaign.ufo? I might be able to tell what went wrong.

Incidentally, if you are planning to reinstall the game, you might want to install it in some place you have full access, that would get rid of all those permission problems.
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 07, 2013, 07:04:27 pm
I know that there's a debug command that gives me money?  Is that command available in the development version (2.5 and the nightly builds)?
Title: Re: How do I increase starting money?
Post by: lycanreaver on October 07, 2013, 11:27:05 pm
yes, go into console and type debug_fullcredits     youll get max amount of credits
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 07, 2013, 11:33:00 pm
yes, go into console and type debug_fullcredits     youll get max amount of credits

That's it?  I don't have to modify anything?
Title: Re: How do I increase starting money?
Post by: DarkRain on October 08, 2013, 12:23:51 am
Of course debug commands are only available in debug builds (dev version nightly) Note that the new UI in 2.6-dev --which is under heavy development-- is currently in an unplayable state, and the 2.5 nightly builds (which aren't currently available, but that will be fixed ASAP) are compiled in release mode
Title: Re: How do I increase starting money?
Post by: Moon_Dew on October 08, 2013, 12:32:34 am
Of course debug commands are only available in debug builds (dev version nightly) Note that the new UI in 2.6-dev --which is under heavy development-- is currently in an unplayable state, and the 2.5 nightly builds (which aren't currently available, but that will be fixed ASAP) are compiled in release mode

Where can I get a debug version of the latest release of 2.5?
Title: Re: How do I increase starting money?
Post by: Gnombane on October 08, 2013, 10:31:24 am
Hello,
i will use this topic so i don't have to open new one :)
I was wondering the same: Where i can get playable version of 2.5, latest release possible?
Title: Re: How do I increase starting money?
Post by: Mattn on October 08, 2013, 04:54:19 pm
http://ufoai.org/forum/index.php/topic,8007.msg60518.html#msg60518
Title: Re: How do I increase starting money?
Post by: geever on October 08, 2013, 10:36:18 pm
Found these errors in your log:

...

It is not an error, he probably have the 2.4 stable release where the UGVs are disabled / partially removed but some script entries were left behind. It is nothing more that noise.

-geever
Title: Re: How do I increase starting money?
Post by: kvetchus on November 10, 2013, 10:33:37 pm
I've been around playing various releases for, oh, 5 years or so now, but never created a forum account.  Since I've tried the game vanilla and spent a good bit of time fooling around with the .ufos as well, I thought I'd give you some advice...

1:  You don't need a special program to unzip the .pk3 files.  They are ZIP.  If you change their name to give them a .zip extension, you'll be able to extract them.  MAKE A COPY OF THE ORIGINAL FILE, but give it a different name.  I use 7z, so to make sure the game doesn't try to get the original files I call it ufos-original.7z

2:  (wait, what do you mean "make sure the game doesn't try to get the original files" ???)  - glad you asked.  If you simply extract the files, say, to base/ufos/* -- which is where you should put them (that means, create the directory) but leave the original pk3 file where it is, you're modifications will be read (or perhaps ignored? not sure of the parse order or precedence), and immediately overwritten by the original configuration.  That means, you have to either hide the originals (by renaming the ufo.pk3 file) or deleting it (not recommended - you may want to revert to the original configuration at some point if/when you make some change that crashed your game...)

3:  To increase your starting money, after you'd got your ufo files sorted out right, open campaign.ufo in a text editor (not Word!!! use a text editor or developer IDE. I use Sublime Text 2, but TextPad is a good one, NotePad++ etc) then, either pick a difficultly level or copy and paste one - make sure to change it's name - then find the line for "credits" and change the number.  Keep in mind, the max money you can have is 10,000,000 credits.

You can go on an edit all sorts of other things, but once you've made your armor impenetrable, gave all your guys Superhuman (100+) stats, make your interceptors fly as quantum speeds, invulnerable and insta-killers, made your guns shoot (effectively) infinite ammo at 1 TU per shot across the whole map with no spread...  (etc etc etc), just keep in mind, it's fun at first for sure to one-hit every alien with reaction fire from 5000 yards... but the game isn't finished, so it gets boring VERY fast when the battles aren't really a challenge.
Title: Re: How do I increase starting money?
Post by: Duke on December 03, 2013, 01:19:15 am
kvetchus,
you seem to be good in writing docs. May I encourage you to write more articles like the above to be incorporated in our wiki ? Plz help to make ufoai docs to be what the game deserves !
Title: Re: How do I increase starting money?
Post by: geever on December 05, 2013, 10:15:51 pm
2:  (wait, what do you mean "make sure the game doesn't try to get the original files" ???)  - glad you asked.  If you simply extract the files, say, to base/ufos/* -- which is where you should put them (that means, create the directory) but leave the original pk3 file where it is, you're modifications will be read (or perhaps ignored? not sure of the parse order or precedence), and immediately overwritten by the original configuration.  That means, you have to either hide the originals (by renaming the ufo.pk3 file) or deleting it (not recommended - you may want to revert to the original configuration at some point if/when you make some change that crashed your game...)

^ this point is misleading though. Extracted files override the packed ones.

-geever