Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
The automatic parking brake seems to have happend because of mag plates autolock and set to use parking brake, removing that seems to have disabled the constant parking brake, so removing constys airplane parts fixed the error, and toggling off mag plate autolock fixed the automatic parking brake re-applying, but now i got a completely different issue, now it cant see the subgrid wheels, i think im gonna have to get back to this at a later stage in the build process
Parked
Caught exception during execution of script:Object reference not set to an instance of an object.
at Program.WheelHandeler(IMyShipController cockpit, List`1 wheels)
at Program.Main(String argument, UpdateType updateSource)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.<>c__DisplayClass42_0.<ExecuteCode>b__0(IMyGridProgram program)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.RunSandboxedProgramActionCore(Action`1 action, String& response)
Any clue where i should start looking for cause?
"Program(116,64): Warning: Field 'Program.vel' is never assigned to, and will always have its default value 0"
Script won't run.
I have another feature update request, its the same i asked last time but ive provided an example of why it would be beneficial. (now with the new tank framework API from Digi, creativity is flowing!)
- https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3237591926
The example has my current workaround for getting groups:
have the same script running on multiple programmable blocks with banking enabled, each one with a labeled group, example, programmable block 1, group 1, programmable block 2, group 2 etc.
feature update: Bank groups
Reason:
On custom suspension where you have layers of suspension, having one group of suspensions isnt enough.
suspension group 1 is strength, group 2 is angle, group 3 is wheels on ground. all three needs to move differently to achieve a good bank.
Proposed setup/modification: (mind that im not good at coding but something ish like this?)
//Banking "rolls" the vehicle using suspension offset when turning
//The amount of banking is determined by how fast you are turning, modified by BankMod
bool SteeringBank = true; //Toggles banking the vehicle when turning to alleviate chance of rolling
//copy this part to add more groups:
string BankGroup = "Group 1";
double NeutralHeightOff = -1.5;
double MaxOffset = -0.5;
double MinOffset = -1.5;
double BankMod = -5.0;
//copy this part to add more groups:
string BankGroup = "Group 2";
double NeutralHeightOff = 0.55;
double MaxOffset = 1.3;
double MinOffset = 0.55;
double BankMod = -5.0;
Instead of applying a force to all wheels based on the speed of the grid, it now applies it based on the rotational speed of each individual wheel.
Added some description to the three modifies for braking that should help fix individual issues.
This should fix the issue of wheels spinning when connected to other grids and parked, and should significantly improve parking brakes on an incline.
As for parking without wheels on the main grid;
You can add the PB to actionbar, and give it the argument "park", pushing this button will now toggle park on/off internally in the script, so it'll work with no wheels on the same grid as cockpit.
Have only tested it with two mid-sized grids, so probably some bugs to iron out, feedback is appreciated :)
@waddles, i would probably group and turn wheels on/off with a button if parking brake doesnt fix it
after initial testing there are a couple of thing to point out:
- Sometimes turning doesnt trigger enough roll to give "enough" banking", this seems to be caued by counterforces from high weight/speed when turning, this is also observed if the wheels loose ground contact and looses its turn momentun. this resets the banking angle adding to the external force, which is scary in a tight turn.
- Banking engages after the rover starts turning and wheels in SE takes time from button press before engaging into a turn (amplified at higher speeds), it feels like the roll engages late and isnt "tight" when needed
Would there be a way for button inputs to engage roll faster?
Example: If player press button "D", script initiates player driven max banking, Player releases D, script reverts to calculating y axis roll? (the way the script already works, it keeps the bank for the remainder of the turn after release and reverts smoothly)
2: Considered it, felt it got too convoluted.
Banking is done by how fast the vehicle rotates around it's own Y-axis, in Radians/sec.
eg. if you rotate 90 degrees in one second, you're rotating at a rate of +pi/4 radians per second.
That's roughly 0.79, making a BankMod=5 give you an offset of around +3.9 (or whatever your upper limit is. Turning 90 degrees in 10 seconds would give you +0.39 offset
Felt it easier to leave it as a "If it's not banking enough, raise it" sort of value :p
two things:
1, is there a way to make it groupable? example: only wheel suspensions in group "banking" is applied
Reasoning is that i use a lot off weird suspension tricks, like having large grid 1x1 as springs and 5x5 small wheels on hinges, in that case i would only want the 1x1 spring system to bank the rover, not the small grid 5x5 wheel as they would only serve to lower ground clearance risking voxel collsion
2. add the min/max values in the readme section, BankMod 5 doesnt give much information, does it go to 10? 100? 1000? 1000000?
example:
double BankMod = 5; //Modifies how strong the banks is.(0<->100, default = 5)
Added a twist tho; the amount of banking is dependent on how fast the vehicle is turning, instead of a static amount for any turn, I think that makes sense, and it looks cool when driving slalom!
For now, the settings for it is at the top of the script with the others, having added the following:
SteeringBank - Set to true, to enable banking. (false by default)
NeutralHeightOff - The susp. offset you want in neutral position (0 by default)
MaxOffset - The max susp. offset you want (1.3 by default)
MinOffset - The min susp. offset you want (-1.5 by default)
BankMod - Modifier for the banking action, eg. higher values make it bank more at lower speed. (5 by default)
Ran some tests but may have missed something, so feedback would be nice.
If it's not how you imagined or you have an idea of a better way for it to behave, do tell :)
I have a feature whish for your script.
(Picture for relevance - https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2930053454)
Would you be willing to ammend/add a function, that would allow the suspension to bank into turns? a type of "Active Body Control" or anti roll? (or perhaps have it as a function in a separate script?)
A function, that when you steer left or right (A/D) the wheel suspension height offset is altered to offset potential roll to custom amount
It would be ofc be off by default, and could be enabled in custom data to maintain the simplicity of your script as is.
Im not a coder so i wouldnt even know where to start, i havent seen anyone make something like this, and this is something im really missing from a lot of my builds. and perhaps for many others
It will only consume power when standing still, when park/handbrake is actually enabled.
If you used a piston + gear instead, you could just avoid putting the vehicle in park, and the motors wouldn't consume power.
- Improved how the script recognizes the center of the craft, so wheels should now be turning in the right direction, even if the controller is not at the center of the craft!
- The script now registers "parking" and will brake accordingly, additionally the script can be run with the argument Park to toggle an internal parking brake on/off, in case the game won't let you use parking or handbrake.
- Changed how the parking brake works, it's not perfect, but it should work a lot better now (Check description for the relevant info if you want to modify braking behavior)
- Realized that a script can set Propulsion Override (way) beyond 100%, so you are now able to set how much propulsion is applied through the variable PowerMod .
- The script will now tell you if your desired cockpit/seat/remote was not found and that another one has been chosen, along with which has been chosen.
I don't know of a way to access Parking, I can only "see" handbrake, so that's the only one the script reacts to :/
Go for it :)
Is handbrake on by any chance?
There doesn't seem to be a way to braking to the wheels using script, so i'm doing it using power instead.
@Rabenschild
I can add that, assuming the ownership works atm
**TO FIX INVERTED STEERING**
Look for:
"if (relPos.Z < 0) { turner = -turner; }"
at the bottom of the script and change it to
"if (relPos.Z > 0) { turner = -turner; }"
Just flip the "<"
That should fix it
Personally i limit the rotors to +/- 45 degrees, usually prevents then from gettint too close to vertical and still allows for enough rotation to not be an issue while driving.
maybe reduce wheel power as well.
I've tought about putting a torsion spring kinda deal in to make the rotor go towards a neutral position, but fear it may cause issues in some use cases.
allso how do i prevent the rotor from fliping over cause i had it like 2 rotors on each side with 2 wheels each and for some reason while moveing they have a high chance of fliping is it to do with the weight
For now, tick off "invert steering" on the wheels, gonna upload a fixed version within the hour