Home » MODDING HQ 1.13 » v1.13 Coding Talk » Code Snippets  () 1 Vote
Re: Code Snippets[message #327902] Mon, 11 November 2013 00:30 Go to previous messageGo to next message
silversurfer

 
Messages:2292
Registered:May 2009
Making good progress on the camouflage stuff but no update on SVN so far. When I'm done I will also merge Sevenfm's new mine avoiding feature.

New modifier in Ja2_Options.ini:
;------------------------------------------------------------------------------------------------------------------------------
; This setting defines the percentage area of a characters body that can be painted with camo kits. Usually only the face and hands
; can be painted with camo. The rest of the body has to be camouflaged by clothing and armor which are already colored.
; Setting this to 0 means camo kits are useless. At 100 camo kits can paint the whole body but cloth camo is useless.
; Valid values are from 0 to 100.
; default is 5
;------------------------------------------------------------------------------------------------------------------------------

CAMO_KIT_USABLE_AREA = 5

Camo paint is now what it should be - something to cover your naked skin which means face and hands. This is just a small portion of the body. That's why I set the default to 5. The remaining 95 percent are covered with clothes and they need to provide the camouflage for these 95 percent. Of course you can set a higher value for the kits which will make camo kits more powerful while making cloth camo less powerful and vice versa.
of camo kits now defines the efficiency of a camo kit. If it is 100 (like in stock 1.13) you will use 5 points from the kit to fully cover your face and hands (no more half the points used btw. - I removed that). If the kit has a of 20 for example this means that you will need 25 points from the kit to get the same camo bonus.
This way we can have camo kits of different efficiency levels.


New/changed modifiers in Item_Settings.ini:
;******************************************************************************************************************************
; This modifier sets the amount of camouflage on armor that applies when LBE is worn over the armor (NIV only).
; Valid values are from 0.0 to 1.0. 0.0 means no camo bonus from armor, 1.0 means full bonus even if LBE is worn over the armor.
; Default is 0.2
CAMO_LBE_OVER_VEST_MODIFIER = 0.2
CAMO_LBE_OVER_PANTS_MODIFIER = 0.6
;******************************************************************************************************************************

First I changed the name of the modifier for vest camo. This was necessary to distinguish between the old vest and new pants modifier.
Because we have leg LBE I decided to add a camo modifier for this as well. The default of 0.6 means that 40 percent of our legs could possible be covered by thigh rigs so we only have 60 percent camo from the pants. If you wear only one thigh rig it covers only 20 percent of course and leg armor camo will be at 80 percent. No thigh rig = 100 percent pants camo. Simple as that.


Some things that I still need to solve/think about:

1. Kit camo wears out very fast. If you lose 2 points every hour the 5 points that you applied will be gone after 3 hours. I guess I will have to use some randomness to remove camo or not. This also applies to characters in water. May as well leave it at that so you have to apply fresh camo regularly. Camo kits will still last long unless they have a very low efficiency.

2. Sometimes we encounter camouflaged enemies or militia. They are affected by the new kit camo limit as well so I decided to give them an outfit camo bonus. I hope this works but I wasn't able to test it so far.

3. When loading old savegames they could still have characters with too high kit camo values. This shouldn't be a problem. Every hour kit camo is reduced by a certain amount and I implemented an additional check there to limit current camo into valid values. So when you load an old savegame don't be surprised that old high camo values drop to the new limit at the full hour.


I guess I will finish my work tomorrow and then commit the changes to SVN.

Re: Code Snippets[message #327906] Mon, 11 November 2013 00:38 Go to previous messageGo to next message
Flugente

 
Messages:3338
Registered:April 2009
Location: Germany
silversurfer
1. Kit camo wears out very fast. If you lose 2 points every hour the 5 points that you applied will be gone after 3 hours. I guess I will have to use some randomness to remove camo or not. This also applies to characters in water. May as well leave it at that so you have to apply fresh camo regularly. Camo kits will still last long unless they have a very low efficiency.
I can help with that. Take a look at the
UINT32	usSkillCooldown[SOLDIER_COOLDOWN_MAX];	// cooldown used for various skill/trait/taint effects
member variables of SOLDIERTYPE. You could set a 'timer' for cooldown (3...2...1...remove 1% camo) that decreases every hour.


Re: Code Snippets[message #327918] Mon, 11 November 2013 01:36 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Some experimental adjustments to explosive things.
1) Every normal explosion (only outdoor, not underground) causes small smoke - cosmetic feature.
2) You can attach some explosives to your grenade or mine:
- Attach rubber band or duct tape.
- Attach as many explosives or grenades (usItemClass= 256 or 512) as you wish. Attached explosives should have ubVolatility>0. No nested recursive attachments, only first level of attachments is processed.
- Throw to the enemy as usual grenade or plant as usual mine or TNT.
- PROFIT.
3) You can attach some special items to your explosives to add some special effects:
- molotov's explosion
- bigger molotov's explosion
- some frags

