UFO:Alien Invasion

General => User modifications => Topic started by: tobbe on April 11, 2010, 04:56:35 pm

Title: Problems modding weapons and techtree
Post by: tobbe on April 11, 2010, 04:56:35 pm
Hi, i am trying to modify some weapon and tech scripts a little bit and i encountered some problems i wasnt able to find a solution via the wiki...maybe somebody around could help?

1. I want to move some initial weapons (and their tech) to a later time in the campaign. I removed the entries (e.g. riotshot gun) in researched list, equipment campaign_player and equipment campaign_initial_market, but i still start with a riot shotgun...any way to change this without coding?

2. I want to move some starting techs (e.g. combat armor) to a later time by adding a research_AND...but every time i try this, the geoscape crashes and i dont understand why.

3. I want to use the multiplayer weapons (changed of course) in the campaign...i changed the research time to 0 (in research.ufo), moved the entries from weapons_multiplayer.ufo to weapons_human.ufo. that seems to work kind of...but once i change the research value to a positve value, geoscape crashes again.

The geoscape chrash happen in two ways:
a) once i start a new campaign, i build my first base, it is placed, but cant be chosen. Every time i try to pick the base, a new base will be built. (most of the time)
b) geoscape wont appear at all (rare)
Title: Re: Problems modding weapons and techtree
Post by: Mattn on April 11, 2010, 05:20:19 pm
sorry, but "geoscape crashes" isn't enough info - there should be console output, we need that.
Title: Re: Problems modding weapons and techtree
Post by: Destructavator on April 11, 2010, 05:22:08 pm
What version of the game are you trying to modify?

Edit:  And yes, many of the messages that appear in the console (and log file in your APPDATA path) will give info that will help with where you went wrong - For example, if you incorrectly alter a research .ufo script, the console may give a specific error message that helps determine what happened.

Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 11, 2010, 05:32:36 pm
sorry, but "geoscape crashes" isn't enough info - there should be console output, we need that.

well, the problem is that there arent any "real" error messages or obvious console messages...as i wrote: mostly the game wont accept the first base placement...but i will repeat my modding again and will try to access the console...but how do i get to the console??

version: 2.3 r29222
Title: Re: Problems modding weapons and techtree
Post by: Destructavator on April 11, 2010, 05:34:37 pm
Please read through the wiki - it describes how to use the console, what commands you can use to test things, and where the log file is saved when/if the program crashes or malfunctions.
Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 11, 2010, 05:39:48 pm
Please read through the wiki - it describes how to use the console, what commands you can use to test things, and where the log file is saved when/if the program crashes or malfunctions.


well, already tried that...but i will try again...:)
Title: Re: Problems modding weapons and techtree
Post by: Destructavator on April 11, 2010, 05:41:15 pm
It should be in the wiki...  If not, well - Hang on a sec...

Here:
http://ufoai.ninex.info/wiki/index.php/Console

At the end of that entry are two links that give more information on what you can do in the console.
Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 11, 2010, 07:03:31 pm
It should be in the wiki...  If not, well - Hang on a sec...

Here:
http://ufoai.ninex.info/wiki/index.php/Console

At the end of that entry are two links that give more information on what you can do in the console.


tyvm...i will try to reproduce the errors :)
Title: Re: Problems modding weapons and techtree
Post by: Mattn on April 11, 2010, 07:11:02 pm
please also see this http://ufoai.ninex.info/wiki/index.php/Bugs

the ufoconsole.log might help us to help you ;)
Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 11, 2010, 07:43:28 pm
ok, i will do my very best :) i will keep you informed...one last thing about this: should i post possible errors to the bugtracker? as these errors are not from game itself, but errors by changing the scripts?!

but for my problem 1: i think i just forgot to remove/change something...maybe somebody with a better knowlegde about the scripting funktions might help me, as it isnt really an error:

i want to move some of the initial weapons to a later time (by adding a research_AND to the tech)...i already did:

1. remove the item and its ammo from the equipment campaign_player list in equipment.ufo
2. remove the information researched rslist_phalanx in researched_list.ufo
3. add the researched_AND to the tech

it works so far quite ok, as the tech is not shown in the ufopedia anymore and there are no weapons on the market to buy.

But there are still soldiers equiped with the weapons, though they are labeled "unknown - not usable"...so i think i just forgot to change one link to the scripts...but where?
Title: Re: Problems modding weapons and techtree
Post by: Mattn on April 11, 2010, 07:58:00 pm
depends - if you have a bug due to script changes, first post it here - if it turns out to be an engine bug, it should go to the tracker. if you are making script changes, you should use svn and post patches (svn diff base/ufos > myPatch.diff or Tortoise Diff feature). looking at the patch might help us to find the errors in the changes (if there are any)
Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 11, 2010, 09:25:00 pm
depends - if you have a bug due to script changes, first post it here - if it turns out to be an engine bug, it should go to the tracker. if you are making script changes, you should use svn and post patches (svn diff base/ufos > myPatch.diff or Tortoise Diff feature). looking at the patch might help us to find the errors in the changes (if there are any)

