The revival of HeightControl is finally near.Greetings!
After another way too long time (i had to necrobump), i finally came around and finished the important part of the code.
What is currently left to do is add the client sided prediction code (for people playing with latency mostly, to make going up and down look smoother) and fix one small bit that will add the last bit of backwards compatibility (i had to edit this build to be backwards compatible).
BETA BUILD!WARNING! Incompatible with the old client of HeightControl due to massive rewrite.
Please request people who join and want to use HeightControl properly to download this build as well.
This build's client will be compatible with every upcoming build from now on.
My apologies for this inconvenience.What changed?Players/Server Owners should not notice much except for every vehicle made to use HeightControl now going up in the direction of the vehicle's up.
I fixed that the helicopters no longer go statically up (so no more super tilted but still going straight up helicopters) by default.
This feature is still available for modders though.
This and the rewrite does make it easier to use the crouch key.
HeightControl is now an add-on of an internal script which i called Vehicle Trigger Functions v2 (VTFv2), which aimed to fix some issues i had with the onTrigger functions.
For example, every trigger that the driver presses in the driver seat of a vehicle (now also fixed so that every type of vehicle works) gets pushed to the vehicle's onTrigger function.
Previously this was limited to the jump key only, but now modders can use that onTrigger just like they would use a player's onTrigger function, for every trigger you have (jumping, crouching, jetting (the latter still dismounting you from the vehicle)).
All the triggers except jumping (which you could do via the vehicle's onTrigger function) and crouching (not detectable on drivers) were done by packaging the Armor::onTrigger function. While it worked, it should be easier and more understandable now it is under the vehicle's onTrigger function as well.
I also added a new function called onPassengerTrigger for vehicles to use when a passenger presses a trigger.
A client script was and still is needed to fix the crouching key (not for the jump key anymore though, that was a mistake on my part), i did a whole load of tests with different ways to detect if someone was pressing the crouch key in the driver seat, but nothing worked. Trust me.
But this also will be used (soon) to implement some velocity "prediction", which will make the heightcontrol look a bit smoother, especially if there is lag present.
A vague plan is to also add the movement keys to this system (under onMovementTrigger or something similar) to give modders the ability to use those for interesting things as well.
Though this might be a bit too much.
Tl;DR
Users should not notice much change except for the non-static going up now, modders will see an increase in how easy it is to use this mod for their own weird/cool experiments (like submarines... Never expected that....).
EDIT: Previous topic content.
After years of other random projects, procrastinating and low motivation i finally decided to just take some time to finish some stuff up.
I am very sorry for those that waited for this, though i doubt there are many.
This is also because i recently visited a server using helicopters (Stay Woke!) and i really, really feel ashamed that i never added the thing where you go up relative to the vehicle's rotation instead of a static height increase. :X
Either way, i am not here to gloat over this fact but to discuss matters. Code matters.
I will list my questions with a bit of text after it to explain my questions in context a bit.
Don't want the questions to get lost in the text either.
1. Does any of you think calling the player's vehicle onTrigger from Armor::onTrigger could cause trouble?
I already check if the player is the driver, though i also am working on an additional function called onPassengerTrigger to make it easier for vehicle makerrs to detect if a passenger is pressing a trigger.
2. Does anybody (not the forum user) know if there is a way to detect if the driver of a vehicle is pressing his crouch button without client script?
3.
The Torque Quick Reference Guide or whatever speaks of a ShapeBaseData::onTrigger, yet when i package for example the FlyingVehicleData::onTrigger and Parent it, it gives a console error saying: "Unknown command onTrigger".
Is it safe to make a ShapeBaseData::onTrigger function or should i package it still?
What is the preferred/recommended way of doing this?
4 & 5 & 6. Back in the days, after the release of HeightControl on RTB, i got a tip of M (Clockturn... I think?)What you should do is when the client gets into a vehicle that uses this, send them a clientcmd telling it the velocities the vehicle uses, and use
Code:
ServerConnection.getControlOb ject().getObjectMount()
to get the vehicle clientside then apply the velocity clientside. This still works (for now - it wouldn't surprise me if Dadspot "idiot-proofed" this too later)
Anyway, essentially what this means is, if you replicate the serverside logic clientside, it'll be (theoretically) smooth at higher latencies (ie, above 300 or so, where it becomes noticeable, though in theory even all the way up)
Would this be much more efficient?
Does it even work still?
Can i use set and getVelocity on the vehicle's object clientsided?
Most of these questions are asked because it seems odd to me that i can get (and apparently set) all this information clientsided.EDIT: After dumping some stuff about the clientsided things and finally actually trying it out, the effect should be good and as M said, on a higher latency, it will help those people.
Especially for something like HeightControl.
Here's a bit of context for some of the questions:
Currently i am building it so that the onTrigger function of vehicles will also get called when the driver presses his crouch button, fire weapon/tool button and jet button.
The crouch button sadly can only get done through a client script, since none of the other onTrigger's gets called when you crouch as the driver.
So sadly i have to report, only the jump button client part has been removed ever since.
Back in the days i made a mistake in my tests and thought the onTrigger did not get called with a triggerValue..
So i made a client script to fix that... Yeah that wasn't needed either.
But after a lot of testing and checking things i am 100% convinced that only the crouch button is something i need a client script for.
But i just want to really know for sure.
Though i have gotten a tip on another way to handle descending, the light key, i prefer to give modders a way to use what they can use normally in other onTrigger functions.
That is basically my goal here as well, to "fix" the onTrigger function of vehicles for drivers.
It only gets called when pressing the jump key, which is... weird.
On top of that, the crouch key doesn't even get detected serverside if you are a driver of a vehicle...
This all binds into the heightControl mod, the "fix" to the onTrigger function has now basically become the base on which HeightControl will work.
Sorry for the wall of text and lot of questions, i just want to do this right, hopefully in one shot so that i do not have to change too much after the rerelease.
Especially on the client side, i want to avoid everyone running different versions of the client script specifically.
This rerelease will work perfectly fine with vehicles created with the old heightControl in mind.Well most of them, i think the submarines will suffer because they overwritten some of the old functions that i have changed the function, name and pretty much everything of. :X
If you have any suggestions, questions or anything related to HeightControl, feel free to put them here as well!
This topic is basically gonna be my main development topic for project HeightControl.