New self-describing options for ja2_options.ini:
ADD_SMOKE_AFTER_EXPLOSION = FALSE
ALLOW_EXPLOSIVE_ATTACHMENTS = FALSE
ALLOW_SPECIAL_EXPLOSIVE_ATTACHMENTS = FALSE

How it works:
Smoke effect is added to InternalIgniteExplosion function.
Toggle Spoiler

New function HandleAttachedExplosions is added after HandleBuddyExplosions and is mostly copypasted from it.
Toggle Spoiler

Added new parameter OBJECTTYPE * pObj =NULL to functions void IgniteExplosion and void InternalIgniteExplosion.
Added OBJECTTYPE* parameters when calling IgniteExplosion nearly everywhere.

Added new items 1702(SMALL_SMOKE), 1703 (GAS_EXPLOSION) and 1704 (FRAG_EXPLOSION) and new explosives 96 (SMALL_SMOKE), 97 (GAS_EXPLOSION) and 98 (FRAG_EXPLOSION).

Tested with different types and combinations and it seems ok.
Yet still it touches explosive game mechanics so it should be considered experimental feature and it definitely needs some thorough testing.
I would also be very grateful for any critical review from more experienced coders.

Link to source diff, gamedir diff and compiled exe:
(this includes mine-avoiding code from previous post)

[Updated on: Sun, 01 December 2013 12:19] by Moderator



Re: Code Snippets[message #327925] Mon, 11 November 2013 11:09 Go to previous messageGo to next message
silversurfer

 
Messages:2292
Registered:May 2009
Sevenfm

2) You can attach some explosives to your grenade or mine:
- Attach rubber band or duct tape.
- Attach as many explosives or grenades (usItemClass= 256 or 512) as you wish. Attached explosives should have ubVolatility>0. No nested recursive attachments, only first level of attachments is processed.
- Throw to the enemy as usual grenade or plant as usual mine or TNT.
- PROFIT.
3) You can attach some special items to your explosives to add some special effects:
- molotov's explosion
- bigger molotov's explosion
- some frags

You certainly don't throw a pack of explosives anymore, especially if a gas can is attached to it. The pack will be much too heavy and bulky to throw. It would be best to prevent such a pack from being thrown. Planting would be ok as some kind of death trap.

