Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Scope modes
New feature: Scope modes[message #303024] Sun, 08 April 2012 17:55 Go to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
Scope modes

I implemented another minor feature. Basically it allows the player to manually switch between the different scopes and sights on a weapon. This option can be toggled in the .ini (USE_SCOPE_MODES)

The idea is that a gun can have multiple optical sights (iron sights, reflex sights, scopes). Atm, boni of all those are added at the same time, and the actual magnification used is determined by range and some other stuff.

I changed that. Now you can toggle between your different scopes by pressing '.' in tactical mode (I moved the cheat option that formerly occupied that key to CTRL-'y'). For all necessary calculations (including sight range, aim levels, AP cost and of course cth) only the currently used scope/sight is used.

For testing reasosn, I gave Lynx an M14 with an Acog and a reflex sight. He now has a 4.0x scope, a 2.0x reflex sight (I tweaked that for testing purposes) and 1.0x iron sights (the basic M14).

If you allow a graphical display, it looks like this:

Acog (notice the increased sight range compared to the other two pictures):
http://i41.tinypic.com/mjwax.jpg

Reflex Sight (notice the lower APs needed compared to the other pictures):
http://i40.tinypic.com/kasnrk.jpg

Iron Sights:
http://i44.tinypic.com/vgoh79.jpg

If you enlarge the pics, you can actually see stuff.... how do you do that in a post?

This atm only works for your mercs, the enemy and militia are not affected.

While the overall use of this might be small, those who struggle with scopes with a magnification factor too high on NCTH might benefit from this.

Edited stuff:
As I found out, different mods made new attachment classes, while still using the -tag. For this reason, I can't use that to determine wether an attachment is of a specific class.

I have therefore (after previously doing otherwise, and having a lenghty discussion with JMich and depressives Brot on IRC) decided to leave the -tag alone. I have, however, created a new UINT32-tag in items.xml, which is called .

This tag now specifies the behaviour of an attachemnt, wether it is a scope, a laser, a grenade, a detonator etc. It is in principle the AC_#### bitmask in Item Types.h. This is a bitmask, so it is now also possible to create an attachment that is both scope and laser (or whatever weird stuff you can think off). The flags are:

// redesigned by Flugente on 12-04-10
// Chrisl: Define attachment classes
#define AC_BIPOD		0x00000001	//1
#define AC_SUPPRESSOR           0x00000002	//2
#define AC_LASER		0x00000004	//4
#define AC_SIGHT		0x00000008	//8
#define AC_SCOPE		0x00000010	//16
#define AC_STOCK		0x00000020	//32
#define AC_MAGWELL   	        0x00000040	//64
#define AC_INTERNAL		0x00000080	//128
#define AC_EXTERNAL		0x00000100	//256
#define AC_UNDERBARREL	        0x00000200	//512
#define AC_GRENADE		0x00000400	//1024
#define AC_ROCKET		0x00000800	//2048
#define AC_FOREGRIP		0x00001000	//4096
#define AC_HELMET               0x00002000	//8192
#define AC_VEST 		0x00004000	//16384
#define AC_PANTS		0x00008000	//32768
#define AC_DETONATOR            0x00010000	//65536
#define AC_BATTERY              0x00020000	//131072
#define AC_EXTENDER		0x00040000	//262144
#define AC_SLING		0x00080000	//524288
#define AC_REMOTEDET            0x00100000	//1048576
#define AC_DEFUSE		0x00200000	//2097152
#define AC_IRONSIGHT	        0x00400000	//4194304
#define AC_FEEDER		0x00800000	//8388608
#define AC_MODPOUCH		0x01000000	//16777216
#define AC_RIFLEGRENADE	        0x02000000	//33554432
#define AC_BAYONET		0x04000000	//67108864
#define AC_MISC16		0x08000000	//134217728
#define AC_MISC17		0x10000000	//268435456
#define AC_MISC18		0x20000000	//536870912
#define AC_MISC19		0x40000000	//1073741824
#define AC_MISC20		0x80000000	//2147483648


So, for example, the grippod will have 4097, because it is both bipod and grippod.

This will also allow us to remove some of the existing flags, like . However, take note that this is stuff is currently not used anywhere in the code, except for
1) grenades and rockets
2) scopes and sights (by this very feature)

