Home » MODDING HQ 1.13 » v1.13 Coding Talk » Code Snippets  () 1 Vote
Re: Code Snippets[message #330794] Sat, 22 February 2014 18:57 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
Sector Inventory Manipulations Dialog: Ctrl+[i] (changed to Ctrl+[v])
http://i.imgur.com/8v5XZGs.png

Cover Mode Display Dialog: Ctrl+[c]
http://i.imgur.com/M8Azq7H.png

Toggle Spoiler

r6958 patch
patched exe for testing

What do you think?

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330795] Sat, 22 February 2014 19:39 Go to previous messageGo to next message
Gambigobilla

 
Messages:693
Registered:July 2008
So ugly yet so awesome Smile

Report message to a moderator

First Sergeant
Re: Code Snippets[message #330801] Sat, 22 February 2014 21:54 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Very nice. It's nice to see something that frees up a few key combos for a change Wink

Comitted in r6966.

Report message to a moderator

Captain

Re: Code Snippets[message #330803] Sat, 22 February 2014 22:01 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
Honestly, even after years of playing i still don't remember all that ctrl+shift+[smth] ROFL , and these menus should simplify things a bit for new players.
And there are free buttons for new cool features (if someone will implement them) :compcuppa:

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330812] Sun, 23 February 2014 19:14 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
New option:

SET_DEFAULT_AUTOFIRE_BULLETS = 0

Set default number of autofire bullets:
0 = Default - 1 bullet
1 = Max bullets allowed with max aiming
2 = Set bullet number based on weapon class:
MP, SMG - 3 bullets
AR - 2 bullets
MG - 5 bullets

Toggle Spoiler


[Updated on: Mon, 24 February 2014 18:57] by Moderator

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330814] Sun, 23 February 2014 19:22 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
I'd set default AR to 3 as well, it's more useful for the intermediate class while battle rifles do well with single.

Report message to a moderator

Captain

Re: Code Snippets[message #330816] Sun, 23 February 2014 19:35 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
My thoughts on number of bullets:

1. As far as i know, in real world army soldiers are taught to fire no more than 2 bullets, because first bullet goes to target, second goes slightly higher, and third usually goes somewhere else.
2. Burst triggers (and most of burst-capable ARs) already fire 3 rounds.
3. Because of nature of autofire, soldier will often fire more than 2 rounds.
4. SMGs and MPs are less powerful than ARs, and are used at close distance, so they usually need more bullets to fire.
5. MGs are usually used for suppression and have belts with hundreds of rounds.

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330818] Sun, 23 February 2014 20:02 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
3 is still the more useful number in game.

Report message to a moderator

Captain

Re: Code Snippets[message #330825] Sun, 23 February 2014 21:56 Go to previous messageGo to next message
Anthropoid is currently offline Anthropoid

 
Messages:145
Registered:February 2014
Those dialogs look awesome!

My anecdotal observations on burst fire:

1. Mercs without Auto or MG skill shouldn't waste bullets by firing on burst mode or auto unless they are very close . . . ~4 tiles or less.

2. Mercs with Auto or MG skill should always fire at least on burst, they hit more it seems than if they fire single shots, even using full aim on both.

3. Mercs with full MG skill make full auto fire very effective.

I've come to the conclusion that Auto Weapons skill if not MG skill is the best skill in the game as of 6670.

Report message to a moderator

Sergeant
Re: Code Snippets[message #330826] Sun, 23 February 2014 22:18 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
Updated version - now 3 different options:

Set default number of autofire bullets:
0 = Max bullets allowed with max aiming
1..10 = Set default number of bullets

1. For MPs and SMGs
SET_DEFAULT_AUTOFIRE_BULLETS_SMG = 1
2. For ARs, Rifles and Shotguns
SET_DEFAULT_AUTOFIRE_BULLETS_AR = 1
3. For MGs
SET_DEFAULT_AUTOFIRE_BULLETS_MG = 1

[Updated on: Mon, 24 February 2014 18:57] by Moderator

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330831] Mon, 24 February 2014 18:46 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
Update:
Enabled auto-taking for concertina/sandbags:
- items are taken from current merc's inventory
- works only in realtime
- when filling sandbags, filled sandbag is dropped, and new empty is taken from inventory
- you need to press [shift] while clicking with hammer for this feature to be activated
- this patch includes previous (autofire bullets)

r6970 patch (autofire+sandbags)
gamedir1954 patch with autofire bullets options
patched r6970 with autofire and sandbags

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330834] Tue, 25 February 2014 00:57 Go to previous messageGo to next message
smeagol is currently offline smeagol

 
Messages:2705
Registered:June 2008
Location: Bremen, Germany
CTRL + i for that important menu which can access a lot of useful stuff seems a bit awkward... I mean, isn't there a combination that can easily be used with one hand? CTRL and i are somewhat far away from each other.

