Stormworks: Build and Rescue

Stormworks: Build and Rescue

评价数不足
Adjusting the spread of projectiles v0.1 + text tutorial
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
376.702 KB
2024 年 2 月 5 日 上午 6:29
2024 年 2 月 5 日 上午 6:34
2 项改动说明 ( 查看 )

订阅以下载
Adjusting the spread of projectiles v0.1 + text tutorial

描述
What is it and how does it work?
This is a construction made by me to stabilize the fire of guns in Stormworks.
Step 1. the principle of operation is simple, the gun is pointed vertically upwards, and you shoot at the trigger, and then use wsad to adjust the camera so that it is directed with its crosshair exactly with the projectile, then you click on the screen 1 time and the data is recorded in the microcontroller to your right in in the form of numbers x1 y1, x2, y2 (hover over it with the mouse), then you have to transfer this data to Excel to convert it into a matrix and then into the controller to the left of the chair, there you need to insert the matrix on top of the lua code and voila, the adjustment works. Initially, the adjustment values in the left controller are not the closest to ideal, but they work fine, you can adjust the gun indefinitely.

For exemple my tank accuracy: the target is at a distance of 656 meters,
without adjusting the spread:

with adjusting the spread:

In order for the accuracy to be better, you need to conduct several cycles(step 3) of the test with a new matrix each time, this is the second cycle from the standard spread, as you can see there are errors

Step 2. Excel setup:

To convert to a matrix, you need to write in two columns x and y and use the function ="{x = "&YOUR_the_X_coordinate of the cells&", y = "&YOUR_the_Y_coordinate of the cells&"},"

Sample:

Copy and paste it here:

don't forget about the two brackets: {} that close the matrix: mem = {(x and y matrix)}
Step 3. To get the best accuracy, you need to adjust it every time after measuring one matrix, first insert your new matrix into the controller, now start the test from the beginning, you will see the difference between what was before. In the second cycle, you need to subtract the new value of the matrix from the previous one for correction and use the function again ="{x ="&YOUR_the_X_coordinate cells&", y ="&YOUR_the_Y_coordinate cells&"},"

How do I connect this controller to the cannon?
Copy it by pressing ctrl+lmb, go to your building and connect gun pitch, yaw to the control from the seat, and h piv to the pivot responsible for the vertical guidance of the gun and w piv to the horizontal (if you do not have a robotic pivot, but a velocity pivot, you need a pid and settings for it).

FAQ
How accurate is it?
There is an error both in measurement and simply, as the projectile flies out of the center and tends to the sides, but I think it is possible to improve shooting at least 1.5 times if everything is done correctly

Credits?
I would really like people who are hampered by this spread, like me, to find this building, so I would be grateful

Help?
Write in the comments

Why is the value of x and y in the matrix 32?
Because, as practice shows, the spread is repeated every time, it is not known for sure, but it may change, for example, if the developers update the weapon dlc, then it may change
Even if this is not the case, it is quite convenient to set up the first 32 and shoot accurately
Credits
Great thank to hostbanani for help with lua!!!

Make your own conclusions whether you need it or not