General > User modifications
Couple of questions
Neonin:
Just a couple of questions I have regarding the extent of modding capabilities currently available, so I know how far I can go in editing stuff without touching the code files and recompiling:
1 - Is there any way of editing the files that contain ufopaedia text and mail messages? I've found the .mo files in the i18n directory but it doesn't edit properly with Notepad or Wordpad.
2 - Is it possible to add new base defence buildings using tweaked, existing models? I tried and had the building showing up no problem but ran into an issue with assigning the weaponry.
3 - Are the skills hard-coded or is it possible to change them? I can change the name they appear with but the equipment window still shows Skill: Sniper even after it's been changed to Pistols because it seems to be pulling the information from the weapon script file where the skill type is set for that firedef rather than a string from somewhere else.
Having a blast playing around with the modding opportunities even with these queries, so thanks for adding the possibility to the game! :D
H-Hour:
--- Quote from: Neonin on July 06, 2012, 11:36:06 am ---1 - Is there any way of editing the files that contain ufopaedia text and mail messages? I've found the .mo files in the i18n directory but it doesn't edit properly with Notepad or Wordpad.
--- End quote ---
This is something we've been working on improving, but I'm not sure if it's there yet. Currently, all text is uncompiled .po files which are then compiled into .mo files used by the game. You can edit the .po files but you would have to distribute new, compiled .mo files with your mod -- and these contain all the translations as well, so could limit your mod to just English.
We're hoping to make it possible to put this text directly into the script files or allowing you to use .po files for a mod, but I don't think this has been implemented yet.
--- Quote from: Neonin on July 06, 2012, 11:36:06 am ---2 - Is it possible to add new base defence buildings using tweaked, existing models? I tried and had the building showing up no problem but ran into an issue with assigning the weaponry.
--- End quote ---
Hmm, I suspect this is a more tricky issue because the base buildings are integrated into click commands that open windows and are used in the backend. That said, it looks like it may be possible to add another laser OR missile battery building. The code for the missile battery is:
--- Code: ---building building_missile
{
name "_Missile Battery"
image "base/missile"
fixcosts 10000
depends building_command // need to know where to shoot
type "missile"
build_time 3
varcosts 5000
map_name "missile"
tech rs_building_missile
max_count 4
onconstruct "add_battery missile"
onenable "basedef_updatebatteries missile"
ondisable "basedef_updatebatteries missile"
ondestroy "remove_battery missile"
}
--- End code ---
Just guessing, but you may be able to add a building like this and just change max_count if you wanted to add more missile batteries per building. But I don't think you could create a new "type" (laser or missile) as that would require changes to the backend.
--- Quote from: Neonin on July 06, 2012, 11:36:06 am ---3 - Are the skills hard-coded or is it possible to change them? I can change the name they appear with but the equipment window still shows Skill: Sniper even after it's been changed to Pistols because it seems to be pulling the information from the weapon script file where the skill type is set for that firedef rather than a string from somewhere else.
--- End quote ---
Not quite sure if I'm understanding you. The soldier skills -- the possible skills that each soldier has -- are hard coded because they interact with all sorts of things in the battlescape code. I don't think it's possible to create a new skill.
However, you can change which of the existing skills each firemode uses. Here's the sniper weapon and ammo firemodes with comments (/* comment */) to explain a few things:
--- Code: ---item sniper
{
name "_Sniper Rifle"
model "weapons/sniper/sniper"
weapon true
/* This type parameter does not effect firemode or skill. It only effects how the weapon will be held by the model in-game. */
type "rifle"
animationindex 1
holdtwohanded false
firetwohanded true
shape "2 0 3 1"
shape "0 1 5 1"
center "9 0 3"
scale 1.05
ammo 8
reload 15
reloadsound "weapons/reload-sniper"
price 1300
size 60
is_primary true
}
item sniper_ammo
{
name "_Sniper Rifle Magazine"
model "weapons/sniper/sniper_clip"
type "ammo"
animationindex 0
shape "0 0 1 2"
center "0 0 0"
scale 1.15
price 85
size 8
is_primary true
dmgtype "normal"
weapon_mod
{
weapon sniper
firedef
{
name "_Snap Shot"
/* This skill parameter is where you would change it to one of the pre-existing weapon skill types */
skill "assault"
projtl bullet_sniper
impact bulletImpact
hitbody null
firesnd "weapons/bullet-sniper"
impsnd "impact/bullet-impact"
bodysnd "impact/bullet-bodyimpact"
speed 3600
spread "2.5 2.5"
crouch 1
range 100
shots 1
ammo 1
time 15
damage "130 20"
dmgweight "normal_medium"
reaction true
throughwall 1
}
firedef
{
name "_Aimed Shot"
/* This skill parameter is where you would change it to one of the pre-existing weapon skill types */
skill "sniper"
projtl bullet_sniper
impact bulletImpact
hitbody null
firesnd "weapons/bullet-sniper"
impsnd "impact/bullet-impact"
bodysnd "impact/bullet-bodyimpact"
speed 3600
spread "0.85 0.85"
crouch 0.6
range 100
shots 1
ammo 1
time 20
damage "130 20"
dmgweight "normal_medium"
reaction true
throughwall 1
}
}
}
--- End code ---
You can see many of the weapon settings defined in our wiki.
geever:
--- Quote from: Neonin on July 06, 2012, 11:36:06 am ---2 - Is it possible to add new base defence buildings using tweaked, existing models? I tried and had the building showing up no problem but ran into an issue with assigning the weaponry.
--- End quote ---
Could you explain it in details? It's not 100% clear what you wanted to achieve, maybe with patches, and details I could help.
-geever
Neonin:
Thanks for the responses guys :) I think you've cleared most things up, I'm going to have a fiddle with base defence buildings again and see if I can bodge a workaround using existing types. Basically I was trying to add a new type of battery, I think if I use the existing ones I can get it to work.
As for the skills, here's an example of what I was on about:
As you can see, in the UI I changed how the different skills appear in the soldier skill panels that show up in the game (aircraft equip screen, hire screen, base defence pop-up screen) and then modified the firedef to use the skill I wanted (so pistol weapons use the sniper skill, sniper now uses assault which is renamed to Rifles etc) but the weapon description window shows what skill you've set in the firedef because it pulls it straight from the weapons file and there doesn't seem to be any way for me to change how the string turns up in the UI.
I shall keep playing around with it, though if the skills affect hidden variables in the game engine itself I might revert that change.
geever:
--- Quote from: Neonin on July 06, 2012, 01:12:57 pm ---...in the UI I changed how the different skills appear in the soldier skill panels that show up in the game (aircraft equip screen, hire screen, base defence pop-up screen) and then modified the firedef to use the skill
--- End quote ---
Maybe this is the problem:
http://ufoai.git.sourceforge.net/git/gitweb.cgi?p=ufoai/ufoai;a=blob;f=src/client/cl_inventory_callbacks.cpp#l40
Weapon skills are hardcoded. If you only want to rename them on the UI you can probably do it by translating (translate skill_sniper to Pistols).
-geever
Navigation
[0] Message Index
[#] Next page
Go to full version