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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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?


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

 
Messages:719
Registered:July 2008
So ugly yet so awesome Smile
Re: Code Snippets[message #330801] Sat, 22 February 2014 21:54 Go to previous messageGo to next message
Flugente

 
Messages:3173
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.


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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:


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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



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

 
Messages:3788
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.


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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.


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

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


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

 
Messages:148
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.
Re: Code Snippets[message #330826] Sun, 23 February 2014 22:18 Go to previous messageGo to next message
sevenfm

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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



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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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


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

 
Messages:2714
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.


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

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

there are 2 [ctrl] keys
Re: Code Snippets[message #330841] Tue, 25 February 2014 08:23 Go to previous messageGo to next message
sevenfm

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
@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



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

 
Messages:1570
Registered:March 2009
Location: Broadwurschd-City
V=version info shall NOT be touched
Re: Code Snippets[message #330849] Tue, 25 February 2014 14:41 Go to previous messageGo to next message
DepressivesBrot

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


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
This patch changes inventory dialog hotkey to Ctrl+[v]

Agree that we should keep vanilla hotkeys in default setup.

r6975 patch


Re: Code Snippets[message #330879] Wed, 26 February 2014 21:23 Go to previous messageGo to next message
RoWa21

 
Messages:2049
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]


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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


Re: Code Snippets[message #331130] Sat, 08 March 2014 15:17 Go to previous messageGo to next message
RoWa21

 
Messages:2049
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



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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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


Re: Code Snippets[message #331168] Mon, 10 March 2014 21:38 Go to previous messageGo to next message
RoWa21

 
Messages:2049
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


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

 
Messages:328
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:
Re: Code Snippets[message #331281] Sat, 15 March 2014 14:32 Go to previous messageGo to next message
sevenfm

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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


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

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


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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.


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

 
Messages:3788
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.


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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.


Re: Code Snippets[message #331324] Sun, 16 March 2014 21:53 Go to previous messageGo to next message
RoWa21

 
Messages:2049
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!


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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



Re: Code Snippets[message #331488] Mon, 24 March 2014 22:30 Go to previous messageGo to next message
RoWa21

 
Messages:2049
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.


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

 
Messages:1454
Registered:December 2012
Location: Under the Mountain
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


Re: Code Snippets[message #331579] Mon, 31 March 2014 12:55 Go to previous messageGo to next message
RoWa21

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


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

 
Messages:580
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.
Re: Code Snippets[message #331714] Fri, 11 April 2014 10:25 Go to previous messageGo to next message
RoWa21

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

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



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

 
Messages:232
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


Re: Code Snippets[message #331810] Sat, 19 April 2014 12:49 Go to previous messageGo to next message
RoWa21

 
Messages:2049
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.


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

 
Messages:232
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).


Re: Code Snippets[message #331843] Mon, 21 April 2014 10:18 Go to previous messageGo to next message
RoWa21

 
Messages:2049
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.


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

 
Messages:104
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
Previous Topic: New Attachment System Beta
Goto Forum:
  


Current Time: Wed Jan 17 03:26:19 EET 2018

Total time taken to generate the page: 0.01664 seconds