Re: Code Snippets[message #327927] Mon, 11 November 2013 12:03 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Quote:
You certainly don't throw a pack of explosives anymore, especially if a gas can is attached to it. The pack will be much too heavy and bulky to throw. It would be best to prevent such a pack from being thrown. Planting would be ok as some kind of death trap.


1. Adding attachments is fully configured by attachments.xml, by default 1.13 does not allow any attachments to grenades or explosives at all (except for detonators or tripwire).

2. Added weight should greatly reduce throwing range, but has some bug in it.

3. I think maybe it will be good to just increase ratio that reduces throwing range so you simply would not be able to throw heavy grenade farther than several tiles.

4. I do not check actual item id but check if it has tag , so it's xml work to allow or deny attachments of bulky gas tanks.

The idea of this feature is to allow player to throw packs of grenades as it sometimes happens in real wars and make some powerful bombs from available items, especially at the beginning of game when you do not have much firepower but still have to deal with devastating drassen counterattack.


Re: Code Snippets[message #327939] Mon, 11 November 2013 15:13 Go to previous messageGo to next message
silversurfer

 
Messages:2292
Registered:May 2009
Flugente
I can help with that. Take a look at the
UINT32	usSkillCooldown[SOLDIER_COOLDOWN_MAX];	// cooldown used for various skill/trait/taint effects
member variables of SOLDIERTYPE. You could set a 'timer' for cooldown (3...2...1...remove 1% camo) that decreases every hour.

Interesting. Though it's not exactly a skill cooldown and I wouldn't want the kit camo to last too long. I think that 5 hours is long enough before it becomes useless so I simply changed the reduction from 2 to 1. You can repaint 1 point every hour if you like or 5 points after 5 hours or...
Hunter/Rangers are special because they have CAMO_WORNOUT_SPEED_REDUCTION = 50. With this value of 50 a hunter has a 50/50 chance of 1 point reduction per hour whereas the ranger will always keep his camo. If the value is at 100 even the hunter will never lose his painted face.

I did the same for water camo removal. Medium water depth will not remove camo anymore because the parts that are painted should be above water level. In deep water however we lose 1 point now instead of 2.

All changes are now on SVN including Sevenfm's mine avoidance for civilians, smoke effects and explosive attachments. Exe revision 6582 with GameDir 1866. Have fun.

Re: Code Snippets[message #327940] Mon, 11 November 2013 15:30 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
silversurfer, thanks for you great help!

What do you think about "attachments weight not calculated for thrown distance" bug?

I looked at function CalcMaxTossRange in Tactical\Weapons.cpp and changed line
iRange = 2 + ( iThrowingStrength / (3 + (Item[usItem].ubWeight) / 3 ));

to
if(pObject!= NULL)
	iRange = 2 + ( iThrowingStrength / (3 + (CalculateObjectWeight(pObject)) / 3 ));
else
	iRange = 2 + ( iThrowingStrength / (3 + (Item[usItem].ubWeight) / 3 ));


also i added OBJECTTYPE* pObject=NULL to function definition and added pObj parameter to function calls in Tactical/Weapons.cpp and TileEngine/physics.cpp.

Now the bug with incorrect range calculation has gone in my tests.
EDIT: red aim still doesn't work correctly with added weight from attachments, though actually throwing works fine now.
I thing it uses another function which i was unfortunately unable to find yet.
EDIT2: i think problem was in function HandleNonActivatedTossCursor
// Do we have a launcable?
pObj = &(pSoldier->inv[HANDPOS]);
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter) {
	if ( Item[ iter->usItem ].usItemClass & IC_EXPLOSV && iter->exists())
	{
		pObject = &(*iter);
		break;
	}
}

so i added check
if(Item[pObj->usItem].usItemClass & IC_WEAPON )

to prevent wrong logic when we throw item with explosives or grenade attached

EDIT: added link to patch
also added small fix (tripwire items previously did not set MAPELEMENT_PLAYER_MINE_PRESENT flag)
patch file (based on r6575)

[Updated on: Mon, 11 November 2013 21:05] by Moderator



Re: Code Snippets[message #328013] Tue, 12 November 2013 14:07 Go to previous messageGo to next message
silversurfer

 
Messages:2292
Registered:May 2009
Sevenfm

EDIT: added link to patch
also added small fix (tripwire items previously did not set MAPELEMENT_PLAYER_MINE_PRESENT flag)

I just committed the patch in revision 6585.

Re: Code Snippets[message #328040] Tue, 12 November 2013 21:17 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
I have done some tests on throwing grenades and stuff, and results seem strange.

r6446, r6585, stock 1.13, default options
hired Igor, landed in Omerta.

mini grenade (300g) - 24 tiles
Mk2 grenade (600g) - 19 tiles
40mm HE grenade (200g) - 31 tiles (!?)
Gas Tank (2kg) - 5 tiles
Dusters (100g) - 15 tiles

code from r6446, Tactical\Weapons.cpp, CalcMaxTossRange:

else if ( Item[ usItem ].usItemClass == IC_GRENADE )
{
	DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcmaxtossrange: grenade");
	// start with the range based on the soldier's strength and the item's weight
	// Altered by Digicrab on 14 March, 2004
	// Reversed a Ja2Gold change that made grenades of weight 3 or more have the same throw distance as those of weight 3.
	INT32 iThrowingStrength = ( EffectiveStrength( pSoldier, FALSE ) * 2 + 100 ) / 3;
	iRange = 2 + ( iThrowingStrength / (3 + (Item[usItem].ubWeight) / 3 ));
}
else
{	// not as aerodynamic!
	// start with the range based on the soldier's strength and the item's weight
	iRange = 2 + ( ( EffectiveStrength( pSoldier, FALSE ) / ( 5 + Item[usItem].ubWeight) ) );
}


If we assume effective strengh=80, then we have:

for mk2 grenade (weight=6)
iRange=2+86/(3+6/3)=19 tiles

for mini grenade (weight=3)
iRange=2+86/(3+3/3)=23 tiles

for 40mm HE grenade (weight=2)
iRange=2+86/(3+2/3)=30 tiles

for dusters (weight=1)
iRange=2+80/(5+1)=15 tiles

Why 200g item is thrown twice as far as 100g item?


Re: Code Snippets[message #328042] Tue, 12 November 2013 21:23 Go to previous messageGo to next message
Flugente

 
Messages:3338
Registered:April 2009
Location: Germany
Because... grenade. Also, there is the aerodynamic tag, I'd expect that to be directly referred here.


Re: Code Snippets[message #328043] Tue, 12 November 2013 21:35 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Dusters do not have tag, and in that case iRange will be =1
There's no need for grenade launchers with range=30, and it's even without Demolitions trait.


Re: Code Snippets[message #328217] Fri, 15 November 2013 20:40 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Small changes and fixes for grenades and explosives.
1) Fixed small bug when MAPELEMENT_PLAYER_MINE_PRESENT was set after planting explosives with remote detonator.
2) Arming bomb with only remote defuse attached is not allowed.
3) Showing item locator before "add blueflag" messagebox is disabled for our mines as it was annoying and you anyway know that it is here.
4) Total weight for throwing range is calculated for all items (previously it was calculated only for grenades).
5) Grenade-throwing formula and demolitions bonus applied only for hand-thrown grenades (check for TOSSCURS). Previously it was applied for launched grenades too.
6) Changed grenade throwing range formula from
iRange = 2 + ( iThrowingStrength / (3 + itemWeight / 3 ));

to
iRange = 2 + ( iThrowingStrength * 5 ) / ( 15 + itemWeight * 2 );

Now weight ratio is changed from 3 to 2.5, it reduces maximum range by 1-2 tiles in general.
Also new formula allows for more range steps in calculation.
Calculation tables (excel ) can be found here
throwing range calculations
7) Added support for trip klaxon and trip flare as explosive attachments (only for tripwire activation)

