Author Topic: Is it possible to set a mount(joint) as an eyepoint on a weapon?  (Read 920 times)

Trying to figure out a way to create sights for weapons without having to create an extra weapon image datablock and then I had the idea of placing mounts on the model and having some code set the eyepoint to said mounts, but I'm not entirely sure how I'm gonna do that so I need some help.

The reason I ask is I'm trying to fix my weapon pack by reducing datablocks and stuff and also adding new features, but for a lot of that I need help coding wise so if you're interested in helping me pls add me on steam (steam ID: Treti559)
« Last Edit: June 10, 2016, 10:02:43 PM by Treti »

Shameless bump at 4 am.....

eyepoint is specified by eye offset so no, you need multiple images. Unless you want hacky, laggy movement using a repeating schedule

however you could make it real easy by doing this


datablock ShapeBaseImageData(ADSImage : gunImage)
{
    eyeoffset = "0 0 1.5";
}


and it should inherit all the other data from gunImage.
« Last Edit: June 14, 2016, 11:11:39 AM by Conan »

This was helpful, im going to do this to my wep packs as well.

That does help but I'm probably gonna need something hacky I think as what I have planned might be a little advanced. I'm adding guns that have multiple firing modes and on top of that also sights and I find the amount of datablocks per weapon might be too much. I plan on adding a lot of weapons but I fear I'll eventually hit the datablock limit. For example, one of my weapons has three firing modes; Full, semi, and burst, and with sights thats like 8 datablocks in total (not including any secondary sights that weapon may have) including itemdata and projectiledata (is 8 too many datablocks for a weapon?), and if I plan on adding, say 50 weapons or so, 8*50 is 400, which is nowhere near the limit, but still that's kind of a big number(I should mention I don't plan on stopping at 50 weapons :P)

Just need something where when you right click it checks for:
Code: [Select]
FP_Sights = "true"; //weapon sights enabled
and then looks for the specified mount for it to mount to like:
Code: [Select]
  FP_SightPoint = "mount2"; //weapon sight mountpoint, right-click to mount sights

Also looking to add secondary sights for some scoped weapons to be able to switch to a different set of sights for close quarters advantages or w/e like so:
Code: [Select]
  FP_SightSecondary = "true"; //check if the weapon has secondary sights available
  FP_SightSecPoint = "mount3"; //secondary sight mountpoint, activated by hitting brickshiftleft

or if it's impossible to mount sights to joints maybe just a value defined in itemdata that sets an offset that applies to all item images or something like that idk
Code: [Select]
  FP_SightPointoffset = "0 1.25 0.0"; //weapon sight mountpoint offset, right-click to mount sights
  FP_SightSecPointoffset = "0 0.85 0.0"; //secondary sight mountpoint offset, activated by hitting brickshiftleft

dunno if this sounds like too much or not :/
« Last Edit: June 14, 2016, 08:26:41 PM by Treti »