MODing

Please post here for questions and discussion about general game modding
Falesh
Posts: 23
Joined: Wed Apr 18, 2007 4:24 pm
Contact:

RE: MODing

Post by Falesh »

That would be very useful Texashawk. Especially if you post about doing it on the official forums so others can include your work in their mods.
PhoenixD
Posts: 72
Joined: Sun May 06, 2007 11:00 pm

RE: MODing

Post by PhoenixD »

ORIGINAL: sage

Still can't find how to adjust weapon damages / effects, add death, or adjust recruiting. Grrrrr.

checksoldier dead seems to check on the *battle map* if a soldier has been reduced to 0 HP.
In the alien victory section of combat.xscr there's this line:
for (int i = 0; i < units.size(); i++) {
if (isPlayerControlled(units.get(i)))
missionData.lostUnits.add(units.get(i).name);
}

That results in lost soldiers. I haven't found the equivalent section for CAF victory yet. Once I do I suspect replacing the wounded section with that should give the result we want.

EDIT: CAFVictory is in man.xscr..
PhoenixD
Posts: 72
Joined: Sun May 06, 2007 11:00 pm

RE: MODing

Post by PhoenixD »

The UFOPedia is stored in base/UfopediaComments.dat once you've extracted the system file. It can be opened with any text editor. Just keep all the comments on one line and use \n at the end of a setance for paragraph breaks.

Eg

This is a rifle.n\Isn't it neat?

becomes

This is a rifle.
Isn't it neat?
ORIGINAL: sage

it's go to the mod thread above to extract the system files, then mod Resource Bundle.dat to your hearts content. There's an encyclopedia file as well, but can't remember it off the top of my head.

ORIGINAL: Texashawk

I have to say that I'm really starting to like this game...

which is why I would give real money to be able to rewrite the ingame text to more, ah, casual English.

Is there ANY WAY possible to mod the text descriptions, UI labels, etc?

I personally volunteer to rewrite everything if someone can show me how to do so. (Gotta put this English major to work somehow... what better way?) :-p

THawk
PhoenixD
Posts: 72
Joined: Sun May 06, 2007 11:00 pm

RE: MODing

Post by PhoenixD »

On recruiting: in globe.xscr, there's this bit of code:

Code: Select all

    if (keyPressedBuffered(DIK_S))
     {
       object resourceBundle = getGlobalVariable("ResourceBundle");
       object soldier = generateNewSoldier();
       if (soldier != NULL) {
           getGlobalVariable("Bases").get(0).units.add(soldier);
           object message = createObject( "CScriptObject", "" );
           message.addProperty( "text", resourceBundle.getMessage("NEW_SOLDIER_ARRIVED",soldier.name) );
           showMessageOnGlobe( "TEXT_MESSAGE", message );
       }
     }

So far the only reference I can find to "DIK_S" is in consts.xscr:

Code: Select all

const int DIK_S               = 0x1F;

Anyone know what that hex value stands for?

EDIT: AHA! Ok, I still have no idea what DIK_S is or how its triggered, but I DID find a way to add new soldiers. Its...kind of cheesy though, as currently it just adds a new guy every time you press F1. [:D]

It'll only let you fit 24 entries into the soldier area of the base, though, including any tanks you might have.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

Good idea. I will try.

ORIGINAL: PhoenixD
ORIGINAL: sage

Still can't find how to adjust weapon damages / effects, add death, or adjust recruiting. Grrrrr.

checksoldier dead seems to check on the *battle map* if a soldier has been reduced to 0 HP.
In the alien victory section of combat.xscr there's this line:
for (int i = 0; i < units.size(); i++) {
if (isPlayerControlled(units.get(i)))
missionData.lostUnits.add(units.get(i).name);
}

That results in lost soldiers. I haven't found the equivalent section for CAF victory yet. Once I do I suspect replacing the wounded section with that should give the result we want.

EDIT: CAFVictory is in man.xscr..
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

ORIGINAL: PhoenixD