Patch for 6598 can be found here
6598_explosives_throwing patch


Re: Code Snippets[message #328218] Fri, 15 November 2013 22:10 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
@Sevenfm: Thanks, committed


Re: Code Snippets[message #328276] Sun, 17 November 2013 20:54 Go to previous messageGo to next message
Wil473

 
Messages:2830
Registered:September 2004
Location: Canada
Sevenfm
Added new items 1702(SMALL_SMOKE), 1703 (GAS_EXPLOSION) and 1704 (FRAG_EXPLOSION) and new explosives 96 (SMALL_SMOKE), 97 (GAS_EXPLOSION) and 98 (FRAG_EXPLOSION).


While importing these three new internal items into my projects, found that the three items appear to be buyable. Additionally they have non v1.13 item sizes (unless I'm mistaken but AIMNAS, my projects, and perhaps Strohmann's overhaul use the expansion on item sizes). I've zero'd out all the unnecessary tags and set the not-buyable flag in my projects.


Re: Code Snippets[message #328279] Sun, 17 November 2013 21:06 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Quote:
While importing these three new internal items into my projects, found that the three items appear to be buyable. Additionally they have non v1.13 item sizes (unless I'm mistaken but AIMNAS, my projects, and perhaps Strohmann's overhaul use the expansion on item sizes). I've zero'd out all the unnecessary tags and set the not-buyable flag in my projects.


Yes, i've overlooked that tags and they definitely should be fixed in 1.13.
Their sizes actually doesn't matter as they should not appear in game as real items. They are used only to provide info for added explosions from special attachments add added smoke.


Re: Code Snippets[message #328280] Sun, 17 November 2013 21:24 Go to previous messageGo to next message
silversurfer

 
Messages:2292
Registered:May 2009
I guess they should look like this or are there any more tags that could be removed?
Toggle Spoiler

should also be set for item 1699, the internal flare item for Flugente's artillery.

Re: Code Snippets[message #328286] Mon, 18 November 2013 01:25 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
The following ITEM's work fine in my tests:
Toggle Spoiler

As they should not be actually created, i suppose they don't need other tags.

[Updated on: Mon, 18 November 2013 01:26] by Moderator



Re: Code Snippets[message #328289] Mon, 18 November 2013 10:07 Go to previous messageGo to next message
silversurfer

 
Messages:2292
Registered:May 2009
Thanks, I updated them in revision 1874.

Re: Code Snippets[message #328436] Fri, 22 November 2013 03:01 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
- Fixed small bug : SHIFT+ALT+C always showed enemy mines, even without metal detector.
- Fixed: incorrect tripwire hierarchy calculation.

patch file


Re: Code Snippets[message #328460] Sat, 23 November 2013 00:15 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
Sevenfm
- Fixed small bug : SHIFT+ALT+C always showed enemy mines, even without metal detector.
- Fixed: incorrect tripwire hierarchy calculation.

patch file


thanks, committed


Re: Code Snippets[message #328470] Sat, 23 November 2013 16:02 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Small convenience feature - improved bomb planting.
With new option IMPROVED_BOMB_PLANTING = TRUE, if you hold SHIFT key while planting new mine, then another mine with same item id will be taken automatically from your merc's inventory. If no such item found, any mine will be taken. If you plant tripwire-triggered mine, then only tripwire-triggered items will be taken. This new feature work only in realtime.
If you are making tripwire network, then this feature can be used to plant another tripwire item with network and hierarchy settings taken from previously planted tripwire. You just plant tripwire as usual, selecting it's settings from dialogue, then if you plant another one while holding SHIFT key, those settings will be used for new tripwire, instead of showing you dialogue.

I hope this small improvement will save you some time for building large and complicated defensive minefields.

patch r6641
ja2_settings.ini patch gamedir 1878


Re: Code Snippets[message #328495] Sun, 24 November 2013 13:28 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
thanks sevenfm, committed.


Re: Code Snippets[message #328668] Thu, 28 November 2013 14:38 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Some small fixes and improvements for explosive things:

- New mine disarm dialogue (only for realtime): Disarm, Inspect, Remove Blue Flag, Blow up.
- You can now attach tripwire-activated explosives to tripwire.
- attached explosives volatility is now used in chain explosion calculation: added new function CalcTotalVolatility.
- new function CheckForBuriedBombsAndRemoveFlags removes MAPELEMENT_XXX_MINE_PRESENT flags if there is no buried bomb at checked tile. This should fix problems with flag not removed correctly after chain explosions and such.
- trip klaxon no longer calls enemies if it's activated as attached explosive (instead it makes some noise).
- added check to MineSpottedDialogueCallBack. It should fix problem with game crash with tiles that have MAPELEMENT_PLAYER_MINE_PRESENT flag set but no buried mine
- disarmed item will keep it's attachments if ALLOW_ATTACHED_EXPLOSIVES is TRUE.
- IMPROVED_BOMB_PLANTING feature can be used to auto-take tripwire items from inventory.

patch r6661

New disarm dialog:

[Updated on: Sun, 01 December 2013 12:15] by Moderator



Re: Code Snippets[message #328688] Fri, 29 November 2013 09:56 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
nice work, patch is committed


Re: Code Snippets[message #328799] Wed, 04 December 2013 15:16 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Ctrl+D in turnbased - skip player interrupts for that turn.
Only Old Interupt System, only singleplayer.

r6679 patch
patched r6679 exe for testing


Re: Code Snippets[message #328803] Wed, 04 December 2013 21:33 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Another infinitesimal feature (only NAS):
1) New merge type USE_ITEM_NEW (13)
It creates new items with firstResultingItemIndex and secondResultingItemIndex (if defined) and deducts 1 point from firstItemIndex's status (for each new item).
When firstItemIndex's status reaches 0, the item is destroyed.
With this type of merge, you can use knife on tripwire roll, for example, to get 2 new tripwire items. So you can think of tripwire roll as container for 100 tripwires.
Toggle Spoiler

2) USE_ITEM merge creates secondResultingItemIndex item if defined.
With this secondResultingItemIndex defined, you can use knife on T-Shirt to get 2 rags.
Toggle Spoiler

patch r6679

[Updated on: Wed, 04 December 2013 21:34] by Moderator



Re: Code Snippets[message #328814] Thu, 05 December 2013 10:27 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
Thanks Sevenfm, both pathes (Ctrl + D & USE_ITEM_NEW) have been committed.


Re: Code Snippets[message #328826] Fri, 06 December 2013 15:43 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
New option ALTERNATE_MOUSE_COMMANDS in Ja2_Options.ini
With this option =TRUE, mousewheel is inverted for changing stance with ALT+mousewheel, also some new mouse actions are possible.

Mouse actions excel table

Some code blocks in Turn Based Input.cpp were moved to separate functions to prevent unnecessary copypasting.

r6683 patch
Ja2_options.ini gamedir 1888 patch

r6683 patched exe for testing

[Updated on: Fri, 06 December 2013 15:54] by Moderator



Re: Code Snippets[message #328830] Fri, 06 December 2013 18:41 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Added support for turnbased mode to extended disarm dialog.
AP/BP costs:
Disarm: AP_DISARM_MINE, BP_DISARM_MINE
Inspect: AP_DISARM_MINE/2, BP_DISARM_MINE/2
Remove Blue Flag: AP_DISARM_MINE/2, BP_DISARM_MINE/2
Blow Up: AP_DISARM_MINE/4, BP_DISARM_MINE/4

Note: AP_DISARM_MINE value is modified if merc has ambidextrous trait.

patch r6683


Re: Code Snippets[message #328831] Fri, 06 December 2013 19:06 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
Sevenfm
New option ALTERNATE_MOUSE_COMMANDS in Ja2_Options.ini
With this option =TRUE, mousewheel is inverted for changing stance with ALT+mousewheel, also some new mouse actions are possible.

Mouse actions excel table

Some code blocks in Turn Based Input.cpp were moved to separate functions to prevent unnecessary copypasting.

r6683 patch
Ja2_options.ini gamedir 1888 patch

r6683 patched exe for testing


Committed. I also uploaded the excel file to the "Docs\Manuals" folder:
https://ja2svn.no-ip.org/source/ja2_v1.13_data/GameDir/Docs/Manuals/JA2_113_Alternate_Mouse_Commands.xlsx


Re: Code Snippets[message #328832] Fri, 06 December 2013 19:11 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
Sevenfm
Added support for turnbased mode to extended disarm dialog.
AP/BP costs:
Disarm: AP_DISARM_MINE, BP_DISARM_MINE
Inspect: AP_DISARM_MINE/2, BP_DISARM_MINE/2
Remove Blue Flag: AP_DISARM_MINE/2, BP_DISARM_MINE/2
Blow Up: AP_DISARM_MINE/4, BP_DISARM_MINE/4

Note: AP_DISARM_MINE value is modified if merc has ambidextrous trait.

patch r6683


Committed


Re: Code Snippets[message #328833] Fri, 06 December 2013 19:18 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Thank you for your help, RoWa! :smilingsoldier:


Re: Code Snippets[message #328880] Mon, 09 December 2013 22:28 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Small visual changes:
1) ENEMY_HIT_COUNT in ja2_options.ini accepts 2 new parameters:
3 - show damage as white asterisks
4 - show damage as red asterisks
Number of asterisks is scaled (maximum 5): >0, >10, >30, >60, >100

2) Suppression tactical tooltip now shows suppression points from last attacks.
Previously it was always = 0 because ubSuppressionPoints value is cleared after each attack.

3) It is now possible to show suppression values above soldier, just as hit count.
There are new options in ja2_options.ini

Possible values:
0 - do not show
1 - show on moving hit counter
2 - show above soldier
The values are color coded:
Suppression is light gray
Shock is yellow
AP loss is blue
Morale hit is green

SHOW_SUPPRESSION_COUNT = 0
SHOW_SHOCK_COUNT = 0
SHOW_AP_COUNT = 0
SHOW_MORALE_COUNT = 0

This option defines if values are shown as numbers or asterisks (1..5, using scale)
SHOW_SUPPRESSION_USE_ASTERISK = FALSE

This option defines if only 1 asterisk is shown or several (1..5) to represent value
SHOW_SUPPRESSION_SCALE_ASTERISK = TRUE

Show suppression above soldier during enemy attack. All other values are shown after attack, when HandleSuppressionFire function is calculated.
SHOW_SUPPRESSION_COUNT_ALT = TRUE


patch r6688
patch gamedir1890
patched exe r6688 for testing

Recommended settings for playing:
Toggle Spoiler
With these settings, you will see red hit indicator, and grey suppression indicator above soldier.

[Updated on: Tue, 10 December 2013 00:56] by Moderator



Re: Code Snippets[message #328884] Tue, 10 December 2013 13:25 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
@Sevenfm: Cool, committed.


Re: Code Snippets[message #328966] Sat, 14 December 2013 10:58 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
New options in ja2_options.ini

1) PLAYER_HIT_COUNT = 0
This works as ENEMY_HIT_COUNT option, but for player mercs.
Possible values: 0 - 4

2) SOLDIER_TOOLTIP_DISPLAY_SUPPRESSION_INFO = TRUE
Show additional info in tactical tooltip:
- APs lost due to suppression
- Suppression Tolerance
- Effective Shock Level ( Shock level modified by traits and backgrounds. This value is compared with current suppression tolerance to determine "cowering" effect )
- AI morale level

3) SHOW_ENEMY_WEAPON = TRUE
Show enemy weapon name above soldier - after health, name and rank.
You can see exact weapon name only on short distances, range calculation is similar to dynamic tooltips and based on soldiers actual viewing range and experience.

Some example screenshotsr6689 patch
gamedir 1891 patch


Re: Code Snippets[message #328980] Sat, 14 December 2013 20:50 Go to previous messageGo to next message
pheloncab

 
Messages:275
Registered:August 2004
Location: So. Cal. or texas
Nice stuff Sevenfm, I am wondering if #3 could be changed from Binary one off to
0- off no display
1- relative - only shows type/subtype not exact weapon.
2- dynamic as you have it
3- full- always shows exact weapon



I can see doing Tshooting/balancing on mods going faster and better with #3, and situations where just knowing its a sniper rifle, or an AR is plenty of info, knowing exactly what it is could give players too much advantage knowing the effective ranges etc..

Re: Code Snippets[message #328981] Sat, 14 December 2013 21:23 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
pheloncab
#3 was intended mostly for players - to reduce the need for ALT+showing tactical tooltip.
For modders, we already have tooltips with full debug info at any range.

I agree that this feature could be changed or improved after some time if there will be some feedback or requests from modders/players.


Re: Code Snippets[message #329032] Mon, 16 December 2013 11:43 Go to previous messageGo to next message
RoWa21

 
Messages:2040
Registered:October 2005
Location: Austria
Sevenfm
New options in ja2_options.ini

1) PLAYER_HIT_COUNT = 0
This works as ENEMY_HIT_COUNT option, but for player mercs.
Possible values: 0 - 4

2) SOLDIER_TOOLTIP_DISPLAY_SUPPRESSION_INFO = TRUE
Show additional info in tactical tooltip:
- APs lost due to suppression
- Suppression Tolerance
- Effective Shock Level ( Shock level modified by traits and backgrounds. This value is compared with current suppression tolerance to determine "cowering" effect )
- AI morale level

3) SHOW_ENEMY_WEAPON = TRUE
Show enemy weapon name above soldier - after health, name and rank.
You can see exact weapon name only on short distances, range calculation is similar to dynamic tooltips and based on soldiers actual viewing range and experience.

Some example screenshotsr6689 patch
gamedir 1891 patch


committed


Re: Code Snippets[message #329060] Wed, 18 December 2013 08:16 Go to previous messageGo to next message
sevenfm

 
Messages:1534
Registered:December 2012
Improved Auto Fast Forward.
New options in ja2_options.ini

AUTO_FAST_FORWARD_ENEMIES:
0 - default behavior
1 - auto fast forward only enemies that are not seen by player's team
2 - auto fast forward only invisible enemies
3 - auto fast forward all enemies

AUTO_FAST_FORWARD_MILITIA:
0 - default behavior
1 - auto fast forward only militia that does not see enemies
2 - auto fast forward militia always

Note: only movement is accelerated, most of specific actions like shooting and tossing grenades are performed at normal speed

patch r6692
patch gamedir1894


Re: Code Snippets[message #329061] Wed, 18 December 2013 08:36 Go to previous messageGo to previous message
smeagol

 
Messages:2710
Registered:June 2008
Location: Bremen, Germany
Sevenfm
Improved Auto Fast Forward.



That's super sweet. Thumbs up!


Previous Topic: New Attachment System Beta
Goto Forum:
  


Current Time: Tue Jun 19 01:56:46 EEST 2018

Total time taken to generate the page: 0.01952 seconds