It's really just nitpicking, but that menu replaces basically all of the regular combinations that are frequently used after combat, having a more convenient way of opening the menu might be appropriate.

Just my two cents... I'd take it even with CTRL + i, but a different more easily reachable combination sure won't hurt.

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330836] Tue, 25 February 2014 04:21 Go to previous messageGo to next message
Gorro der Grüne is currently offline Gorro der Grüne

 
Messages:1448
Registered:March 2009
Location: Broadwurschd-City
@ smeag

there are 2 [ctrl] keys

Report message to a moderator

Sergeant Major
Re: Code Snippets[message #330841] Tue, 25 February 2014 08:23 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
@smeagol
Also noticed that it's not convenient to press current combination.

I will probably change it to ctrl+'v'. (it will also move this hotkey from cheat codes)
Or maybe it's good idea to change this hotkey to simple 'v', and move version info to Ctrl+'v'.
Any thoughts?

@all What other actions should be added to these new menus?
What do you think about other new features (sandbags, autofire)?

[Updated on: Tue, 25 February 2014 09:31] by Moderator

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330847] Tue, 25 February 2014 14:07 Go to previous messageGo to next message
Gorro der Grüne is currently offline Gorro der Grüne

 
Messages:1448
Registered:March 2009
Location: Broadwurschd-City
V=version info shall NOT be touched

Report message to a moderator

