TL;DR version: Need to edit integer XML values to use functions
I made a machine gun weapon called 15mm Auto Cannon based off of OneTwoSC's shotgun
My custom weapon uses CEffectCreatePersistant from the effects tab of the data editor
This effect type has a field named [Periodic Offsets +] which holds an array of points (The classic int X, int Y, int Z values)
When an attack is initiated one of the points I entered
(0,0,0)
(1,1,0)
(-1,1,0)
(1,-1,0)
(-1,-1,0)
And subtracts or adds that from the coordinate of the target to find the offset (AKA point of impact for 15mm Auto Cannon's bullet)
The problem with this is that this system is not effected by range
Attacking a unit at range of 30 has the same bullet spread as a range of 2, 5, or even 1.
This flaw results in close quarter's shooting being illogically inaccurate with bullets flying with a 150 degree spread
I partially fixed this problem by implementing short, medium, and long range versions of the same weapon and assigning them in the trigger editor to individual units when they start an attack below or above certain ranges but this is a clunky, inefficient, and unelegant solution to this problem
What I need is a way to edit the XML of the [Periodic Offsets +] ideally to be something like
If XML cannot handle these kinds of interactions, as I am fearing, then please present a work around if you know of one
I am experienced in C so don't be afraid to suggest ideas for scripting
Well I'm not sure about being able to put it in the XML like that, but a switch effect that checks for varying ranges/distances would probably get the same effect.
Well I'm not sure about being able to put it in the XML like that, but a switch effect that checks for varying ranges/distances would probably get the same effect.
Thank you
Im going to try that and see how well it works
There is a problem though
This would add to my workload once I start mass producing weapons
I have an idea for a shortcut but im not sure.
I am new to XML so would it be legal (and how would i do it) to set the value of one field equal to the value of another field. To save time
Increasing your workload is putting it lightly if you intend to have a lot of weapons like this. Pretty sure what you are wanting to do would have to be altered by triggers changing data field values. To be honest if you are set on something like this for a great many weapons, triggers controlling it all off a dummy effect might be a wiser choice for you. Exacts of this I'm not sure on, but you'd have a lot more control on exact values that way.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
TL;DR version: Need to edit integer XML values to use functions
I made a machine gun weapon called 15mm Auto Cannon based off of OneTwoSC's shotgun My custom weapon uses CEffectCreatePersistant from the effects tab of the data editor This effect type has a field named [Periodic Offsets +] which holds an array of points (The classic int X, int Y, int Z values)
When an attack is initiated one of the points I entered
(0,0,0) (1,1,0) (-1,1,0) (1,-1,0) (-1,-1,0)
And subtracts or adds that from the coordinate of the target to find the offset (AKA point of impact for 15mm Auto Cannon's bullet)
The problem with this is that this system is not effected by range Attacking a unit at range of 30 has the same bullet spread as a range of 2, 5, or even 1. This flaw results in close quarter's shooting being illogically inaccurate with bullets flying with a 150 degree spread
I partially fixed this problem by implementing short, medium, and long range versions of the same weapon and assigning them in the trigger editor to individual units when they start an attack below or above certain ranges but this is a clunky, inefficient, and unelegant solution to this problem
What I need is a way to edit the XML of the [Periodic Offsets +] ideally to be something like
((1+[distance to target]) / [range])
If XML cannot handle these kinds of interactions, as I am fearing, then please present a work around if you know of one I am experienced in C so don't be afraid to suggest ideas for scripting
@TheShoveledOne: Go
Well I'm not sure about being able to put it in the XML like that, but a switch effect that checks for varying ranges/distances would probably get the same effect.
Thank you Im going to try that and see how well it works There is a problem though
This would add to my workload once I start mass producing weapons I have an idea for a shortcut but im not sure. I am new to XML so would it be legal (and how would i do it) to set the value of one field equal to the value of another field. To save time
@TheShoveledOne: Go
Increasing your workload is putting it lightly if you intend to have a lot of weapons like this. Pretty sure what you are wanting to do would have to be altered by triggers changing data field values. To be honest if you are set on something like this for a great many weapons, triggers controlling it all off a dummy effect might be a wiser choice for you. Exacts of this I'm not sure on, but you'd have a lot more control on exact values that way.