Well, to use SVN i would have to understand how that works...and i have absolutely no clue about coding or using SVN^^ I will have to have a closer look at the tutorials about using SVN...that will take some time ;)

For now, the information about the console were already REALLY helpful as i identified my main source of troubles: i removed items from the researched list without removing them from initial campaign equipment...that caused most of my crashes :)
Title: Re: Problems modding weapons and techtree
Post by: Destructavator on April 11, 2010, 09:34:06 pm
SVN is actually rather simple - If you can figure out playing around with the .ufo script files you shouldn't take too long getting an SVN client and making it work.

Knowing how SVN works doesn't really need coding knowledge, myself I figured it out before learning anything about C or C++ (the languages this project is written in).

Compiling the game though - on Windows - from SVN can be a bit more difficult though.  If you get stuck on any step doing that, let us know where things fell apart.
Title: Re: Problems modding weapons and techtree
Post by: Legendman3 on April 11, 2010, 09:52:46 pm
Yah i know nothing about coding but i could use SVN fine. I mean nothinnnnnnnnnnnnnnnng about coding thats how simple it is.
Title: Re: Problems modding weapons and techtree
Post by: DiDiT on April 11, 2010, 11:30:00 pm
dave and legand are right, the svn is preaty simple, even on windows.

then again, you could always just get mutons build script and use the svn in that...
Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 12, 2010, 03:50:34 pm
ok, almost there^^

i installed the SVN and downloaded the source...if i understood the idea of SVN correctly, i should be able to make my changes to the script files and build them into a patch?

i could use some advice how to proceed...TIA.
Title: Re: Problems modding weapons and techtree
Post by: Legendman3 on April 12, 2010, 11:41:29 pm
Look here for how to make new/edit research things.

http://ufoai.ninex.info/wiki/index.php/UFO-Scripts/research.ufo
Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 13, 2010, 02:19:30 am
Look here for how to make new/edit research things.

http://ufoai.ninex.info/wiki/index.php/UFO-Scripts/research.ufo

tyvm for your try to help...but unfortunately i already read through that article...

Modifying the script files isnt the info im looking for, i already modified about 80% of the PHALANX weaponry and im runnig the first time game right now...

Im looking for a good way to form the modified script files into a patch (with SVN?!) or something...thats were im lost...
Title: Re: Problems modding weapons and techtree
Post by: Mattn on April 13, 2010, 07:57:54 am
you installed tortoise svn? select the base/ufos directory, right click on the dir and select create patch from the context menu.
Title: Re: Problems modding weapons and techtree
Post by: tobbe on April 13, 2010, 09:58:30 am
you installed tortoise svn? select the base/ufos directory, right click on the dir and select create patch from the context menu.

oh my...i really was THAT easy...

Creating a patch like this means that only persons with a SVN program will be able to use the modifications, right?
Title: Re: Problems modding weapons and techtree
Post by: MCR on April 13, 2010, 10:34:28 am
If you want to create a test version for everyone to try, you should read about how pk3s work  ::):

http://ufoai.ninex.info/wiki/index.php/Pk3
Title: Re: Problems modding weapons and techtree
Post by: geever on April 13, 2010, 10:55:06 am
oh my...i really was THAT easy...

Creating a patch like this means that only persons with a SVN program will be able to use the modifications, right?

No. This patch format is called unified diff (http://en.wikipedia.org/wiki/Unified_diff#Unified_format) quite much programs can use them (like GNU patch).

-geever
Title: Re: Problems modding weapons and techtree
Post by: tobbe on May 18, 2010, 12:04:28 pm
New question, working with SVN...i simply dont understand the program :(

I modded some of the ufos files (got working copy) and i want to compare them with the newest files in the trunk and probably merge them...but i simply cant do it?

Can somebody give me a detailed walktrough how to do this?
Title: Re: Problems modding weapons and techtree
Post by: MCR on May 18, 2010, 04:57:40 pm
Many ways to do this.
For example:
Overwrite the old files in your svn working copy directory of UFO:AI.
Use the explorer tortoise function 'svn check for modifications'.
Title: Re: Problems modding weapons and techtree
Post by: chulhee on June 15, 2010, 03:43:07 am
I want to use the multiplayer weapons (changed of course) in the campaign...i changed the research time to 0 (in research.ufo), moved the entries from weapons_multiplayer.ufo to weapons_human.ufo. that seems to work kind of...but once i change the research value to a positve value, geoscape crashes again

Title: Re: Problems modding weapons and techtree
Post by: Mattn on June 15, 2010, 07:12:28 am
with which message does it crash?