Hopefully, this will get used more extensively in the future.

I already added the necessary tags to all attachments in Items.xml. :sign: ANY MODDER USING THIS CODE WILL HAVE TO DO THE SAME TO (ATLEAST) ALL HIS SCOPES, SIGHTS, GRENADES and ROCKETS, or those won't work a intended.

I also made a little addition to overheating weapons, severe overheating now temporarily lowers a gun's accuracy.

I also made another new feature, which I will describe in another thread.

If nobody has any objections (or brilliant ideas that I should include), I will submit this to RoWa this evening.

Edit2: As of r6084, when using scope modes, the magnification factor adjusts just like without this feature. While I find it odd, not doing so is highly incompatible to NCTH.

Also, the enemy now properly uses this.

[Updated on: Fri, 17 May 2013 22:11] by Moderator

Report message to a moderator

Captain

Re: New feature: Scope modes[message #303025] Sun, 08 April 2012 18:12 Go to previous messageGo to next message
Wil473

 
Messages:2813
Registered:September 2004
Location: Canada
Excellent, people have been asking about this for a while. Also thank you for taking mods other than stock v1.13 into account with externalizing what NAS Attachment Classes this feature considers to be a scope/sight.

Report message to a moderator

Lieutenant

Re: New feature: Scope modes[message #303027] Sun, 08 April 2012 18:22 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
thank Depressives Brot, tais and JMich for that... I would have never thought of that bit Smile

Report message to a moderator

Captain

Re: New feature: Scope modes[message #303028] Sun, 08 April 2012 19:05 Go to previous messageGo to next message
Scouty is currently offline Scouty

 
Messages:76
Registered:April 2008
I agree, this looks really good. I'm anxious to test this when it gets into Tais' SCIs. Smile

Report message to a moderator

Corporal
Re: New feature: Scope modes[message #303032] Sun, 08 April 2012 19:25 Go to previous messageGo to next message
Headhunter is currently offline Headhunter

 
Messages:260
Registered:November 2009
Location: Sweden
Awesome stuff!

However, should iron sights really be available if you've got a scope mounted?

Report message to a moderator

Master Sergeant
Re: New feature: Scope modes[message #303033] Sun, 08 April 2012 19:30 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
Well, there was a discussion about that in IRC. As that is basically governed by the gun, the scope and the rail system altogether, I'm a bit lost there.

I could of course create a tag that forbids iron sights, but where? On the gun? On the scope? Both? I dunno.

Report message to a moderator

Captain

Re: New feature: Scope modes[message #303034] Sun, 08 April 2012 19:51 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3647
Registered:July 2009
Flugente
Well, there was a discussion about that in IRC. As that is basically governed by the gun, the scope and the rail system altogether, I'm a bit lost there.

I could of course create a tag that forbids iron sights, but where? On the gun? On the scope? Both? I dunno.
On the slot. That's what models the interface between gun and attachment, so if occupied -> no iron sights.

Report message to a moderator

Captain

Re: New feature: Scope modes[message #303035] Sun, 08 April 2012 19:56 Go to previous messageGo to next message
Wil473

 
Messages:2813
Registered:September 2004
Location: Canada
I'd suggest neither, and simply not have the feature consider the "iron sight" unless it is present as an attachment. We have a dozen default attachments available now, so for the few specific instances of guns that can be sighted via its in-built iron sights while a scope is attached, the iron sight can be handled by a default attachment.

Now for a scope that comes with its own back-up iron, again the same thing: default attachment (but on the scope itself).

A concern would be how robust NAS is handling a scope that has an inseparable default attachment. The Scope must be able to be removed, with the default attachment reliably sticking to the scope instead of instead of trying to stay with the gun. This seems to work fine with grenades, but I wouldn't be so sure about saying the same thing with non-grenade attachments, let alone inseparable ones.

My other concern is that you've made this optional for the player to toggle/exploit. In the brief few hours that I've known about this feature, I've already thought about using this as a way to do a variable power scope: player mounts one scope, but the scope has as its default attachments a bunch of other scopes representing each increment. ie. 9x VP = 9x scope with 6x and 3x scopes mounted on it. With this feature on, the player could only use each scope one at a time, with it off I'm afraid the player ends up with an 18x scope (which under NCTH is actually a bad thing as the penalty would be in effect for all standard map sizes).

EDIT: Oh sorry, forgot - Thank you Depressives Brot, Tais and JMich for bringing up the XML modders and the strange things we've done with NAS (well Smeagol and myself I know have done strange, but wonderful, things with NAS)

EDIT2: first part edited for clarity and grammar

[Updated on: Sun, 08 April 2012 20:01] by Moderator

Report message to a moderator

Lieutenant

Re: New feature: Scope modes[message #303037] Sun, 08 April 2012 20:11 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
I always enabled some of the stuff I did, regardless of the ini setting - so there should be now way to get into the situation you described.
You can only use one scope at a time, period. However, without my feature turned on, the game still does the determinebestscope stuff.

If you have multiple scopes and do not toggle scope modes, the best (=highest magnification) scope is always used in terms of sight range, night vison etc.)

Report message to a moderator

Captain

Re: New feature: Scope modes[message #303038] Sun, 08 April 2012 21:16 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
In our neverending quest to use every single key available, I proudly present a new entrant to tactical mode:

'.' shall henceforth be known as the key with which thou shalt toggle thy scoping modes. Rejoice!

('y' is not available anymore, as it is already used in multiplayer chat).

Report message to a moderator

Captain

Re: New feature: Scope modes[message #303082] Mon, 09 April 2012 12:34 Go to previous messageGo to next message
usrbid is currently offline usrbid

 
Messages:1502
Registered:December 2008
Some scopes will allow the use of iron sights, this is called co-witness. You can't use both simultaneously, as you can only look down one sight path, but you can choose which one you want to use.

On another note, holo or red dot sights are not necessarily more accurate than iron sights, they just provide (something called) more eye relief, meaning that the position of the eye does not have to be perfectly aligned with the sight path.

In real life there are some things to consider with holo or red dot sights. Holding the gun fixed and moving the eye will eventually move the dot, meaning the bullet won't hit where the dot is.

Holding the gun higher to target at extreme distances, 300 yards plus, does not obstruct the sight picture as there is plenty of room below the dot. With iron sights the bottom of the front post will eventually be in the way of the target area, possibly obstructing the target altogether. Unless you adjust the iron sight to the larger distance. Some iron sights cannot be adjusted.

Depending on the type of iron sight, aiming with them may be more accurate than with a holo or red dot sight. For example a hooded front post to reduce glare and fiberoptic dots (or just glow in the dark white dots) make a difference in how well you shoot.

Report message to a moderator

Sergeant Major

Re: New feature: Scope modes[message #303093] Mon, 09 April 2012 14:08 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
Flugente
thank Depressives Brot, tais and JMich for that... I would have never thought of that bit Smile

I'm gonna dare say something here, the IRC channel is a big force behind 1.13 development and I am still quite surprised lots of people aren't on here!
The chat works 10x faster than any forum will ever be able to

Report message to a moderator

First Sergeant

Re: New feature: Scope modes[message #303843] Tue, 24 April 2012 18:06 Go to previous messageGo to next message
Wil473

 
Messages:2813
Registered:September 2004
Location: Canada
Flugente, if you have a moment, may I have you check my comments in http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=303842#Post303842 it relates to implementation of the Scope Modes feature. I'm not sure why there is the new XML, TableData asAttachmentClass.XML, that seems related to this feature. If it is needed, if only for a look up table for the XML Editor, I'm thinking it should be renamed to avoid confusion with the old NAS AttachmentClass.XML.

[Updated on: Tue, 24 April 2012 18:07] by Moderator

Report message to a moderator

Lieutenant

Re: New feature: Scope modes[message #303887] Wed, 25 April 2012 09:00 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:626
Registered:July 2005
Location: Canada
There are now two xmls for attachment classes, and yes it is a bit confusing:p

NasAttachmentClass.XML = the old AttachmentClass.XML. It is used only by the editor and the values in it link to the nasAttachmentClass tag; known as Custom Attachment Class in the editor. It is fully editable in the editor.

Lookup\AttachmentClass.XML is the new one. It is known as Built in Attachment Class in the editor. It is not fully editable, and the file itself is only used by the editor. Its values correlate to specific code functionality, whereas the nasAttachmentClass values are purely for attachment placement.

You will need to set values for both fields in order for scope modes and future features to work correctly.


Report message to a moderator

First Sergeant

Re: New feature: Scope modes[message #303891] Wed, 25 April 2012 10:30 Go to previous messageGo to next message
TClaymore is currently offline TClaymore

 
Messages:33
Registered:July 2011
Wait, would this update allow for a scope to cycle through different magnifications?

Report message to a moderator

Private 1st Class
Re: New feature: Scope modes[message #303893] Wed, 25 April 2012 10:42 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3647
Registered:July 2009
No. That's possible using transformations.

[Updated on: Wed, 25 April 2012 10:44] by Moderator

Report message to a moderator

Captain

Re: New feature: Scope modes[message #303894] Wed, 25 April 2012 10:45 Go to previous messageGo to next message
Wil473

 
Messages:2813
Registered:September 2004
Location: Canada
TClaymore
Wait, would this update allow for a scope to cycle through different magnifications?


Sure, if you stacked a bunch of scopes as inseparable attachments on a "base scope." Attach the base scope, and it brings along its friends. The problem is I'm not sure if NAS is robust enough for a removable attachment bringing along a bunch of attachments that are inseparable to it.

Also, variable power scopes have been implemented via HAM 5 item transformations (see my Alrulco Folding Stock v3.65).


Madd Mugsy
There are now two xmls for attachment classes, and yes it is a bit confusing:p

NasAttachmentClass.XML = the old AttachmentClass.XML. It is used only by the editor and the values in it link to the nasAttachmentClass tag; known as Custom Attachment Class in the editor. It is fully editable in the editor.

Lookup\AttachmentClass.XML is the new one. It is known as Built in Attachment Class in the editor. It is not fully editable, and the file itself is only used by the editor. Its values correlate to specific code functionality, whereas the nasAttachmentClass values are purely for attachment placement.

You will need to set values for both fields in order for scope modes and future features to work correctly.




When was this implemented? My v3.65 mods were built around the old (NAS 0.7) XML's, meaning its nasAttachmentClass tags are trying to use values in a Lookup\AttachmentClass.XML rebuilt for my own purposes (I'm up to 8388608 now). My NAS system seemed to be working the last time I was testing it.

That said, I suppose I could just copy the XML and rename it nasAttachmentClass.XML, leaving the other one in the original NAS 0.7 location for legacy support. Means no XML Support by the general public until I drop Stable 4870 support. Not as bad as the NAS 0.6 to 0.7 conversion, but still, couldn't we have just left the NAS XML's alone, and name the XML Editor lookup file for Scope Modes something else? Many angry words were exchanged over the shape of NAS 0.7...

[Updated on: Wed, 25 April 2012 11:07] by Moderator

Report message to a moderator

Lieutenant

Re: New feature: Scope modes[message #303901] Wed, 25 April 2012 16:41 Go to previous messageGo to next message
Alex_SPB is currently offline Alex_SPB

 
Messages:169
Registered:February 2008
Location: Russia, St.Petersburg
Dieter


In real life there are some things to consider with holo or red dot sights. Holding the gun fixed and moving the eye will eventually move the dot, meaning the bullet won't hit where the dot is.


I am afraid you are wrong. The true magic about red dot sights is that as long as you see the dot it is always indicating the right direction of aim (unlike optical sights) even if you move your head. This is why shooting with red dot is much faster.

Report message to a moderator

Staff Sergeant
Re: New feature: Scope modes[message #303903] Wed, 25 April 2012 18:11 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:626
Registered:July 2005
Location: Canada
Quote:

When was this implemented? My v3.65 mods were built around the old (NAS 0.7) XML's, meaning its nasAttachmentClass tags are trying to use values in a Lookup\AttachmentClass.XML rebuilt for my own purposes (I'm up to 8388608 now). My NAS system seemed to be working the last time I was testing it.

That said, I suppose I could just copy the XML and rename it nasAttachmentClass.XML, leaving the other one in the original NAS 0.7 location for legacy support.


Not too long ago - a couple weeks maybe?

Copying and renaming is a good quick way to migrate to the new file. Just remember to change the tags inside the file to prefix them with "Nas" as well. Again, this file is just for the editor; the game will work fine regardless.

Feel free to have no file at all in the lookup folder - it will create one for you. Just make sure you clear out the XmlWorkingData folder for the editor to pick up the change (if you have the working data feature turned on).

Quote:

Means no XML Support by the general public until I drop Stable 4870 support. Not as bad as the NAS 0.6 to 0.7 conversion, but still, couldn't we have just left the NAS XML's alone, and name the XML Editor lookup file for Scope Modes something else? Many angry words were exchanged over the shape of NAS 0.7...


It is a necessary breaking change; we need to keep things somewhat organized to facilitate code maintenance and the addition of features in the future. Things have changed so much since 4870, and will continue to change -- for one example, see NAS Receivers topic -- I'm not sure it will be possible to support both 4870 and the latest SVN code for much longer. The small bit of good news is that going forward the NasAttachmentClass file is actually editable so you can add new classes, and ones to represent combinations, in the editor.

While we're on this topic of moving files, please note that Silhouettes.xml moved out of the Lookup folder as well, and it is also fully editable now.


Quote:

Sure, if you stacked a bunch of scopes as inseparable attachments on a "base scope." Attach the base scope, and it brings along its friends. The problem is I'm not sure if NAS is robust enough for a removable attachment bringing along a bunch of attachments that are inseparable to it.


It is! I managed to pull off this approach the other day, so now my sniper scope has 10x, 6x and 3x magnification using scope modes.

Report message to a moderator

First Sergeant

Re: New feature: Scope modes[message #303904] Wed, 25 April 2012 18:35 Go to previous messageGo to next message
Wil473

 
Messages:2813
Registered:September 2004
Location: Canada
Ah right, no need to panic, as far as the game is concerned the nasAttachmentClass tag is just bitmap, the names used in the XMLEditor do not matter in-game.


Madd Mugsy

Quote:

Sure, if you stacked a bunch of scopes as inseparable attachments on a "base scope." Attach the base scope, and it brings along its friends. The problem is I'm not sure if NAS is robust enough for a removable attachment bringing along a bunch of attachments that are inseparable to it.


It is! I managed to pull off this approach the other day, so now my sniper scope has 10x, 6x and 3x magnification using scope modes.


Now the question is, can you remove the scope without the game getting confused about the inseparable attachments leaving the base gun, but still being attached to the base scope attachment.

Report message to a moderator

Lieutenant

Re: New feature: Scope modes[message #303908] Wed, 25 April 2012 19:44 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:626
Registered:July 2005
Location: Canada
Yes, you can Smile

Report message to a moderator

First Sergeant

Re: New feature: Scope modes[message #303912] Wed, 25 April 2012 21:21 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
Madd Mugsy
There are now two xmls for attachment classes, and yes it is a bit confusing:p

NasAttachmentClass.XML = the old AttachmentClass.XML. It is used only by the editor and the values in it link to the nasAttachmentClass tag; known as Custom Attachment Class in the editor. It is fully editable in the editor.

Lookup\AttachmentClass.XML is the new one. It is known as Built in Attachment Class in the editor. It is not fully editable, and the file itself is only used by the editor. Its values correlate to specific code functionality, whereas the nasAttachmentClass values are purely for attachment placement.

You will need to set values for both fields in order for scope modes and future features to work correctly.




That is not entirely correct. The scope mode feature itself only needs the - tag in Items.xml. It does not need any other xml or the -tag.

However, not setting the -tag will still screw you, but that's another place Smile

Report message to a moderator

Captain

Re: New feature: Scope modes[message #304367] Sat, 05 May 2012 08:46 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:626
Registered:July 2005
Location: Canada
Since the easiest way to implement scope modes is to use default & inseparable attachments on the scopes themselves, I made a few changes tonight to make that method easier:

1) Default attachments on scopes were being created when the scope item was created, but not when the scope was a default attachment itself on another item. This has been fixed.

2) With all the different attachment classes and slots, it's easy to run out of space in the UDB to display the various scope modes. So I ask, why display them at all? Now you don't need to -- you now can hide attachment slots by setting their X or Y values to 300 or higher; coordinates which would have displayed the slots outside of the UDB anyway.

Report message to a moderator

First Sergeant

Re: New feature: Scope modes[message #304959] Fri, 18 May 2012 23:35 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
Update: I just sent a minor code change to RoWa21.

If you now add the tag 1 to a gun or an attachment in Items.xml, the iron sight wont be usable on that gun, as long as there are still other usable scopes/sights.

With this, you can simulate that a scope has been attached 'over' the iron sights.

Report message to a moderator

Captain

Re: New feature: Scope modes[message #304984] Sat, 19 May 2012 20:56 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:626
Registered:July 2005
Location: Canada
Added to XML Editor code. Will add a new build of the editor to the gamedir once the code is added to the trunk.

BTW, which scopes/sights does this apply to?

Report message to a moderator

First Sergeant

Re: New feature: Scope modes[message #304999] Sun, 20 May 2012 13:23 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
I added that tag to the 10x, 7x and the ACOG 4x scopes. I do not know if that is realistic. I recon there are enough people with gun knowledge around who'll eventually fill in correct values Smile

Report message to a moderator

Captain

Re: New feature: Scope modes[message #305001] Sun, 20 May 2012 14:43 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
Update: Also new: when using dual weapons, only iron sights (or if those aren't available, the worst sights/scopes) can be used, as using two scopes simultaneous should be rather difficult Smile

Update 2: I created a new attachmentclass, AC_IRONSIGHT, that can be used for additional iron sights. The display is the iron sight icon with a little '*':

http://i47.tinypic.com/2i910cg.jpg

To provide a quick overview, the current flags for the attachmentclass are:

#define AC_BIPOD		0x00000001	//1
#define AC_SUPPRESSOR   0x00000002	//2
#define AC_LASER		0x00000004	//4
#define AC_SIGHT		0x00000008	//8
#define AC_SCOPE		0x00000010	//16
#define AC_STOCK		0x00000020	//32
#define AC_MAGWELL   	0x00000040	//64
#define AC_INTERNAL		0x00000080	//128
#define AC_EXTERNAL		0x00000100	//256
#define AC_UNDERBARREL	0x00000200	//512
#define AC_GRENADE		0x00000400	//1024
#define AC_ROCKET		0x00000800	//2048
#define AC_FOREGRIP		0x00001000	//4096
#define AC_HELMET       0x00002000	//8192
#define AC_VEST 		0x00004000	//16384
#define AC_PANTS		0x00008000	//32768
#define AC_DETONATOR    0x00010000	//65536
#define AC_BATTERY      0x00020000	//131072
#define AC_EXTENDER		0x00040000	//262144
#define AC_SLING		0x00080000	//524288			// rifle sling
#define AC_REMOTEDET    0x00100000	//1048576			// remote detonator for bombs
#define AC_DEFUSE		0x00200000	//2097152			// defuse item for bombs
#define AC_IRONSIGHT	0x00400000	//4194304			// for attachable Iron Sights
#define AC_MISC12		0x00800000	//8388608
#define AC_MISC13		0x01000000	//16777216
#define AC_MISC14		0x02000000	//33554432
#define AC_MISC15		0x04000000	//67108864
#define AC_MISC16		0x08000000	//134217728
#define AC_MISC17		0x10000000	//268435456
#define AC_MISC18		0x20000000	//536870912
#define AC_MISC19		0x40000000	//1073741824
#define AC_MISC20		0x80000000	//2147483648


AC_MISC12 - AC_MISC20 aren't in use yet, obviously.

[Updated on: Sun, 20 May 2012 17:41] by Moderator

Report message to a moderator

Captain

Re: New feature: Scope modes[message #305006] Sun, 20 May 2012 20:19 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:626
Registered:July 2005
Location: Canada
I fixed a crash bug in scope modes this morning, that would occur in at least one situation.

They were causing crashes because the pSoldier->bScopeMode value was matching a null entry in the ObjList object. It seemed to happen when scopes were made into attachments for other scopes. If the primary scope object was removed and bScopeMode was pointing to a secondary object, then boom, crash.

I just made it so that it checks that ObjList[pSoldier->bScopeMode] != NULL whenever it was referenced, and that seemed to solve it.

However, this makes it so that it skips over some of the bonus calculations when it's null, so you may wish to quickly review this change.

Report message to a moderator

First Sergeant

Re: New feature: Scope modes[message #305007] Sun, 20 May 2012 20:36 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
Oh? Hmm. Never tested it with scopes that have other scopes attached, thank you. I'll check it.

Report message to a moderator

Captain

Re: New feature: Scope modes[message #306755] Mon, 02 July 2012 18:25 Go to previous messageGo to next message
Wil473

 
Messages:2813
Registered:September 2004
Location: Canada
During testing of Urban Chaos-1.13 v3.7x ADCAP there was a CTD related to the tag. Presently, I am using JA2.exe rev 5353 as the minimum system requirements despite it seeming to run decently only on Windows 7 computers with plenty of RAM and processor capability.

is set on all scopes and sights, but what we're finding is that when a sight such as the Kobra is attached, the iron sight is still available. If you try to aim with the iron sight, the game CTD's on the first click (NCTH). If the weapon is put onto the correct sight manually, then the aiming works fine. If I disable the tag on the Kobra, the iron sight can be used without CTD, but it seems that it is using the stats from the Kobra (-1 Aiming Click to get to Max aim).

Is there anything else that needs to be done to use the feature aside from just setting it on the scope/sight? Can it be used on a non-magnifiying sights like the Kobra? Not enough time has elapsed for me to find a combination of NCTH magnifying scope and weapon to test, just Kobra sights which the IMP generation process seems to liberally supply.

Report message to a moderator

Lieutenant

Re: New feature: Scope modes[message #307377] Sat, 14 July 2012 09:50 Go to previous messageGo to next message
Strohmann is currently offline Strohmann

 
Messages:287
Registered:August 2011
Location: Division Thought Crimes
Flugente
[...] The idea is that a gun can have multiple optical sights (iron sights, reflex sights, scopes). Atm, boni of all those are added at the same time, and the actual magnification used is determined by range and some other stuff.

I changed that. Now you can toggle between your different scopes by pressing '.' in tactical mode (I moved the cheat option that formerly occupied that key to CTRL-'y'). For all necessary calculations (including sight range, aim levels, AP cost and of course cth) only the currently used scope/sight is used. [...]


may is ask which tags from Items.xml are recognized in the latest version?

in the version i am currently using , all sight range relevant ones like and action points related are recognized for each individual "scope". but i observed and aren't, so assume the whole other aren't counted individually. for example i want to create something like this:

iron sights with 15
sniper scope with zoomfactor 7x: 7.0 , +1, no bonus to
same scope with default inseperable attachment as zoomfactor 10x: 10.0 , +2, no bonus to


present i can do that perfectly with itemtransformations, but the frequent clicking gets a bit tedious. any chance this can be realized or already is?

Report message to a moderator

Master Sergeant
Re: New feature: Scope modes[message #307471] Sun, 15 July 2012 16:14 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
@Strohmann: I'll have a look at that in the code later, might take a bit of time.

Report message to a moderator

Captain

Re: New feature: Scope modes[message #307697] Wed, 18 July 2012 23:18 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
The tags currently recognised via the scope modes are:
  • aimbonus
  • percentapreduction
  • visionrangebonus
  • cavevisionrangebonus
  • dayvisionrangebonus
  • nightvisionrangebonus
  • brightlightvisionrangebonus
  • percenttunnelvision
  • minrangeforaimbonus
  • scopemagfactor
  • projectionfactor

This means that from the list of the currently applied scope, only the boni of the one used are taken.

The stance modifiers, eg

INT16 flatbasemodifier[3];
INT16 percentbasemodifier[3];
INT16 flataimmodifier[3];
INT16 percentaimmodifier[3];
INT16 percentcapmodifier[3];
INT16 percenthandlingmodifier[3];
INT16 percentdropcompensationmodifier[3];
INT16 maxcounterforcemodifier[3];
INT16 counterforceaccuracymodifier[3];
INT16 counterforcefrequencymodifier[3];
INT16 targettrackingmodifier[3];
INT16 aimlevelsmodifier[3];
,

are not governed by this. By the comments inside the code I deduct that they apply to the weapon and its handling, and not to the sight mechanism.

The modifiers
INT16 RecoilModifierX;
INT16 RecoilModifierY;
INT16 PercentRecoilModifier;
INT16 percentaccuracymodifier;

also apply to weapon handling, scope selected has nothing to do with it.

BOOLEAN speeddot;


is not used anywhere in the code Smile

Report message to a moderator

Captain

Re: New feature: Scope modes[message #308043] Tue, 24 July 2012 17:49 Go to previous messageGo to next message
Hazapuza

 
Messages:262
Registered:February 2009
Location: Finland
Playing UC1.13, it seems like aiming level reductions (provided by the basic reflex sight that you can mount on various scopes, for example) remain even when using the scope. Shouldn't it be only applied when using the non-magnifying reflex sight?

Report message to a moderator

Master Sergeant
Re: New feature: Scope modes[message #308047] Tue, 24 July 2012 18:58 Go to previous messageGo to next message
Strohmann is currently offline Strohmann

 
Messages:287
Registered:August 2011
Location: Division Thought Crimes
no. to achieve this behaviour you have to make both items transformable into eachother. some like that in Item_Transformations.xml:
        
		"uiIndex of your scope in Items.xml"
		"uiIndex of your reflex sight in Items.xml"
		"xyz"
		0
		Reflex Sight
		Switch to Reflex Sight
	
	
		"uiIndex of your reflex sight in Items.xml"
		"uiIndex of your scope in Items.xml"
		"xyz"
		0
		Magn. 4x
		Switch to Scope Magnification Factor 4.0
	

Report message to a moderator

Master Sergeant
Re: New feature: Scope modes[message #308071] Tue, 24 July 2012 23:14 Go to previous messageGo to next message
Hazapuza

 
Messages:262
Registered:February 2009
Location: Finland
So it can't be done with a "quick fix"? My knowledge of the code is obviously and admittedly nonexistent, but honestly I'm kind of disappointed if this is the case. After all the aiming level reductions are very similar to straight shooting cost reductions. Oh well.

Report message to a moderator

Master Sergeant
Re: New feature: Scope modes[message #308080] Wed, 25 July 2012 00:46 Go to previous messageGo to next message
Strohmann is currently offline Strohmann

 
Messages:287
Registered:August 2011
Location: Division Thought Crimes
as far as i know flugente is working on an extension, so that scope modes can toggle through predefined item transformations in said xml. but that means you still have to fill in the data (or wait till wil does for you in uc). i would give it a try, just copy the stuff above into Item_Transformations.xml and fill in the data.

Report message to a moderator

Master Sergeant
Re: New feature: Scope modes[message #308085] Wed, 25 July 2012 02:00 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
As Muggsy has come up with a way superior way to achieve this toggle behaviour, I won't check my stuff in. Wait till he brings his.

Report message to a moderator

Captain

Re: New feature: Scope modes[message #319973] Fri, 17 May 2013 22:12 Go to previous messageGo to next message
Flugente

 
Messages:3503
Registered:April 2009
Location: Germany
Update: As of r6084, when using scope modes, the magnification factor adjusts just like without this feature. While I find it odd, not doing so is highly incompatible to NCTH.

Also, the enemy now properly uses this.

Report message to a moderator

Captain

Re: New feature: Scope modes[message #320985] Mon, 27 May 2013 15:22 Go to previous messageGo to previous message
krux is currently offline krux

 
Messages:62
Registered:June 2011
It means it now adjusts automatically to the best mode for the range to target?

Btw, does laser sights work when firing from the hip?

[Updated on: Mon, 27 May 2013 15:22] by Moderator

Report message to a moderator

Corporal
Previous Topic: New feature: Bombs can now be armed in the inventory, and dropped/thrown afterwards
Next Topic: New mod: full-scale zombie invasion
Goto Forum:
  


Current Time: Wed Dec 17 14:20:24 GMT+2 2025

Total time taken to generate the page: 0.00996 seconds