Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab  » New Attachment System Alpha
Re: New Attachment System (In Development)[message #245160] Wed, 24 February 2010 13:14 Go to previous messageGo to next message
Khor1255

 
Messages:1829
Registered:August 2003
Location: Pleasantville, NJ
But why slots at all? I like a drop down or pop up table for more detailed pics of what attachments are present but why not have things like grenade launchers, scopes, etc appear right on the weapon's image as transparent overlays?
I'm not much of a slave to graphics but this approach seems both more intuitive and aesthetically pleasing.
Re: New Attachment System (In Development)[message #245166] Wed, 24 February 2010 15:02 Go to previous messageGo to next message
Starwalker

 
Messages:768
Registered:October 2005
Location: Hannover, Germany
Khor1255
But why slots at all? I like a drop down or pop up table for more detailed pics of what attachments are present but why not have things like grenade launchers, scopes, etc appear right on the weapon's image as transparent overlays?
I'm not much of a slave to graphics but this approach seems both more intuitive and aesthetically pleasing.

Yes, if everything could be scaled to the correct dimensions, that would be nice indeed.

But I think this has already been discussed (showing actual attachments on the gun's image), and given the different sizes of guns (and so far being unable to scale the pics during play) it was decided that far too much work would be involved to make it happen.


Re: New Attachment System (In Development)[message #245167] Wed, 24 February 2010 15:09 Go to previous messageGo to next message
Khor1255

 
Messages:1829
Registered:August 2003
Location: Pleasantville, NJ
Yeah, there it is. I knew it sounded too good to be true. You'd essentially have to scale all weapons to the same size and that would sacrifice a lot of detail.

Otherwise, scopes would tend to look out of proportion etc.

However, it is possible to maybe have a few different sizes added to the attachments images to accommodate this. A lot of work and even a little extra for the coders (making it possible for various weapons to 'point' to the correct version of the attachment image) but I think it would add quite a little bit both to the interface and look of the game.

I can definitely understand and relate to why this idea was shelved though. It is more important to move forward with an idea than be bogged down in non essential details.
Re: New Attachment System (In Development)[message #245168] Wed, 24 February 2010 15:12 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Starwalker
it was decided that far too much work would be involved to make it happen.

On top of that, I've only just started programming in C++ ...
This is on the limit of what I can do already. (I'm coding this thing half-java style :oops: )
Java is so much more idiot-proof :naughty:

While we're on about that, anyone willing to dig through shitloads of hard to understand code when it's done, and make it more sensible for c++?
I'll try to have it all well commented.
Re: New Attachment System (In Development)[message #245173] Wed, 24 February 2010 15:41 Go to previous messageGo to next message
Kaerar

 
Messages:2049
Registered:January 2003
Location: Australia :D
Yeah Khor1255 there would need to be a standardised size, or all the images would have to be edited personally for each weapon. VERY tough job, there would literally be 1000's of images to produce x2 because it would need to be BigPic and MD. Not a viable solution until we have 3D weapons and dynamic resizing, seeing as the detail lost on 2D weapons would be far too great (see Borderlands for how this works really well Smile ).

Currently though I dislike its inflexibility the Silhouette route with specific slots per type sound the most sensible way to achieve the desired effect in the shortest timeframe. Seeing as it would follow with elements from NIV that most players are now used to, it wouldn't be hard to get used to them. I still think making 3-4 screens covering the different types would be best though if it can be coded so you have different slot selections for Pistols vs Shotty's vs Combat Rifles vs Snipers, etc...
Would make things transparent from the beginning Smile


Re: New Attachment System (In Development)[message #245177] Wed, 24 February 2010 15:44 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Kaerar
if it can be coded so you have different slot selections for Pistols vs Shotty's vs Combat Rifles vs Snipers, etc...


It won't be hardcoded, it would be up to the modders to make a pistol have different slots than a AR.
Means it's always possible, though ^^
Re: New Attachment System (In Development)[message #245179] Wed, 24 February 2010 15:52 Go to previous messageGo to next message
Kaerar

 
Messages:2049
Registered:January 2003
Location: Australia :D
Well it doesn't need to be hardcoded. If you have an index type which allows it to go to a particular slot and xmlise that index so modders can alter slot configs themselves it wouldn't be an issue. If they wanted to make all slots open to all then you could alter all slots to a single type and all attachments to be that index.

It would give a lot of flexibility to modders and mods alike Smile

For instance RPG's which have long projectiles need to have a full large slot for the Grenade. Set that to slot 8 and the Attachment to slot 8 and you can have that attach to just RPG's. It gives a limiting system without limiting it for modding (I hope...).


Also for the alternate images having the slots dynamically generated would be fantastic. It reads gun type and references the slot layout from the slot index and then has the slot positions dynamically added. I hope I explained that correctly. This would mean that loadout's for mods wouldn't depend on a specific STI being edited as they can alter an XML to change the slots desired instead of image editing Smile


Re: New Attachment System (In Development)[message #245187] Wed, 24 February 2010 16:42 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Awesome, I'm close to getting it working (with all kinds of bugs I didn't bother to look at yet), without graphics still, though.
It still looks just like JA vanilla, xept that you can't just attach everything to everything.
Made my gun fit 3 scopes =D

Just gotta fix that the game attaches it to the right slot, not just the first one it finds.

[Updated on: Wed, 24 February 2010 16:44] by Moderator

Re: New Attachment System (In Development)[message #245195] Wed, 24 February 2010 17:17 Go to previous messageGo to next message
Kaerar

 
Messages:2049
Registered:January 2003
Location: Australia :D
That's why I mentioned indexing them. Also a dual index system would help. First for slot number and second for group number. Say Slot's 0-2 are forward rail. You can group them so the selection mechanism looks for the group and attaches it to the first free slot in that group.

IDK if that's easy to do or even viable but it sounds logical to me Wink


Re: New Attachment System (In Development)[message #245199] Wed, 24 February 2010 17:43 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
crap.

I'm trying to change
(*this)[subObject]->attachments.push_back(attachmentObject);

to something to insert an attachment at a certain index.
I've found something that could be it:
(*this)[subObject]->attachments.insert();


But I have no clue how to use it. Anyone have a clue?

@Kaerar:
attachments are kinda stored in a list with indexes, and I don't understand one bit of it yet Sad
I've sort of used indexes for the rest, but not exactly.

[Updated on: Wed, 24 February 2010 17:47] by Moderator

Re: New Attachment System (In Development)[message #245205] Wed, 24 February 2010 18:17 Go to previous messageGo to next message
Kaerar

 
Messages:2049
Registered:January 2003
Location: Australia :D
It was just an idea. If you can get it working it would allow a great deal of control over the system and yet keep the modders freedom Smile


Re: New Attachment System (In Development)[message #245215] Wed, 24 February 2010 20:15 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
I would so prefere arrays to be stored in an array instead of this shitty list.
That would certainly break all sorts of things though, sadly.
Re: New Attachment System (In Development)[message #245229] Wed, 24 February 2010 23:23 Go to previous messageGo to next message
Alex_SPB

 
Messages:170
Registered:February 2008
Location: Russia, St.Petersburg
WarmSteel,

What do you think of the following concept:

1) There are several attachment "Zones" that could use either rail mounting system or specific mounting system:

- Scope zone: either national specific mount (like Russian mount) OR rail of determined size (of 1, 2, 3, 4 etc). Only scopes should be mounted there;
- Handguard zone (over the barrel): rail for mounting of flashlights, LAM-s OR nothing (no specific mounting system);
- Under-barrel zone: either rail of determined size (of 1, 2, 3, 4 etc)for foregrips, certain under barrel grenade launchers (like HK AG 36), bi-pods OR national specific mounting system for under barrel grenade launchers only (like Russian GP 30, US M203 or FN SCAR)
- Barrel ending zone: for mounting of silencers, flash hiders and muzzle breaks.
- Stock zone: for mounting of stocks

3)Any attachment mounted on picattinny rail has its own size (1, 2, 3 etc), any national mounted attachment has always a size of 1 with total capacity of the national mounting system also set to 1.

4) Any attachment in this case should have a "mounting system" flag in items.xml and "size" flag in items.xml (example: HK AG 36, mounting system - under barrel picattiny, size - 4).

5) Any gun should have listing of the attachment zones in weapons.xml

6) There are as many attachment slots in each zone as it is defined by its size (1,2,3,4 etc). Barrel ending zone and stock zone should always have not more then 1 attachment slots. Any national mounting systems should also have only one attachment slot (as described above).

This classification of mounting zones prevents player of using incompatible attachments (like HK AG 36 and foregrip) and greatly differentiates the guns between each other.

P.S. Sorry for my English - I am probably not very good in weapons terminology. Hope it does not prevent from understanding of the whole concept.

[Updated on: Wed, 24 February 2010 23:42] by Moderator

Re: New Attachment System (In Development)[message #245234] Wed, 24 February 2010 23:51 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Pfsh, only way I can think of getting the list to work is to insert NADA items into it....
I don't want to use this solution... It sucks.
If I have to change the way attachments are stored from list to a normal array, I'm fucked.
So I'll need help on this, can't figure it out Sad

What goes on the "wtf" comment? please look this piece of code up in the source. (items.cpp)
Search for the line just under the first "else".
else {
	//pAttachment could have any number of objects, they have all been moved over
	//CHRISL: This doesn't work.  What if we have a stack of objects in the cursor?  We don't want the whole
	//	stack to be attached
	//(*this)[subObject]->attachments.push_back(*pAttachment);
	//DeleteObj(pAttachment);
	if (pAttachment->MoveThisObjectTo(attachmentObject,1,pSoldier,NUM_INV_SLOTS,1) == 0) {
		if(gGameExternalOptions.fNewAttachmentSystem){
			//WarmSteel - wtf goes here?
		} else {
		(*this)[subObject]->attachments.push_back(attachmentObject);
		}
	}
}
Re: New Attachment System (In Development)[message #245248] Thu, 25 February 2010 04:37 Go to previous messageGo to next message
Kaerar

 
Messages:2049
Registered:January 2003
Location: Australia :D
Alex that's basically what I was suggesting above except that I was suggesting having an Index xml which alters the attributes of the slots so they aren't hardcoded.

Oh and what happened to point 2 Wink

At Warmsteel have a chat with Headrock and Rowa21. They may be able to help you Smile


Re: New Attachment System (In Development)[message #245274] Thu, 25 February 2010 09:26 Go to previous messageGo to next message
Starwalker

 
Messages:768
Registered:October 2005
Location: Hannover, Germany
Alex_SPB
What do you think of the following concept:

1) There are several attachment "Zones" that could use either rail mounting system or specific mounting system:

[...]

5) Any gun should have listing of the attachment zones in weapons.xml

That would be NGAP, basically Wink


Re: New Attachment System (In Development)[message #245453] Fri, 26 February 2010 23:05 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
That little obstacle was overcome. Using null objects all the time now, and it's actually not that much of a problem.
I haven't very well looked at underslung grenade launchers yet, they're special ^^
Also I did not yet dare to change stuff in saving and loading.

Besides that, the system should work as intended now. Except that I still did not change the GUI.

I could release an exe that would allow some testing, but you will not be able to play a real game with it. Because saving is not yet supported.

Anyone feel there's need for such an exe?

[Updated on: Fri, 26 February 2010 23:12] by Moderator

Re: New Attachment System (In Development)[message #245481] Sat, 27 February 2010 02:43 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Aight, loading and saving is now possible.
It's still not a good idea to swap attachment systems during a game though.
Attachments may be lost or in wrong positions. (but in theory, there should be no crashes Razz)
Re: New Attachment System (In Development)[message #245576] Sun, 28 February 2010 16:38 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Allright, everything but the graphical part is (or should be) working now.
I'd like to release an exe so people can test it a bit, even with the hellish fuglyness of it.
Where could I upload the files?
Re: New Attachment System (In Development)[message #245578] Sun, 28 February 2010 16:52 Go to previous messageGo to next message
Marlboro Man

 
Messages:1210
Registered:October 2005
Location: USA
You can use Esnips which I have used in the past. But there might some new uploading sites available now, try googleing uploading and see what you come up with. I will sticky your thread for you. Smile


Re: New Attachment System (In Development)[message #245579] Sun, 28 February 2010 17:26 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Added the download. Please test it Smile



You might want to say, "see my 1st post at the top of thread for the download". Wink

[Updated on: Mon, 01 March 2010 06:01] by Moderator

Re: New Attachment System (In Development)[message #245604] Mon, 01 March 2010 03:30 Go to previous messageGo to next message
Kephas78
Messages:1
Registered:March 2010
Hey guys i'm new here and i wanted to start by saying thanks for all of the work you've done. I really love the mods. I don't have much experience with writing code, but i had some thoughts to throw out there.

Would it be possible to define all guns by the type of attachment system they use? instead of having to individually define each attachment as being available or not for each gun it would be determined based on if the gun had upper rail, lower rail, both rails, etc. I would think this could also simplify the exclusions for attachments. suppressors could be handled similarly with a Barrel threaded yes or no flag.

Can i also suggest the ability to use duct tape to add attachments that normally wouldn't be supported? if you can make a barrel extender with duct tape steel tube and glue, i don't think using duct tape to add a suppressor or scope is too radical, although it may be somewhat less effective than if using a proper attachment.

I wondered why you can add 40 mm grenades directly to a launcher, but when you attach the launcher to a rifle the 40mm ammo takes up a rifle attachment slot rather than staying in the launcher attachment.

Has anyone thought of using duct tape to attach mustard grenades to explosives. this way you could remotely set off the explosive and it could also disperse gas?

I was also wondering hard it would be to code to allow the use of mirrors to help see around corners. obviously this is of limited usefulness depending on playing style, but i thought it made sense.

Lastly has anyone thought of the possibility of making claymores? it could use the shotgun blast pattern like with a duckbill attachment and could be triggered by a remote or trip wire. you could also attach mustard gas canisters such as above.

That's all i have right now. Most of my background comes from working with sql databases so some of my approaches may not work.

Thanks

Kephas
Re: New Attachment System (In Development)[message #245645] Mon, 01 March 2010 10:58 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3803
Registered:July 2009
Hi Kephas
To answer some of your questions:
Quote:
Would it be possible to define all guns by the type of attachment system they use?

Well thats what this thread/project is about.
Quote:
to use duct tape to add attachments that normally wouldn't be supported?

The extender is a relic of the original JA2, it's widely considered unrealistic but left in because, well, it has been there from the beginning.
And I think everything except laser-pointer would be too big/unstable to be mounted with tape and have any bonus on performance. Code wise, you would still have to add 'taped [item]' to any gun / attachment system it shall go on.
Quote:
I wondered why you can add 40 mm grenades directly to a launcher,...

Hmmm, it's part of the code, don't know if it was necessary or just more convenient for the original devs.
Quote:
Has anyone thought of using duct tape to attach mustard grenades to explosives.

You should definitely try smeagol's Alpha Item Mod. He added a full array of 'homemade' explosive devices, especially various grenades + gas tank resulting in really big explosions/gasclouds.
Quote:
I was also wondering hard it would be to code to allow the use of mirrors to help see around corners.

Sounds to me like a really great feature, but would kinda make the game to easy if the AI can't use it. Considering implementation, no idea what relation of invested time vs usefulness it has, cause possible is quite a lot.
Quote:
Lastly has anyone thought of the possibility of making claymores?

Some time ago there was a discussion about fragmentation grenades /claymores, considering the use of shotguns in any form. Don't remember if it was found too difficult, impossible or no one actually tried, but as far as I know, there was no result in the desired form.

@ WarmSteel
considering the issue of visualizing what goes where:
What if every slot that can't take attachment X is simply grayed out as it is already done in the old system? You wouldn't need silhouettes and the system would be consistent with what we have and what we are used to.


Re: New Attachment System (In Development)[message #245654] Mon, 01 March 2010 14:10 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Quote:
What if every slot that can't take attachment X is simply grayed out as it is already done in the old system? You wouldn't need silhouettes and the system would be consistent with what we have and what we are used to.

It does that already Smile
check it out and test it please ^^
Re: New Attachment System (In Development)[message #245715] Mon, 01 March 2010 18:48 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3803
Registered:July 2009
Setup: JA2 Gold + SVN 1210
I tested it and it works well so far. Admittedly I only captured the airport, ordered some AUGs and went to C13, but attaching/detaching seems to work flawlessly.
Only thing I noticed is strange behavior of shift+f. I assume you didn't change anything about this yet but I wanted to mention it needs some change in order to be fully compatible.
Tested with 2 AUGs
AUG1 before: reflex, lam-flashlight,battlescope,silencer,m203, 40mm HE, triggergroup
after: m203, 40mm HE, triggergroup
so the upper row was detached, while the lower one was still in place
to confuse things a bit:
AUG2 before: reflex, lam-flashlight,acog,silencer
after: acog, silencer
this time, only the 4 upper slots were initially filled and only 2 of them were detached


Re: New Attachment System (In Development)[message #245718] Mon, 01 March 2010 18:53 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Shift f is not something I had looked at yet no.
But if it uses the normal functions it should've worked, guess it's special then Razz
I'll have a look.

I also noticed a little flaw in enemy item selection which should be fixed now, but I can't really test it until there are better weapon xml's Sad

Not that the enemy really needs a new attachment system, but I want everything to work even when you take the old system out completely.
Re: New Attachment System (In Development)[message #245769] Mon, 01 March 2010 21:47 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Oops, I actually broke that one ^^ fixed.

Edit as not to spam:
also fixed AP costs again Smile
Wasn't being read properly from xml :wb:

[Updated on: Mon, 01 March 2010 23:41] by Moderator

Re: New Attachment System (In Development)[message #245795] Tue, 02 March 2010 01:00 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Also added tooltip support for bobby rays.

This is about all I can think of, will be starting with graphical implementation soon.

[Updated on: Tue, 02 March 2010 01:03] by Moderator

Re: New Attachment System (In Development)[message #246195] Fri, 05 March 2010 01:37 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Well, a pic says more than a thousand words, so, here's what we have so far.
Add some standard slots under the attachments, and that will be the final result.
http://img202.imageshack.us/img202/9997/hurray.png

I've got 2 out of 8 screens I need to do ready now.

[Updated on: Fri, 05 March 2010 01:37] by Moderator

Re: New Attachment System (In Development)[message #246357] Sun, 07 March 2010 13:15 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
New alpha release on the first page Smile
And this time with the code itself largely finished. (still nearly empty XML's)

Please test it and provide feedback.
Re: New Attachment System (In Development)[message #246359] Sun, 07 March 2010 13:46 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3803
Registered:July 2009
I get "invalid or deleted file"- error from mediafire when I try to download NAS 0.2a, could you please check that?


Re: New Attachment System (In Development)[message #246360] Sun, 07 March 2010 13:49 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
My bad, just updated it Smile
Re: New Attachment System (In Development)[message #246361] Sun, 07 March 2010 14:27 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
what.. the.. f... Can't create a IMP with 8 characters in his name xD
weird
Re: New Attachment System (In Development)[message #246364] Sun, 07 March 2010 15:28 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Mhh, it only happens in debug mode. And you can still play anyway.
Is this a known issue in other mods? Cause I never even touched this.
Re: New Attachment System (In Development)[message #246407] Sun, 07 March 2010 22:30 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
New version, made a little more room so that 2 attachment slots will fit above each other, also added a picture Smile
I'm looking for modders to help me make the XML files complete.

[Updated on: Sun, 07 March 2010 22:32] by Moderator

Re: New Attachment System (In Development)[message #246411] Sun, 07 March 2010 23:40 Go to previous messageGo to next message
Maalstroom

 
Messages:344
Registered:December 2008
Location: en route to San Hermanos
does nas include ham3.6? and why is it so big? i mean the exe?
Re: New Attachment System (In Development)[message #246412] Sun, 07 March 2010 23:43 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Probably because it's a debug exe, otherwise I don't know.
And no its a revision just before HAM 3.6 was implemented.
Without XML's I you can't really play a campaign yet anyway, though.
NAS was built on revision 3320.
Re: New Attachment System (In Development)[message #246413] Sun, 07 March 2010 23:45 Go to previous messageGo to next message
Logisteric

 
Messages:3372
Registered:December 2008
Location: B
had that problem once with an ham-exe; headrock told me debug is twice as big as standard - he even made a new one for me as i was using a pIII then
Re: New Attachment System (In Development)[message #246793] Thu, 11 March 2010 23:38 Go to previous messageGo to next message
Faithless

 
Messages:442
Registered:October 2009
Location: The safe end of the barre...
Added XML files with all the guns, so all guns should take almost the same attachments they did in 1.13 now.
The exe didn't change but now you can really test it Smile

Grenades cannot currently be attached to guns, sorry. (system should work, just didn't add the XML yet)

Gogo test it to death.
Re: New Attachment System (In Development)[message #246832] Fri, 12 March 2010 11:53 Go to previous messageGo to previous message
DepressivesBrot

 
Messages:3803
Registered:July 2009
Somehow the graphical part seems to be severely bugged.
Whenever I right-click a gun, the only thing that shows up is the unload button and a -seemingly non functional- close button. However, there seems to be another, invisible layer, as everything that would normally be covered by the attachment-view isn't accessible anymore.
Happens both in tactical and strategic view, gun in hands, gun in merc inventory, gun in sector inventory.

However, I did some small-scale testing with the old 0.1 and your new xml files and didn't find any problems so far.




Previous Topic: WF6.06-Mod_beta_english_for_JA2_1.13NIV2112 and higher
Next Topic: Combo Mod Loader for 1.13
Goto Forum:
  


Current Time: Mon Oct 21 05:33:21 EEST 2019

Total time taken to generate the page: 0.01821 seconds