Sergeant Major
Re: Code Snippets[message #330849] Tue, 25 February 2014 14:41 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Right, because it's such an important and oft used command that it deserves a top layer key...
...
...
Not.

Report message to a moderator

Captain

Re: Code Snippets[message #330850] Tue, 25 February 2014 14:48 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
This patch changes inventory dialog hotkey to Ctrl+[v]

Agree that we should keep vanilla hotkeys in default setup.

r6975 patch

Report message to a moderator

Lieutenant

Re: Code Snippets[message #330879] Wed, 26 February 2014 21:23 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
The following patches have been committed:

- Enabled auto-taking for concertina/sandbags
- Autofire bullets
- Changed inventory dialog hotkey to Ctrl+[v]

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331102] Fri, 07 March 2014 19:03 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
Press 'd' in realtime to start turn-based immediately, if there is enemy in sector.
You will return to realtime if no enemy contact for 2 turns, as usual.
Useful for sneaking in some situations.

r7026 patch

Report message to a moderator

Lieutenant

Re: Code Snippets[message #331130] Sat, 08 March 2014 15:17 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Sevenfm
Press 'd' in realtime to start turn-based immediately, if there is enemy in sector.
You will return to realtime if no enemy contact for 2 turns, as usual.
Useful for sneaking in some situations.

r7026 patch


Nice, I will add it to svn
EDIT: done

[Updated on: Sat, 08 March 2014 15:20] by Moderator

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331160] Mon, 10 March 2014 14:00 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
1. Two more options for 'improved auto fast forward' feature:

0 - default behaviour
1 - auto fast forward only invisible
2 - auto fast forward always

AUTO_FAST_FORWARD_CIVS = 0
AUTO_FAST_FORWARD_CREATURES = 0

2. Minor cosmetic fixes/improvements

r7045 patch
gamedir1975 patch

Report message to a moderator

Lieutenant

Re: Code Snippets[message #331168] Mon, 10 March 2014 21:38 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Sevenfm
1. Two more options for 'improved auto fast forward' feature:

0 - default behaviour
1 - auto fast forward only invisible
2 - auto fast forward always

AUTO_FAST_FORWARD_CIVS = 0
AUTO_FAST_FORWARD_CREATURES = 0

2. Minor cosmetic fixes/improvements

r7045 patch
gamedir1975 patch


Committed

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331170] Mon, 10 March 2014 22:20 Go to previous messageGo to next message
Uriens is currently offline Uriens

 
Messages:346
Registered:July 2006
Sevenfm
1. Two more options for 'improved auto fast forward' feature:

0 - default behaviour
1 - auto fast forward only invisible
2 - auto fast forward always

AUTO_FAST_FORWARD_CIVS = 0
AUTO_FAST_FORWARD_CREATURES = 0


Wow man, this is very, very useful. I'll use option 1 for pretty much all my games. Thanks for doing this. :cheers:

Report message to a moderator

Master Sergeant
Re: Code Snippets[message #331281] Sat, 15 March 2014 14:32 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
More visual enemy gear info:
ja2_options.ini
;------------------------------------------------------------------------------------------------------------------------------
; Show additional info in NCTH cursor (press ALT)
; 0 - default cursor
; 1 - show enemy armour
; 2 - show armour, weapons and head items
;------------------------------------------------------------------------------------------------------------------------------

ADDITIONAL_NCTH_CURSOR_INFO = 2

Press [ALT] when targeting body part to see armour/item:
http://i.imgur.com/wuFZg5L.pnghttp://i.imgur.com/LbITAyG.pnghttp://i.imgur.com/PBIfoAK.png

You can only use this feature at certain distance:
1/2 of actual visual distance at level 1, full visual distance at max exp. level.

Updated 'show enemy weapon' feature
Now it can show armour and face items, too. Useful for OCTH users.
SHOW_ENEMY_WEAPON = TRUE
SHOW_ENEMY_EXTENDED_INFO = TRUE
http://i.imgur.com/8GroOxl.pnghttp://i.imgur.com/x6EthTH.pnghttp://i.imgur.com/yHIxqd1.png

Partially reworked old awareness icon feature
New option in ja2_options.ini:
SHOW_ENEMY_AWARENESS = TRUE

Show total value of damage, absorbed by armour in last attack.
New option in ja2_options.ini:
SHOW_HIT_INFO = TRUE

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

r7066 patch
gamedir1983
patched r7066 for testing

Report message to a moderator

Lieutenant

Re: Code Snippets[message #331283] Sat, 15 March 2014 14:42 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Is that the same scaling used for dynamic tooltips? Both systems should be consistent.

Report message to a moderator

Captain

Re: Code Snippets[message #331284] Sat, 15 March 2014 14:51 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
Quote:
Is that the same scaling used for dynamic tooltips? Both systems should be consistent.


No, it uses simplified system, based on exp. level and actual visual distance.
Why overcomplicate simple things?

I have looked into 'dynamic tooltips' code, and from my opinion it's partially broken, mostly because of wrong use of integer calculations.

The goal of my improvements here is to provide all necessary information in convenient way, leaving tooltips for advanced and mostly 'testing, understanding and debug' use.

Report message to a moderator

Lieutenant

Re: Code Snippets[message #331286] Sat, 15 March 2014 15:01 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Fair enough, but if one says 'it's a glock' up to 20 tiles out and the other only to 10, then that'd be kinda meh.

Report message to a moderator

Captain

Re: Code Snippets[message #331288] Sat, 15 March 2014 15:06 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
I agree, maybe some day somebody (including me) will have time look at dynamic tooltips code, test it and debug, then it will be easy to attach that calculation to my features.

Report message to a moderator

Lieutenant

Re: Code Snippets[message #331324] Sun, 16 March 2014 21:53 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Sevenfm
More visual enemy gear info:
ja2_options.ini
;------------------------------------------------------------------------------------------------------------------------------
; Show additional info in NCTH cursor (press ALT)
; 0 - default cursor
; 1 - show enemy armour
; 2 - show armour, weapons and head items
;------------------------------------------------------------------------------------------------------------------------------

ADDITIONAL_NCTH_CURSOR_INFO = 2

Press [ALT] when targeting body part to see armour/item:
http://i.imgur.com/wuFZg5L.pnghttp://i.imgur.com/LbITAyG.pnghttp://i.imgur.com/PBIfoAK.png

You can only use this feature at certain distance:
1/2 of actual visual distance at level 1, full visual distance at max exp. level.

Updated 'show enemy weapon' feature
Now it can show armour and face items, too. Useful for OCTH users.
SHOW_ENEMY_WEAPON = TRUE
SHOW_ENEMY_EXTENDED_INFO = TRUE
http://i.imgur.com/8GroOxl.pnghttp://i.imgur.com/x6EthTH.pnghttp://i.imgur.com/yHIxqd1.png

Partially reworked old awareness icon feature
New option in ja2_options.ini:
SHOW_ENEMY_AWARENESS = TRUE

Show total value of damage, absorbed by armour in last attack.
New option in ja2_options.ini:
SHOW_HIT_INFO = TRUE

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

r7066 patch
gamedir1983
patched r7066 for testing


committed!

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331452] Fri, 21 March 2014 20:08 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
1. Added grenade throwing range modifier to item_settings.ini:
RANGE_GRENADE_MODIFIER = 1.0
This modifier is applied to grenades and regular thrown items.
2. Changed 100 to bBreathMax in throwing range penalty calculation. This should make grenades more useful.
3. Minor visual fixes (alt healthbar placement, 'roof' text placement when SHOW_ENEMY_WEAPON is true )
4. Added xml tags for merge type <13>: you can use u.knife on tripwire roll to get 2 tripwires. Status of tripwire roll will be reduced by 2 points.
Also lookup table for merges is updated for xml editor to work correctly.
5. Added several new loadscreenhints.
6. Press 'y' in tactical for quick transformation of item in hand - useful for switching flashlights on and off.
r7105 patch
gamedir1997 patch

[Updated on: Mon, 24 March 2014 01:20] by Moderator

Report message to a moderator

Lieutenant

Re: Code Snippets[message #331488] Mon, 24 March 2014 22:30 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Sevenfm
1. Added grenade throwing range modifier to item_settings.ini:
RANGE_GRENADE_MODIFIER = 1.0
This modifier is applied to grenades and regular thrown items.
2. Changed 100 to bBreathMax in throwing range penalty calculation. This should make grenades more useful.
3. Minor visual fixes (alt healthbar placement, 'roof' text placement when SHOW_ENEMY_WEAPON is true )
4. Added xml tags for merge type <13>: you can use u.knife on tripwire roll to get 2 tripwires. Status of tripwire roll will be reduced by 2 points.
Also lookup table for merges is updated for xml editor to work correctly.
5. Added several new loadscreenhints.
6. Press 'y' in tactical for quick transformation of item in hand - useful for switching flashlights on and off.
r7105 patch
gamedir1997 patch


Committed to development trunk and stable branch.

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331562] Sun, 30 March 2014 13:16 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
1. Quick inventory items:
Press [ALT] + [1..0] for quick access to predefined items:
Toggle Spoiler
Press [ALT] + [`] (tilde key left to [1]) to put item back to inventory and switch hands.
The item will be put in the same slot it was taken from (unless it was stacked or game was reloaded).

2. Also a few quick hotkeys:
[ALT] + [q] - switch to sling (same as [SHIFT] + [k])
[CTRL] + [q] - switch hands
[SHIFT] + [q] - drop item from main hand to the ground

Additional info:
-some hotkeys do not work in cheat mode
-only NIV
-only one-handed items supported
-stacked items currently not supported
-remembered item slot is lost when you reload game

3. A few small fixes for dynamic tooltips and other things

Report message to a moderator

Lieutenant

Re: Code Snippets[message #331579] Mon, 31 March 2014 12:55 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Thanks Sevenfm, the patch has been committed to stable and development trunk

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331708] Thu, 10 April 2014 12:31 Go to previous messageGo to next message
JMich is currently offline JMich

 
Messages:546
Registered:January 2011
Location: Greece
Allow different rules for climbing (and jumping) with backpacks.

First setting is sBackpackWeightToClimb which is the maximum weight a backpack can weigh and still allow you to climb with. The sBackpackWeightModifier in items.xml can modify that number by either making it harder (positive number modifier) or easier (negative number modifier). If the sBackpackWeightToClimb is -1 (default) then the option is unused.
Second setting is fUseGlobalBackpackSettings which if true (default) uses the same rules for all backpacks, while if false it checks for the fAllowClimbing tag in items.xml, and if that is true you can climb with said backpack.
Both options can be used at the same time, so you may climb with (for example) a malice backpack that weighs less than 5kg (or 50 hg) but not climb with a radio set.

.patch


backpack.patch

Haven't tested it that methodically, but it should be bug free.

Report message to a moderator

First Sergeant
Re: Code Snippets[message #331714] Fri, 11 April 2014 10:25 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@JMich: Thanks, I added it to the development trunk.

[Updated on: Fri, 11 April 2014 10:40] by Moderator

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331726] Sat, 12 April 2014 19:55 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
Custom sounds for non-guns
- knives, throwing knives, blunt weapons can use attack sounds specified with tag - previously their sound was chosen depending on animation used and hardcoded - it should open space for exotic weapons like chainsaws, lawn mowers, jackhammers, etc. If is left unspecified, default hardcoded sound will be used normally.
- knives, throwing knives, blunt weapons, launchers on attack can cause noise specified with , previously it was ignored for anything but guns,
- small fix for knife/wire cutters combo where using it on empty grid would cause deadlock during battle.

Patch:
Toggle Spoiler

For presentation purposes: Reuban's hedge trimmer using its original DG attack sound effect and making a lot of noise.
Hedge Trimmer

Report message to a moderator

Master Sergeant

Re: Code Snippets[message #331810] Sat, 19 April 2014 12:49 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@anv: thanks for the sounds patch. I applied the patch to the development and stable trunk.
can you please check the modified gamedir files (xml files) for the hedge trimmer sound. When I applie d the changes in the weapons.xml file, I got 2 modifications in the Machete (index = 54) and Sam Garver Combat Knife (index = 337). Shouldn't the modification be for the hedge trimmer?
Please check. Thanks.

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #331820] Sat, 19 April 2014 22:16 Go to previous messageGo to next message
anv is currently offline anv

 
Messages:258
Registered:March 2013
@RoWa21: Oh, I get it. Patch only preserved "Items/Weapons.xml" part of file path, and then auto-fitting selected /Data/TableData/Items/Weapons.xml to apply patch because surrounding tags are the same.
It should be applied only to /Data-1.13/TableData/Items/Weapons.xml as it contains Hedge Trimmer (index 1639).

Report message to a moderator

Master Sergeant

Re: Code Snippets[message #331843] Mon, 21 April 2014 10:18 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
anv
@RoWa21: Oh, I get it. Patch only preserved "Items/Weapons.xml" part of file path, and then auto-fitting selected /Data/TableData/Items/Weapons.xml to apply patch because surrounding tags are the same.
It should be applied only to /Data-1.13/TableData/Items/Weapons.xml as it contains Hedge Trimmer (index 1639).


Thanks, I fixed it the game dir files. There was also a missing code block in the source code the patch did not apply. Anyway I also fixed this one.

Report message to a moderator

Sergeant Major

Re: Code Snippets[message #332753] Sat, 17 May 2014 23:00 Go to previous messageGo to previous message
rummtata is currently offline rummtata

 
Messages:103
Registered:April 2011
Location: Germany
I like the visual enemy gear info, but: How do I turn off the text box completely, so it doesn't look like this?

http://s1.directupload.net/images/140517/j3dqxmqx.jpg

Report message to a moderator

Sergeant
Previous Topic: New Attachment System Beta
Goto Forum:
  


Current Time: Fri Mar 29 06:49:41 GMT+2 2024

Total time taken to generate the page: 0.02678 seconds