On recruiting: in globe.xscr, there's this bit of code:

Code: Select all

    if (keyPressedBuffered(DIK_S))
     {
       object resourceBundle = getGlobalVariable("ResourceBundle");
       object soldier = generateNewSoldier();
       if (soldier != NULL) {
           getGlobalVariable("Bases").get(0).units.add(soldier);
           object message = createObject( "CScriptObject", "" );
           message.addProperty( "text", resourceBundle.getMessage("NEW_SOLDIER_ARRIVED",soldier.name) );
           showMessageOnGlobe( "TEXT_MESSAGE", message );
       }
     }

So far the only reference I can find to "DIK_S" is in consts.xscr:

Code: Select all

const int DIK_S               = 0x1F;

Anyone know what that hex value stands for?

EDIT: AHA! Ok, I still have no idea what DIK_S is or how its triggered, but I DID find a way to add new soldiers. Its...kind of cheesy though, as currently it just adds a new guy every time you press F1. [:D]

It'll only let you fit 24 entries into the soldier area of the base, though, including any tanks you might have.

Some tweaks to scripts\tests\config.xsv, I was able to recruite 15 new soldiers in about 3 months, for a total of 24 including a tank. The recruiting rate felt 'about right' assuming that characters could permadie.

I made these changes:

newUnit
{
unitConstants
{
className unitConstants
minDays 1
maxDays 15
maxSoldiers 43
maxFasterSoldiers 36
minDaysSlow 20
maxDaysSlow 40
}

I also doubled the amount of face graphics available to make sure there was 1 per available soldier.

After 24, recruiting stoped. It seems like there's a hard limit elsewhere in the game -- anyone have any ideas?

Anyone want to work on death while I'm sleeping? I'm thinking the CAF victory section someone mentioned earlier could be used, along with a leave unit.

I think that some % (1/2?) of characters with 0 hitpoints should be dead, rather than half? Or all at 0?
PhoenixD
Posts: 72
Joined: Sun May 06, 2007 11:00 pm

RE: MODing

Post by PhoenixD »

I'm working on death, but I haven't figured it out just yet. I really want to try and get around the 24-unit limit, too.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

ORIGINAL: PhoenixD

I'm working on death, but I haven't figured it out just yet. I really want to try and get around the 24-unit limit, too.

Agreed on both.

BTW, I'm happy to join credit you (and anyone else who contributes) if / when I release something.

Right now, I think death is the top priority. The 24 limit is fine for now, IMO.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

In combat.xscr, I tried adding,

Code: Select all

 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; checkSoldierDead(unit, NULL, true);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // create the wait action
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (unit.hp <= 0) {
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; centerCameraOnObj(unit, true);
 &nbsp;[b][u]missionData.lostUnits.add(unit.get(i).name[/u][/b]);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object action = createHurt(0, NULL);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; action.justWait = true;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object actions = createObject("CVector", "");
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; actions.add(action);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; actionsSend(unit, actions);
 
... but it didn' t work. The 'kill soldiers' problem is tough for a noob like me.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

Got death, thanks to wronguser on devforum.
&nbsp;
In turnmanager.xscr
&nbsp;
[font=arial]hurtCaf(unit, action) {
&nbsp;&nbsp;&nbsp; if (unit.hp <= 0) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (getGlobalVariable("centerCamera") == unit)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startCenterCamera(NULL, true);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object missionData = getGlobalVariable("missionData");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; missionData.lostUnits.add(unit.name);
[/font]
&nbsp;
&nbsp;
PhoenixD
Posts: 72
Joined: Sun May 06, 2007 11:00 pm

RE: MODing

Post by PhoenixD »

Woohoo! :)

On my end, I managed to disable the "Path blocked" error when firing. (so you can shoot at an alien behind a tree, for example). I'm trying to make it a yes/no choice at the moment. (As in "No line of sight. Fire anyway?")

...and I just looked at the thread. I can't BELIEVE I missed that. Soo..freakking..obvious..
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

Here are my current implemented changes. Most of these changes favor the aliens, so I need to do some more balancing before this is ready.
&nbsp;
Some weapon and armor names more military sounding. More to do.
Permadeath in.
Soldiers are now recruited much more quickly you will generally get at least 2-3 per month, and can get more.
In rpgvalues.cfg, increased rate at which characters heal from 3 to 5; the max stay length has been decreased from 45 to 30.
Increased chance for aliens to use grenades, even if it means hitting their own guys.
Increased exp for wounding, decreased for killing.
In const.xscr, change sight angles from 3.5 to 2.5, both vert and horiz.
panicked_bravery_coeff 0.15 from 0.1; soldiers will now become less accurate due to morale more quickly.
Under rpgvalue, set alien strategic&nbsp;aggressiveness 10 to 20. for norm difficulty.
Changed exp to go up levels. Lower levels increase faster, higher increase quite a bit slower.
Improved the quality of base defenses; they may be useful now from.
All grenades do a little less damage. This is to reduce the value of the 'grenade spam' tactic.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

To wet your appetite for the first release of 'SagerUFO':
&nbsp;
Major Changes
Permadeath in. Soldiers reduced to 0 hp are dead. Keep your veterans alive!
Soldiers are now recruited much more quickly. You will generally get at least 2-3 per month, and can get more.
In rpgvalues.cfg, increased rate at which characters heal from 3 to 5; the max stay length has been decreased from 45 to 30.
In const.xscr, change sight angles from 3.5 to 2.5, both vert and horiz.
Minor Balance Changes
Increased chance for aliens to use grenades, even if it means hitting their own guys.
Increased exp for wounding, decreased for killing.
Panicked_bravery_coeff 0.15 from 0.1; soldiers will now become less accurate due to morale more quickly.
Under rpgvalue, set alien aggressiveness 10 to 20. for norm difficulty.
Changed exp to go up levels. Lower levels increase faster, higher increase quite a bit slower.
Improved the quality of base defenses; they may be useful now from.
All grenades do a little less damage. This is to reduce the value of the 'grenade spam' tactic.
Aliens are slightly less accurate at all difficulty levels. This is because many changes favor the aliens.
Added in Edswor's hotkey mod. (Note, there is a minor bug in this mod which means you will need to use the keybad enter key when saving during tactical battles).
Esc - Game menu panel
I - Inventory panel
H - Healing panel
Return - End turn
F1 - F12 - Select unit 1-12
N - Previous unit
M - Next unit
A - Kneel/Stan unit
Z - Select Left hand
X - Select Right hand
Up arrow - Go up lift
Down arrow - Go up lift

Aesthetic Changes
Some weapon and armor names more military sounding. Some more still to do.
Many strings improved or changed to give the game more flavor.
Corrected a few typos, i.e. "Aircrafts" now "Aircraft"
Ranks now mirror USMC; this may change.
SOLDIER_RANK1=Private
SOLDIER_RANK2=Private First Class
SOLDIER_RANK3=Lance Corporal
SOLDIER_RANK4=Corporal
SOLDIER_RANK5=Sergeant
SOLDIER_RANK6=Staff Sergeant
SOLDIER_RANK7=Gunnery Sergeant
SOLDIER_RANK8=Master Sergeant
SOLDIER_RANK9=Sergeant Major
SOLDIER_RANK10=2nd Lieutenant
SOLDIER_RANK11=1st Lieutenant
SOLDIER_RANK12=Captain

&nbsp;
&nbsp;
User avatar
Erik Rutins
Posts: 39671
Joined: Tue Mar 28, 2000 4:00 pm
Location: Vermont, USA
Contact:

RE: MODing

Post by Erik Rutins »

Wow, impressive changes - looking forward to giving that a try.
Erik Rutins
CEO, Matrix Games LLC


Image

For official support, please use our Help Desk: http://www.matrixgames.com/helpdesk/

Freedom is not Free.
Rasit
Posts: 14
Joined: Wed May 02, 2007 5:34 pm

RE: MODing

Post by Rasit »

ORIGINAL: PhoenixD

Woohoo! :)

On my end, I managed to disable the "Path blocked" error when firing. (so you can shoot at an alien behind a tree, for example). I'm trying to make it a yes/no choice at the moment. (As in "No line of sight. Fire anyway?")

...and I just looked at the thread. I can't BELIEVE I missed that. Soo..freakking..obvious..


Can you disclose how you did to turn the Path blocked off? I hate it when a enemy is hiding behind a tree so I can't aim at it.
PhoenixD
Posts: 72
Joined: Sun May 06, 2007 11:00 pm

RE: MODing

Post by PhoenixD »

ORIGINAL: Rasit

ORIGINAL: PhoenixD

Woohoo! :)

