Home » MODDING HQ 1.13 » Flugente's Magika Workshop » Absurdly small code changes  () 1 Vote
Re: Absurdly small code changes[message #344778 is a reply to message #344776] Mon, 28 March 2016 19:10 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
CVB wrote on Mon, 28 March 2016 15:48
Quote:
I think you misunderstood silversurfer here. The AI is subject to all penalties. It just doesn't care. There is no decision process involved. Some factors, like weight, price and stealth though are irrelevant.
Thanks for the clarification.

Even if there was a decision process involved the AI wouldn't need to bother about most of the penalties. They outnumber us anyway and usually have better stats than our average merc. It doesn't hurt them much if they have 86 AP instead of 90 for example.

About the helmets - in my opinion the helmets that are bulky and provide the highest coverage should also have the biggest aiming penalty. This means that the penalty of Spectra and Dyneema should be reduced considerably (below SWAT Helmet).

Another point that I never understood was why do pants apply aiming penalties? Are we monkeys and aim with our legs? In my opinion aiming penalties should be removed completely from the pants. They should have stealth penalties and of course AP penalties but they shouldn't influence aiming.

Players that don't play Scifi have no chance to get Royal Jelly at all. Therefore I wouldn't make it compete with C-18. They should instead have similar properties with the Jelly being slightly better (because it's harder to get).




Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Absurdly small code changes[message #344779 is a reply to message #344778] Mon, 28 March 2016 19:18 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:
Even if there was a decision process involved the AI wouldn't need to bother about most of the penalties. They outnumber us anyway and usually have better stats than our average merc. It doesn't hurt them much if they have 86 AP instead of 90 for example.


Whether they outnumber us or not, or that the differences are small or not, I adhere to the game design that sets an even playing field for both the Player and AI -- so I would like to see the same bonuses and penalties applied to both sides.

EDIT: Oops, missed Flugente's clarification that it is an even playing field in this regard.

Quote:
About the helmets - in my opinion the helmets that are bulky and provide the highest coverage should also have the biggest aiming penalty. This means that the penalty of Spectra and Dyneema should be reduced considerably (below SWAT Helmet).


I agree completely.

Quote:
Another point that I never understood was why do pants apply aiming penalties? Are we monkeys and aim with our legs? In my opinion aiming penalties should be removed completely from the pants. They should have stealth penalties and of course AP penalties but they shouldn't influence aiming.


I agree to a point -- thinking that there should be an aiming penalty when crouching, as they hinder leg mobility and crouching stability.

Quote:
Players that don't play Scifi have no chance to get Royal Jelly at all. Therefore I wouldn't make it compete with C-18. They should instead have similar properties with the Jelly being slightly better (because it's harder to get).


The descriptions of Compound 18 and Royal Jelly indicate their properties are different, and in line with what Flugente proposes. I like that they are very different in their effects.

[Updated on: Mon, 28 March 2016 19:22]

Report message to a moderator

Sergeant Major
Re: Absurdly small code changes[message #344781 is a reply to message #344778] Mon, 28 March 2016 19:32 Go to previous messageGo to next message
CVB is currently offline CVB

 
Messages:129
Registered:September 2014
Location: Berlin
silversurfer wrote on Mon, 28 March 2016 18:10

Even if there was a decision process involved the AI wouldn't need to bother about most of the penalties. They outnumber us anyway and usually have better stats than our average merc. It doesn't hurt them much if they have 86 AP instead of 90 for example.

Are the AP penalty values relative to AP100 or AP25?

Quote:
About the helmets - in my opinion the helmets that are bulky and provide the highest coverage should also have the biggest aiming penalty. This means that the penalty of Spectra and Dyneema should be reduced considerably (below SWAT Helmet).


+1. On the other hand, EOD helmets might even get tunnel vision penalties, peripheral vision being severely obstructed.

Quote:
Another point that I never understood was why do pants apply aiming penalties? Are we monkeys and aim with our legs? In my opinion aiming penalties should be removed completely from the pants. They should have stealth penalties and of course AP penalties but they shouldn't influence aiming.
At most, there should be aiming penalties at crouched stance, your legs bending awkwardly around bulky and stiff pants.



Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle

Report message to a moderator

Sergeant
Re: Absurdly small code changes[message #344782 is a reply to message #344779] Mon, 28 March 2016 19:37 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
edmortimer wrote on Mon, 28 March 2016 18:18

Quote:
Another point that I never understood was why do pants apply aiming penalties? Are we monkeys and aim with our legs? In my opinion aiming penalties should be removed completely from the pants. They should have stealth penalties and of course AP penalties but they shouldn't influence aiming.


I agree to a point -- thinking that there should be an aiming penalty when crouching, as they hinder leg mobility and crouching stability.

This could be done by the <CROUCH_MODIFIERS> block. Unfortunately this does only apply to NCTH as far as I remember.


edmortimer wrote on Mon, 28 March 2016 18:18

Quote:
Players that don't play Scifi have no chance to get Royal Jelly at all. Therefore I wouldn't make it compete with C-18. They should instead have similar properties with the Jelly being slightly better (because it's harder to get).


The descriptions of Compound 18 and Royal Jelly indicate their properties are different, and in line with what Flugente proposes. I like that they are very different in their effects.

Agreed. Just don't make C-18 absurdly bad because it's supposed to compete with something that non-scifi players never get to see.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Absurdly small code changes[message #344799 is a reply to message #344767] Tue, 29 March 2016 18:17 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:
Overall, I lke this a lot. While we are at it, could "Field uniform" be replaced with another name? An armour vest is at best a part of a field uniform...


Thinking about this . . . been on my mind for quite a while actually . . . it's supposed to be a BDU. BDUs are not armoured (in this time period) but allow armour inserts. In AV I added Jungle Fatigues -- unarmoured and does not allow armour inserts. They are the precursor to the BDU which allows armour inserts. Why not just make the BDU what it's supposed to be -- a uniform that allows armour inserts?

Report message to a moderator

Sergeant Major
Re: Absurdly small code changes[message #344802 is a reply to message #344799] Tue, 29 March 2016 20:37 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Currently, C-18 is worse than Jelly in every regard, with these changes, it beats it in pure protection (but still loses everywhere else).

These penalties are for the 100AP system (I am not completely sure whether the game reads these as percentages and correctly adjusts to the 25AP system, have to check).

I really like CVB's idea of a tunnel vision penalty (a very small one, no worries). I could lower the Aim penalty on helmets in general and add a tunnel vision instead.

I am not that satisfied about the pants too. There aren't that many penalties to play with down there, AP & stealth being logical, aim not so much. Hmm. I could lower aim penalties and play a bit with weight and coverage.

At least from the current description, the Field Uniform is almost a copy of the Zylon stuff. But edmortimer's idea is better - make it non-armoured (or very, very low armoured), camoed, light-weight and allow plate inserts. Then change it to very low coolness. That way one has to get a plate to make it worthwhile, and it would compete with Flak Jacket and Kevlar vest by having no penalties whatsoever.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #344803 is a reply to message #344802] Tue, 29 March 2016 20:53 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
Flugente wrote on Tue, 29 March 2016 19:37

At least from the current description, the Field Uniform is almost a copy of the Zylon stuff. But edmortimer's idea is better - make it non-armoured (or very, very low armoured), camoed, light-weight and allow plate inserts. Then change it to very low coolness. That way one has to get a plate to make it worthwhile, and it would compete with Flak Jacket and Kevlar vest by having no penalties whatsoever.

From the looks of the Field Uniform I would say you should adjust the camo bonus. Right now Zylon and Field Uniform provide 20% woodland camo. The Zylon really looks like woodland camo but the the field uniform is more a mix of grass land and desert camo. Maybe give the Field Uniform 10% woodland + 10% desert camo instead?



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Absurdly small code changes[message #344806 is a reply to message #344803] Tue, 29 March 2016 22:18 Go to previous messageGo to next message
CVB is currently offline CVB

 
Messages:129
Registered:September 2014
Location: Berlin
While researching the properties of various body armours a bit more deeply, I stumbled over this. Quote: "Some studies subsequently reported that the Zylon vests may degrade rapidly, leaving wearers with significantly less protection than expected. Second Chance eventually recalled all of its zylon-containing vests, which led to its subsequent bankruptcy." Other sources indicate that a main reason for deterioration was a hot and humid environment. (Did someone just say "Arulco"?)
So another way to differentiate between various different types might be to have high protection values that deteriorate rapidly, maybe even over the course of a single salvo.

Edit: And/or make certain armours extra difficult or even impossible to repair.

[Updated on: Wed, 30 March 2016 16:29]




Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle

Report message to a moderator

Sergeant
Re: Absurdly small code changes[message #344846 is a reply to message #344806] Sun, 03 April 2016 19:41 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
While testing tunnel vision values a bit, I discovered that tunnel vision penalties are applied rather broad, as we apply the vision penalty before doubling our vision range (it's a vision code thing). As a result, 1% or 10 % didn't make a difference (in stock, might be different in Bigmaps).
I've thus altered the code a bit - the penalty also now better applies to the side.

http://i.imgur.com/eqrwoiP.png
0% tunnel vision

http://i.imgur.com/S8nqEAJ.png
1% tunnel vision

http://i.imgur.com/OjgNdh5.png
4% tunnel vision

One could still ask "Why is this called tunnel vision, this doesn't seem like tunnel vision at all?", but I think it's at least better than what we currently have.

Additionally, if both body items and weapon have tunnel vision penalties, we now use their maximum, not their sum. It seemed somewhat odd to me that a helmet would further reduce our view if we're already looking through a high-powered scope.

Committed in r8134.

It would now be more reasonable to have this on helmets.

[Updated on: Mon, 16 May 2016 19:41]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #344851 is a reply to message #344846] Sun, 03 April 2016 22:33 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
I've worked in the feedback - these are the values I plan to incorporate:
Current stock armour vest values (base version)

ID	Name	        Weight	Price	Aim	AP	Stealth	Flak?	Protection	Coverage	Degradation
161	Flak Jacket	20	600	-1	0	0	True	20	        75	        25
164	Kevlar Vest	32	1000	-2	0	0	False	25	        70	        15
167	Spectra Vest	32	2000	-4	-3	0	False	29	        85	        13
189	Kevlar  Leather	20	950	-1	0	0	False	20	        85	        20
196	Guardian Vest	32	1400	-3	-3	0	False	28	        70	        50
283	Zylon Vest	30	1300	-2	-1	0	False	25	        85	        25
284	Field Uniform	35	1400	-2	0	0	False	25	        85	        25
295	SWAT Vest	33	1100	-2	-1	0	False	28	        90	        15
803	Dyneema Vest	20	2000	-3	0	0	False	29	        85	        13
806	EOD Vest	65	4000	-10	-8	0	True	50	        99	        5
812	Twaron Vest	25	1200	-3	-3	0	False	28	        75	        15
										
183	Ceramic Plates	12	1000	-2	0	0	False	50	        50*	        15
837	Titanium Pl.	10	750	-1	0	0	False	35	        10*	        10

Flugente's proposed rebalancing

ID	Name	        Weight	Price	Aim	AP	Stealth	Flak?	Protection	Coverage	Degradation
161	Flak Jacket	25	600	-2	-1	-10	True	20	        75	        25
164	Kevlar Vest	31	1000	-2	-1	-10	False	25	        70	        15
167	Spectra Vest	36	2000	-6	-5	-20	False	31	        84	        13
189	Kevlar  Leather	20	800	-1	0	-5	False	17	        90	        25
196	Guardian Vest	34	1200	-2	-4	-15	False	28	        70	        14
283	Zylon Vest	30	1300	-1	-1	-10	False	25	        75	        50
284	Field Uniform	8	250	0	0	-5	False	8	        90	        25
295	SWAT Vest	36	1800	-4	-3	-5	False	26	        90	        15
803	Dyneema Vest	36	2000	-6	-1	-20	False	28	        84	        13
806	EOD Vest	65	4000	-10	-8	-25	True	50	        100	        5
812	Twaron Vest	30	1500	-4	-3	-15	False	28	        77	        15
										
										
183	Ceramic Plates	12	1000	-3	-1	-3	False	50	        50*	        15
837	Titanium Pl.	10	750	-1	-1	-3	False	35	        50*	        10
										
	+C-18			        -1	-1	-3		4
	+Royal Jelly			1	0	3		2
Zylon vest now beats Kevlar vest, except for price... but it has a serious degradation drawback. 50% degradation ensures that this armor goes down really, really fast. Additionally, AP mali were slightly reduced.

The Field Uniform is new - is is cheap, lightweight, has tiny penalties, high coverage... and abysmal protection. As said, I plan to drastically lower coolness on this (so you'll see this in the very early game). It's basically your very first armour - either upgrade it with plates, or switch to a better armour, which is where the penalties come in.

Current stock armour pants values (base version)

ID	Name	         Weight	Price	Aim	AP	Stealth	Flak?	Protection	Coverage	Degradation
170	Kevlar Leggings	39	800	0	-3	0	False	23	        65	        15
173	Spectra L.      39	1800	0	-6	0	False	27	        90	        13
282	Zylon Combat P.	35	1000	0	-3	0	False	23	        90	        25
294	SWAT Leggings	39	900	0	-3	0	False	26	        75	        15
802	Dyneema L.	30	1800	0	-3	0	False	27	        95	        13
805	EOD Leggings	48	2400	0	-12	0	True	45	        99	        5
811	Twaron Leggings	30	1000	0	-3	0	False	26	        80	        15
										
838	Leg Protectors	10	400	0	0	0	False	14	        25*	        20
										
										
										
Flugente's proposed rebalancing										
										
ID	Name	        Weight	Price	Aim	AP	Stealth	Flak?	Protection	Coverage	Degradation
170	Kevlar Leggings	35	800	0	-2	-10	False	23	        65	        15
173	Spectra L.	39	1600	-2	-6	-20	False	29	        85	        13
282	Zylon Combat P.	31	1000	0	-2	-10	False	23	        75	        50
294	SWAT Leggings	39	1400	-1	-4	-5	False	24	        90	        15
802	Dyneema L.	35	1600	-2	-2	-20	False	26	        85	        13
805	EOD Leggings	48	2400	-4	-10	-30	True	45	        100	        5
811	Twaron Leggings	33	1200	-1	-4	-15	False	26	        75	        15
										
838	Leg Protectors	10	400	0	-1	0	False	14	        25*	        20
Like for vests, zylon now degrades very fast. Aim penalties have been reduced.

Current stock armour helmet values (base version)											
											
ID	Name	        Weight	Price	Aim	AP	Stealth	Flak?	Protection	Coverage	Degradation	Tunnelvision
176	Steel Helmet	14	100	-1	0	0	False	14	        65	        5	        0
177	Kevlar Helmet	14	400	-1	0	0	False	23	        75	        20	        0
180	Spectra Helmet	14	900	-1	0	0	False	27	        75	        15	        0
293	SWAT Helmet	14	500	-1	0	0	False	26	        65	        20	        0
302	Camo Steel H.	14	200	-1	0	0	False	14	        65	        5	        0
801	Dyneema Helmet	10	900	-1	0	0	False	27	        70	        15	        0
804	EOD Helmet	35	1600	-4	0	0	True	45	        99	        8	        0
810	Twaron Helmet	10	600	-1	0	0	False	26	        70	        20	        0
											
Flugente's proposed rebalancing
									
ID	Name	        Weight	Price	Aim	AP	Stealth	Flak?	Protection	Coverage	Degradation	Tunnelvision
176	Steel Helmet	12	100	0	-1	-10	False	18	        65	        5	        0
177	Kevlar Helmet	12	400	-1	-1	-7	False	23	        65	        20	        0
180	Spectra Helmet	14	800	-3	-3	-14	False	29	        75	        15	        2
293	SWAT Helmet	14	700	-2	-2	-3	False	24	        85	        20	        4
302	Camo Steel H.	12	120	0	-1	-10	False	18	        65	        5	        0
801	Dyneema Helmet	11	800	-3	-1	-14	False	26	        75	        15	        2
804	EOD Helmet	35	1600	-5	-5	-20	True	45	        100	        8	        7
810	Twaron Helmet	12	600	-2	-2	-7	False	26	        70	        20	        1
Aim penalties have been lowered. In exchange, helmets with high coverage get a tiny tunnel vision percentage (see previous post for example effects with 1% and 4%.

If there aren't cons, I'd like to implement this soon-ish.

[Updated on: Mon, 19 July 2021 22:24]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #344852 is a reply to message #344851] Sun, 03 April 2016 22:42 Go to previous messageGo to next message
CVB is currently offline CVB

 
Messages:129
Registered:September 2014
Location: Berlin
Looks very good


Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle

Report message to a moderator

Sergeant
Re: Absurdly small code changes[message #344854 is a reply to message #344852] Sun, 03 April 2016 23:17 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
The Titanium Plates look off. The current coverage is 50 not 10 as in your list. Also the new coverage value of 0 will render them useless.


Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Absurdly small code changes[message #344861 is a reply to message #344854] Mon, 04 April 2016 13:16 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Oops. I hope thats just me being incompetent in LibreOffice, and not me having wonky xmls.


I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #344950 is a reply to message #344861] Sat, 09 April 2016 00:35 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As of GameDir r2312, I've added the above changes (minus whatever typo I did for platinum plating).

This was actually more work than feared. After doing the changes, it turned out that the xml editor, in its infinite wisdom, had rewritten every single ammo item class index. Needless to say, removing that prior to committing was extensive.
After that, it turned out I forgot to add the NCTH aim stuff, so I redid that in the editor, after copying over the current, up-to-date stock GameDir xmls.
After then adding the NCTH stuff, it turned out that the ammo item indizes were garbled yet again. With stock xmls copied right over from GameDir. This did not raise my mood.

While editing the armour values, it also turned out quite a few C-18/Jelly versions of armour did not even have item descriptions. Or even a friggin' picture, instead they use the tnt image as a placeholder. It also turned out pants did not have any NCTH values set at all. Some of these things have been like that for over a decade. For a community that frequently jacks off on how carefully it maintains and improves the game, that is utterly disgraceful.

Up until now, I've always tried to make as few disruptive changes to xmls as possible, as to allow modders to adapt easily. Perhaps that is the wrong way. Perhaps I should go and change the xmls so much that the pressure to get this xml editor working again (or a new one working) is big enough that someone finally does something like that? There are more than enough weird xml things that we keep around simply for compatibilitiy reasons. Like that weird workaround in AmmoTypes.xml, apparently made in a time when there when floating point numbers weren't invented yet.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #344953 is a reply to message #344950] Sat, 09 April 2016 08:01 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:
While editing the armour values, it also turned out quite a few C-18/Jelly versions of armour did not even have item descriptions. Or even a friggin' picture, instead they use the tnt image as a placeholder. It also turned out pants did not have any NCTH values set at all. Some of these things have been like that for over a decade. For a community that frequently jacks off on how carefully it maintains and improves the game, that is utterly disgraceful.


Thank you for saying that. Because they are in such a mess is why I am modifying just about everything in AV -- it seems that much of what is in the XMLs haven't been really looked at in a very long time.

Report message to a moderator

Sergeant Major
Re: Absurdly small code changes[message #344959 is a reply to message #344950] Sat, 09 April 2016 18:22 Go to previous messageGo to next message
RunAwayScientist is currently offline RunAwayScientist

 
Messages:84
Registered:September 2001
Flugente wrote on Fri, 08 April 2016 21:35
Perhaps I should go and change the xmls so much that the pressure to get this xml editor working again (or a new one working) is big enough that someone finally does something like that?



I absolutely disagree. As an extensive personal modder, I've made major changes to the .xmls and this would increase workload per update (unless one simply looks at the SVN logs, barring a major update.) I imagine the same will be true of others.


The XML editor did some weird things even back in the 4400 trunks. Which is why I stopped using it. Manually editing .xml files to create new items or otherwise actually saves headache (and sometimes time).


Is there not an individual or group of individuals who were responsible for the XML editor? You could try to bribe them shamelessly.


Report message to a moderator

Corporal 1st Class
Re: Absurdly small code changes[message #344980 is a reply to message #344950] Sun, 10 April 2016 15:39 Go to previous messageGo to next message
CVB is currently offline CVB

 
Messages:129
Registered:September 2014
Location: Berlin
Flugente wrote on Fri, 08 April 2016 23:35
As of GameDir r2312, I've added the above changes (minus whatever typo I did for platinum plating).
Good work, thanks a lot!

Quote:
While editing the armour values, it also turned out quite a few C-18/Jelly versions of armour did not even have item descriptions. Or even a friggin' picture, instead they use the tnt image as a placeholder. It also turned out pants did not have any NCTH values set at all. Some of these things have been like that for over a decade. For a community that frequently jacks off on how carefully it maintains and improves the game, that is utterly disgraceful.
I always thought the TNT image was an intentional, not so subtle hint not to use these items...

Quote:
Up until now, I've always tried to make as few disruptive changes to xmls as possible, as to allow modders to adapt easily. Perhaps that is the wrong way. Perhaps I should go and change the xmls so much that the pressure to get this xml editor working again (or a new one working) is big enough that someone finally does something like that? There are more than enough weird xml things that we keep around simply for compatibilitiy reasons. Like that weird workaround in AmmoTypes.xml, apparently made in a time when there when floating point numbers weren't invented yet.
Given the amount of times some random problem reported in the forum was actually caused be a buggy editor export, I long ago decided not to use that anymore. I get along just fine with Notepad++ and some plugins. For mass changes I can use a spreadsheet program.

IMHO, modding would profit much more from a decent comments section explaining the tags in every xml file than from an xml editor trying to play catchup with ever evolving features.




Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle

Report message to a moderator

Sergeant
Re: Absurdly small code changes[message #344983 is a reply to message #344980] Sun, 10 April 2016 17:11 Go to previous messageGo to next message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:
IMHO, modding would profit much more from a decent comments section explaining the tags in every xml file than from an xml editor trying to play catchup with ever evolving features.


Yes, I concur whole-heartedly! Comment the tags! So many without comment, and so little info given anywhere on some of the xmls.

Report message to a moderator

Sergeant Major
Re: Absurdly small code changes[message #344992 is a reply to message #344980] Mon, 11 April 2016 07:58 Go to previous messageGo to next message
Faalagorn is currently offline Faalagorn

 
Messages:153
Registered:February 2012
Location: Poland
CVB wrote on Sun, 10 April 2016 14:39
I get along just fine with Notepad++ and some plugins. For mass changes I can use a spreadsheet program.

Same here, I prefer AkelPad though as I'm a minimalist and for the mass change I use regular expressions in it (regex FTW! - Notepad++ should support them without problems too for advanced edits)

CVB wrote on Sun, 10 April 2016 14:39
IMHO, modding would profit much more from a decent comments section explaining the tags in every xml file than from an xml editor trying to play catchup with ever evolving features.

I always used XML editor more to visualize the items lists easier, but I never trust it to save things, I'm on the same wagon preferring to use XMLs manually, so that seems like the right way for me too.

Report message to a moderator

Staff Sergeant
Re: Absurdly small code changes[message #345024 is a reply to message #344980] Tue, 12 April 2016 12:34 Go to previous messageGo to next message
RunAwayScientist is currently offline RunAwayScientist

 
Messages:84
Registered:September 2001
CVB wrote on Sun, 10 April 2016 12:39
I get along just fine with Notepad++ and some plugins. For mass changes I can use a spreadsheet program.



For mass file/string replace jobs with varying conditions, I generally find myself having to write custom C++ programs making use of the substr function.


I'm curious: How does one use MS Excel (or whatever program you use) to complete changes to raw text?


EDIT: Or RegEx expressions. How complex can you get with RegEx entries?

[Updated on: Tue, 12 April 2016 12:35]

Report message to a moderator

Corporal 1st Class
Re: Absurdly small code changes[message #345035 is a reply to message #345024] Tue, 12 April 2016 18:39 Go to previous messageGo to next message
CVB is currently offline CVB

 
Messages:129
Registered:September 2014
Location: Berlin
RunAwayScientist wrote on Tue, 12 April 2016 11:34
I'm curious: How does one use MS Excel (or whatever program you use) to complete changes to raw text?


As always: make a backup copy before proceeding!

Note: exact wording might be slightly different depending on localization

UseCase a: edit existing xml tags
Open empty spreadsheet in Excel
drag and drop xml file into Excel
when asked for file format, select "xml table"
enter/modify data
save as xml file

UseCase b: add new xml tags
Open xml file in text editor
add new tag(s) once at appropriate position
save xml file
goto a

Note that Excel doesn't export empty tags.

This works on about 90% of xml files. For some xml files, Excel opens a new line for every tag. I haven't found a solution for this problem yet.






Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle

Report message to a moderator

Sergeant
Re: Absurdly small code changes[message #345085 is a reply to message #345035] Sat, 16 April 2016 01:46 Go to previous messageGo to next message
RunAwayScientist is currently offline RunAwayScientist

 
Messages:84
Registered:September 2001
Right, though you mentioned 'mass' changes, CVB. I imagine this would entail quickly finding/replacing specific entries (maybe even the use of regular expressions). Does Excel support this?

Report message to a moderator

Corporal 1st Class
Re: Absurdly small code changes[message #345097 is a reply to message #345085] Sat, 16 April 2016 11:46 Go to previous messageGo to next message
CVB is currently offline CVB

 
Messages:129
Registered:September 2014
Location: Berlin
When I wrote "mass changes" I actually meant tasks like adding new tags. Search/replace and data filtering is supported. I haven't worked with regular expressions beyond that, however Excel seems to support more. Here is a tutorial.


Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle

Report message to a moderator

Sergeant
Re: Absurdly small code changes[message #345402 is a reply to message #345097] Tue, 10 May 2016 22:03 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As it it probably well-known to anybody familiar with stock items, weapons are sometimes bizarrely treated. As it doesn't make any sense the the FN FAL and FAMAS cannot attach rifle LAMs while the equally ancient G3 can use all the latest tacticool gear, those guns now (GameDir r2317) have access to that as well.

While it probably doesn't make sense that ancient guns without rails can attach attachments that require rails, that would mean that a significant portion of all guns should get their attachments culled. At the same time, gun selection is even more bizarre... M40A1 is at 70% progress, while the superior M21 Tactical arrives at 50% progress.
Also, the gun selection is so absurdly skewed to HK weaponry... for example the entire elite gun selection consists of 64 guns, 30 of which are HK. I assume that at some point some serious HK fanboy got to make up this one.

While I'm not in the mood to redo that now, gun selection is in desperate need of a revamp.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #345552 is a reply to message #345402] Mon, 16 May 2016 18:03 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As of r8217 and GameDir r2321, there is a no disability: hemophilia. This causes a merc to bleed a lot faster, and even for tiny wounds that normally don't cause bleeding (wounds with < 13 damage). Only bleeding is affected, bandaging/doctoring/anything else works just fine.

http://i.imgur.com/77vj5c1.png
And yes, women can actually get this, it's just super-rare (no, not because they all bleed to death on their first period, you twat!).

I've awarded this to Henning and Brain. Henning because that seems likely for an inbred aristocrat, and Brain because 'why not?'.

[Updated on: Mon, 16 May 2016 19:45]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #345555 is a reply to message #345552] Mon, 16 May 2016 22:16 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
Would someone with such disability even choose a career as mercenary? I find that highly unlikely especially since there are more ways to get hurt than bullets and shrapnel.


Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Absurdly small code changes[message #345573 is a reply to message #345555] Wed, 18 May 2016 00:24 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As of r8221, I've improved the improve gear function again (if you don't know what that is,check it out, as it's very convenient!). The function now additionally picks up extra mags if any mag-stack in your inventory is not yet full, and merges the mags in a stack. If a remaining magazine is not full, it is sorted to the front, so you can see that. This has the welcome side-effect that seemingly full stacks no longer hide empty ones after the first.

http://i.imgur.com/sjPaPFK.png
Ira has 2 used mags, and there are 4 lying around. We could pick that up by hand, but... effort!

http://i.imgur.com/IlVe01q.png
After using said function, we now have 2 full and one almost full mag in one neat stack.

Obviously, this could still be improved more (replacing attached attachments etc.), but for now, I'm happy with this.

@silversurfer: Yeah... Psycho Pro Inc. will say that as well happy. But it's a thing and works. Not as suicidal as mercs unable to bandage themselves.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #345629 is a reply to message #313897] Sun, 22 May 2016 17:28 Go to previous messageGo to next message
Frank2368 is currently offline Frank2368
Messages:1
Registered:May 2016
Don't know if it's the right place to post this but I couldn't find a suggestion board. ><

I found some inconsistencies in the weapon stats.

M1 Garand, K98k and Mauser M03 which uses the 30-06 and 8mm Mauser should have their damage bumped up to 40 (both rounds are more powerful than the 7.62x51mm as well as 7.62x54mmR)

The Redhawk Alaskan which fires the 454 Casull has a handling of 6 even though it has a huge kick. It should be at least 14 or 15.

Report message to a moderator

Civilian
Re: Absurdly small code changes[message #346059 is a reply to message #345629] Sat, 02 July 2016 22:44 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As you might know, when we target a prone soldier, we cannot target their head/torso/legs specifically. Any hit in that position is always deemed to be a torso-hit. Not only is this weird (we can no longer differentiate between head and legs? dafuq?), it also allows some tactical decisions that seem odd but are effective. For example, as I always have my mercs go prone in combat for that sweet, sweet bipod-bonus, I never ever get hit in the legs.

For this reason, I never wear pants. This does away with all those pants-penalties and lowers weight. I could also forgo the use of helmets, though that is a bit more risky.

This is not exactly a bug - Sirtech explicitly coded it this way. The reason is that while standing or crouched, the body part we aim at/hit is simply determined by height - which obviously doesn't work while prone.

As of r8264 & GameDir r2326, no more of that. Head/torso/legs can now be aimed at (and hit) on prone targets. Sadly, due to the obfuscated way structure JSDs, bullet travel etc. works, this sometimes leads to unexpected results.

http://i.imgur.com/E8MmQ3h.png

Another sideeffect is that stray bullets no longer ignore crouched and prone soldiers. This will affect both mercs and enemy soldiers, and should be taken into consideration regarding friendly fire (-> militia).

I consider this a bugfix, not an optional feature. However, in order to ease this transition (and to allow players to observe the difference), for a limited time, ALLOW_TARGET_HEADANDLEG_IFPRONE in JA2_Options.ini turns this code on and off. Should I get overwhelming feedback that the community would rather play with the buggy code it is familiar with, I will remove the code, otherwise at an not yet specified point of time, the code will be always active and the option removed.

For the same reason, the game will also tell you what part of a body you've hit if the target is prone.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #346060 is a reply to message #346059] Sun, 03 July 2016 02:50 Go to previous messageGo to next message
pheloncab is currently offline pheloncab

 
Messages:278
Registered:August 2004
Location: So. Cal. or texas
I like the idea of targeting specific parts on prone, I understand why i think it was simplified out in the original game. I do wonder when its a friendly fire issue or a stray round does it choose a body part at random? and if so is it equal in its choice 1/3 each or 15% head 40% legs, 45% body or what??? knowing the psudoRNG factor as I do, I really don;t want a game where suddenly the militia is Friendly fire headshotting my prone mercs every other round.

Report message to a moderator

Master Sergeant
Re: Absurdly small code changes[message #346070 is a reply to message #346060] Sun, 03 July 2016 13:32 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
What part of a body is hit depends on where the bullet hits the soldier. If it is near the center of the body, it's a torso hit, if it's near the next tile in the direction we are looking at, a headshot, if it's near the tile of the other direction, a leg shot.

This sometimes leads to unexpected hits as the underlying JSD files sometimes seem ... weird. But as a rule of thumb, the above applies. So if you for example attack a prone target from the front, headshots are likely and leg shots very unlikely.

What I meant with the friendly fire issue above is that if a bullet was not fired at us from a long range and not an explosive fragment, there were cases were it always hit us if we were standing, but never if we were rpone or crouched. The easiest way to see this difference is to open automatic fire at a region behind your mercs in various stances.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #346142 is a reply to message #346070] Fri, 08 July 2016 23:13 Go to previous messageGo to next message
LatZee is currently offline LatZee

 
Messages:187
Registered:December 2015
One vote for keeping this in options. Not that i mind it by itself, it takes a bit to get used to it and then it's mostly fine, but fighting with militia present is already a clusterfuck, probably more militia dies to friendly fire then from enemies cheeky at least now you can help them a bit by ordering them to the ground occasionaly, with this on I will literally run away screaming from any fight involving militia cheeky

Report message to a moderator

Staff Sergeant
Re: Absurdly small code changes[message #346207 is a reply to message #346142] Tue, 12 July 2016 23:10 Go to previous messageGo to next message
RunAwayScientist is currently offline RunAwayScientist

 
Messages:84
Registered:September 2001
Still testing this feature. Inconclusive results so far, but with my settings it honestly doesn't seem that big of an issue. Will try with much larger troop sizes. Currently playing with NCTH and custom settings in there.

[Updated on: Tue, 12 July 2016 23:10]

Report message to a moderator

Corporal 1st Class
Re: Absurdly small code changes[message #346209 is a reply to message #346142] Wed, 13 July 2016 01:09 Go to previous messageGo to next message
Uriens is currently offline Uriens

 
Messages:345
Registered:July 2006
LatZee wrote on Fri, 08 July 2016 20:13
One vote for keeping this in options. Not that i mind it by itself, it takes a bit to get used to it and then it's mostly fine, but fighting with militia present is already a clusterfuck, probably more militia dies to friendly fire then from enemies cheeky at least now you can help them a bit by ordering them to the ground occasionaly, with this on I will literally run away screaming from any fight involving militia cheeky


I quite agree with this. Until now you could go crouch/prone and be safe from militia 'friendly' fire. If that option no longer works it may cause lots of problems (and grief) due to the AI's inability to avoid shooting friendlies. Also, some maps/mods have lots of civilians in some sectors placed, how should i put it - badly. For example, there is a map in UC where if you enter it from the west side you see a female civilian and lots of children standing in the street and an enemy soldier has a spawn point right behind them. Usually, with 'up to now' system those civilians would go crouch and be safe from stray bullets but now, when that soldier sees you, it will be a massacre.

Report message to a moderator

Master Sergeant
Re: Absurdly small code changes[message #346216 is a reply to message #346209] Wed, 13 July 2016 11:17 Go to previous messageGo to next message
Deleted.

 
Messages:2657
Registered:December 2012
Location: Russian Federation
Quote:
I quite agree with this. Until now you could go crouch/prone and be safe from militia 'friendly' fire. If that option no longer works it may cause lots of problems (and grief) due to the AI's inability to avoid shooting friendlies. Also, some maps/mods have lots of civilians in some sectors placed, how should i put it - badly. For example, there is a map in UC where if you enter it from the west side you see a female civilian and lots of children standing in the street and an enemy soldier has a spawn point right behind them. Usually, with 'up to now' system those civilians would go crouch and be safe from stray bullets but now, when that soldier sees you, it will be a massacre.

My opinion is that prone should work old way - allowing to avoid friendly fire.
Also, it's possible to add checks for cowering state so cowering soldiers/civilians will avoid unaimed bullets even if crouched.



Left this community.

Report message to a moderator

Lieutenant

Re: Absurdly small code changes[message #346219 is a reply to message #346216] Wed, 13 July 2016 11:24 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
sevenfm wrote on Wed, 13 July 2016 10:17

My opinion is that prone should work old way - allowing to avoid friendly fire.
Also, it's possible to add checks for cowering state so cowering soldiers/civilians will avoid unaimed bullets even if crouched.

Isn't that cheat mode? Really, if someone fires a 20 round volley at a soldier that is standing inside a group of civilians it should have consequences.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Absurdly small code changes[message #346221 is a reply to message #346219] Wed, 13 July 2016 13:12 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
There shouldn't be any hack that magically protects civilians from being hit by bullets. If you don't want civilians to be hit, don't fire at them. If the AI uses civilians as shields, then that's a uncharacteristically smart move that should be encouraged.

Anyway, I have only briefly played with this - not sure how much the difference in regards to friendly fire will be felt.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: Absurdly small code changes[message #346222 is a reply to message #346219] Wed, 13 July 2016 13:12 Go to previous messageGo to next message
Deleted.

 
Messages:2657
Registered:December 2012
Location: Russian Federation
silversurfer wrote on Wed, 13 July 2016 13:24
sevenfm wrote on Wed, 13 July 2016 10:17

My opinion is that prone should work old way - allowing to avoid friendly fire.
Also, it's possible to add checks for cowering state so cowering soldiers/civilians will avoid unaimed bullets even if crouched.

Isn't that cheat mode? Really, if someone fires a 20 round volley at a soldier that is standing inside a group of civilians it should have consequences.

Civilians don't have prone animation, they can only crouch and cower, also AI limitations don't allow them to effectively avoid dangerous places. Also in 1.13 since HAM was added cowering state means that soldier tries to hide from bullets.



Left this community.

Report message to a moderator

Lieutenant

Re: Absurdly small code changes[message #346292 is a reply to message #346222] Sun, 17 July 2016 18:35 Go to previous messageGo to next message
Uriens is currently offline Uriens

 
Messages:345
Registered:July 2006
Ok, after some testing of this the feature, its not really that big of a change. It does allow someone to get hit by a stray bullet while standing prone or crouched but its nowhere near as big of a problem as i feared. I saw some militia hit another crouched militia in the back with a stray shot aimed at enemy at least 15 tiles further away. I also saw a stray bullet kill another militia that way already dying on the floor (prone position). None of my mercs were hit by stray bullets although i did place them too far forward in front militia. I think i'll keep using this feature even though i'm used to old system. Makes me think where i place my mercs even more then i used to. You may want to keep it as an option though as not everyone will like this change i'm sure.

Btw, i was using NCTH. Not sure how this acts in OCTH. Maybe someone can test it?

[Updated on: Sun, 17 July 2016 18:35]

Report message to a moderator

Master Sergeant
Re: Absurdly small code changes[message #346376 is a reply to message #346292] Tue, 26 July 2016 23:49 Go to previous messageGo to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
While I sometimes rant about the tendency to move vital functions to Lua scripts that have no business there (and as it's a pain to 'debug' makes my life harder), sometimes Lua is quite useful. Modders sometimes might want to do things that we can't really move to options or xml, and they can do that in Lua. A problem, however, is that they cannot alter what is stored in a savegame and what isn't. Technically, modders could use the SetFact/GetFact functions, but as there is no documentation on what values do what, that would be tremendously dangerous.

Luckily, that problem is now somewhat solved. I've added an array of 1000 signed integers that will be stored in savegames, and are reserved to be used exclusively by modders. You can do so with GetModderLUAFact and SetModderLUAFact, see an example from strategicmap.lua:

-- text colours
FontColour =
{
	FONT_MCOLOR_DKWHITE = 134,
	FONT_MCOLOR_LTYELLOW = 144,
	FONT_MCOLOR_RED = 163,
	FONT_MCOLOR_DKRED = 164,
	FONT_MCOLOR_LTGREEN = 184,
}

-- these numbers aren't used in the code - we only use them in LUA
Languages =
{
	LANGUAGE_ENGLISH = 0,
	LANGUAGE_GERMAN = 1,
	LANGUAGE_RUSSIAN = 2,
	LANGUAGE_DUTCH = 3,
	LANGUAGE_POLISH = 4,
	LANGUAGE_FRENCH = 5,
	LANGUAGE_ITALIAN = 6,
	LANGUAGE_CHINESE = 7,
}

-- We have an array of 1000 signed integers that a modder can use to set whatever data he wants.
-- We simply set up some enums here to make it easier for us to remember what is what
ModSpecificFacts =
{
	TIXA_PRISON_VOLUNTEERSGAINED = 123,
	TIXA_PRISON_SUBLEVEL_VOLUNTEERSGAINED = 124,
	ALMA_PRISON_VOLUNTEERSGAINED = 125,
}

-- this function is called whenever we liberate a sector. If fFirstTime is true, this is the first time we liberate this sector
function HandleSectorLiberation( sNewSectorX, sNewSectorY, bNewSectorZ, fFirstTime )

	-- are we liberating this sector for the first time?
	if ( fFirstTime ) then
		-- we get a few volunteers for liberating prisons - we assume prisoners would be more than eager to fight against the regime
		-- due to code limitations, fFirstTime is only used in surface sectors
		if ( bNewSectorZ == 0 ) then
			-- Tixa
			if ( sNewSectorX == 9 and sNewSectorY == SectorY.MAP_ROW_J ) then
				AddVolunteers( 30 )
				
				AddTransactionToPlayersBook(1, 0, 1800, 100)
				
				if ( GetUsedLanguage( nil ) == Languages.LANGUAGE_ENGLISH ) then
					SetScreenMsg(FontColour.FONT_MCOLOR_LTGREEN, "The prisoners are very grateful for freeing them.")
				elseif ( GetUsedLanguage( nil ) == Languages.LANGUAGE_GERMAN ) then
					SetScreenMsg(FontColour.FONT_MCOLOR_LTGREEN, "Die Gefangenen sind für die Befreiugng sehr dankbar.")
				else
					SetScreenMsg(FontColour.FONT_MCOLOR_DKRED, "Translation missing!")
				end
				
				-- inform us that there is a sublevel
				if ( (GetModderLUAFact(ModSpecificFacts.TIXA_PRISON_SUBLEVEL_VOLUNTEERSGAINED) == 0) ) then
					SetScreenMsg(FontColour.FONT_MCOLOR_LTGREEN, "This prison seems to have a sublevel, where more important inamtes are held.")
				end
				
				-- if we haven't yet freed the Alma prisoners, give us a tip about that
				if ( (GetModderLUAFact(ModSpecificFacts.ALMA_PRISON_VOLUNTEERSGAINED) == 0) ) then
					SetScreenMsg(FontColour.FONT_MCOLOR_LTGREEN, "A few inmates inform us that there is another prison like this in Alma!")
				end
				
				SetModderLUAFact(ModSpecificFacts.TIXA_PRISON_VOLUNTEERSGAINED, 1)
				
			-- Alma
			elseif ( sNewSectorX == 13 and sNewSectorY == SectorY.MAP_ROW_I ) then
				AddVolunteers( 10 )
				
				SetScreenMsg(FontColour.FONT_MCOLOR_LTGREEN, "The prisoners are very grateful for freeing them.")
												
				-- if we haven't yet freed the Tixa prisoners, give us a tip about that
				if ( (GetModderLUAFact(ModSpecificFacts.TIXA_PRISON_VOLUNTEERSGAINED) == 0) ) then
					SetScreenMsg(FontColour.FONT_MCOLOR_LTGREEN, "A few inmates inform us that there is another prison like this in a place called Tixa. They aren't sure where it is though.")
				end
				
				SetModderLUAFact(ModSpecificFacts.ALMA_PRISON_VOLUNTEERSGAINED, 1)
			end
		end
	end
...

which leads to this ingame:
http://i.imgur.com/qUfVF8y.png

In this example, ModSpecificFacts are enums from that 1000-sized array. You can name and use them however you like. They will be saved and loaded in the savegame, what you do with them is up to you. In this small example, I use it to print out different texts and a tiny bit of 'lore' depending on what sectors you already liberated. You can use this to set up your quests, store states of some attack, whatever. Integer values from -2^31 to 2^31 are valid.

While I'm at it, I added a few other tiny functions:

  • SetScreenMsg() can be used to print out texts, as seen in the image above (you could also print texts to other places, but I'tm not letting you access that aww). The first number is for the colour (in the example I listed some values), the second is the text, which can be up to 1000 chars long.
  • As you might want to have a different text depending on language, GetUsedLanguage( nil ) returns the language the game currently uses. The value corresponds to the Languages-enum I listed.

This has been added to the code in r8276 & GameDir r2331. This will be widely used in a future feature, but is useful enough on its own that I released it now.

@Modders: The, say, first 100 numbers will soon be used in an upcoming feature which will demonstrate the usage of this more widescaled. It's better for now if you use numbers 100-1000. (I don't plan on using all 100, but better safe than sorry).

[Updated on: Wed, 27 July 2016 01:30]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Previous Topic: New feature: AI medics and officers
Next Topic: New feature: additional dialogue
Goto Forum:
  


Current Time: Tue Dec 03 04:09:20 GMT+2 2024

Total time taken to generate the page: 0.03901 seconds