On my end, I managed to disable the "Path blocked" error when firing. (so you can shoot at an alien behind a tree, for example). I'm trying to make it a yes/no choice at the moment. (As in "No line of sight. Fire anyway?")

...and I just looked at the thread. I can't BELIEVE I missed that. Soo..freakking..obvious..


Can you disclose how you did to turn the Path blocked off? I hate it when a enemy is hiding behind a tree so I can't aim at it.

Yep. Unpack system.xbg, replace it with the blank file, then open up combat.xscr. Find the block that starts with:
checkShootLineObstruction(from, to, hit, allowedUnit) {
and put
return true;
right below that.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

I'll add that.

Yep. Unpack system.xbg, replace it with the blank file, then open up combat.xscr. Find the block that starts with:
checkShootLineObstruction(from, to, hit, allowedUnit) {
and put
return true;
right below that.
PhoenixD
Posts: 72
Joined: Sun May 06, 2007 11:00 pm

RE: MODing

Post by PhoenixD »

On soldier death: I found a way to randomize things, so when a soldier goes down he could be wounded OR killed. Createandloadvariables has a "dice" command that should work in the other files. I'll mess with it today. If I can get it working, what do you think is a reasonable percentage for dead soldiers?

EDIT: got it working. In turnmanager.xscr, the HurtCaf block:

Code: Select all

    if (unit.hp <= 0) {
         if (getGlobalVariable("centerCamera") == unit)
             startCenterCamera(NULL, true);
            if (dice("1d20") > 5) {
 		object missionData = getGlobalVariable("missionData");
            	missionData.lostUnits.add(unit.name); 
 	   }

Its the same as the snippet posted above, except with an additional IF statement. As it is now, it gives about a 25% chance of a wounded unit surviving. The rest of the time the unit will be lost.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

I think that's teriffic. I think we should try 1/3rd (i.e. 13 using a d20) or 1/2? 1/4th seems a little small, but that's just my gut feeling. Let me know if this works. EDIT: just saw that you got it working. SUHHHHWEEEEET!

ORIGINAL: PhoenixD

On soldier death: I found a way to randomize things, so when a soldier goes down he could be wounded OR killed. Createandloadvariables has a "dice" command that should work in the other files. I'll mess with it today. If I can get it working, what do you think is a reasonable percentage for dead soldiers?

EDIT: got it working. In turnmanager.xscr, the HurtCaf block:

Code: Select all

    if (unit.hp <= 0) {
         if (getGlobalVariable("centerCamera") == unit)
             startCenterCamera(NULL, true);
            if (dice("1d20") > 5) {
 		object missionData = getGlobalVariable("missionData");
            	missionData.lostUnits.add(unit.name); 
 	   }

Its the same as the snippet posted above, except with an additional IF statement. As it is now, it gives about a 25% chance of a wounded unit surviving. The rest of the time the unit will be lost.
sage
Posts: 204
Joined: Wed Aug 04, 2004 11:57 pm

RE: MODing

Post by sage »

Next up, I want to try and randomize tactical weapon damages. I played with that quickly last night, but it wasn't working, making all weapons do 0.
Post Reply

Return to “Mods and Tweaks”