i want to do an animation for the unit u see in the attached file. i have no experience of this right now. however - i managed to adapt the script of the old model to the new one. wheels are turning quite well. what i want to add now is that the frontwheel is turning in the right direction when the units is moving around. that means turning left a bit when units is turning left, straight when the unit is going straight and so on....
i found a script of the BA minelayer vehicle armmlv where the frontwheels are doing exactly this. but til now i didnt manage it to integrate it to my script. actually wheel is turning somehow - but not doing exactly what i want.
i also havent understood until now how i can set the maximum anglewhere the wheel should stop from further turning. the minelayer should have this also - wheels are stopping after 45° but i cant work it out how it is done. is there someone wo can explain me more about this pls?
steering wheel to left and right with bos/cob file
Moderator: Moderators
steering wheel to left and right with bos/cob file
- Attachments
-
- armfav_script.JPG
- (64.93 KiB) Not downloaded yet
-
- armfav_animation1.JPG
- (73.31 KiB) Not downloaded yet
steering wheel to left and right with bos/cob file
i want to do an animation for the unit u see in the attached file. i have no experience of this right now. however - i managed to adapt the script of the old model to the new one. wheels are turning quite well. what i want to add now is that the frontwheel is turning in the right direction when the units is moving around. that means turning left a bit when units is turning left, straight when the unit is going straight and so on....
i found a script of the BA minelayer vehicle armmlv where the frontwheels are doing exactly this. but til now i didnt manage it to integrate it to my script. actually wheel is turning somehow - but not doing exactly what i want.
i also havent understood until now how i can set the maximum anglewhere the wheel should stop from further turning. the minelayer should have this also - wheels are stopping after 45° but i cant work it out how it is done. is there someone wo can explain me more about this pls?
i found a script of the BA minelayer vehicle armmlv where the frontwheels are doing exactly this. but til now i didnt manage it to integrate it to my script. actually wheel is turning somehow - but not doing exactly what i want.
i also havent understood until now how i can set the maximum anglewhere the wheel should stop from further turning. the minelayer should have this also - wheels are stopping after 45° but i cant work it out how it is done. is there someone wo can explain me more about this pls?
Re: steering wheel to left and right with bos/cob file
Why attach the script as a jpeg? Attach the code as t̶e̶x̶t̶ png: png is better for things like raster graphics where you have few colors.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: steering wheel to left and right with bos/cob file
Doing this is one of those things that "Sounds cool" but in practice sucks.
Why? Because you're going to get stuck in an arbitrary turnrate that can't be exceeded otherwise what is in your graphic happens. And if you decide to limit it to a certain angle, then it's just going to look silly turning faster than it possibly could with that visual angle.
I believe that the answer to your question is not in your script, but in the unitdef turnrate.
Why? Because you're going to get stuck in an arbitrary turnrate that can't be exceeded otherwise what is in your graphic happens. And if you decide to limit it to a certain angle, then it's just going to look silly turning faster than it possibly could with that visual angle.
I believe that the answer to your question is not in your script, but in the unitdef turnrate.
Re: steering wheel to left and right with bos/cob file
Surely there's a way to get around those problems that you've listed?Forboding Angel wrote: ↑10 Apr 2019, 06:26 Doing this is one of those things that "Sounds cool" but in practice sucks.
Why? Because you're going to get stuck in an arbitrary turnrate that can't be exceeded otherwise what is in your graphic happens. And if you decide to limit it to a certain angle, then it's just going to look silly turning faster than it possibly could with that visual angle.
I believe that the answer to your question is not in your script, but in the unitdef turnrate.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: steering wheel to left and right with bos/cob file
Absolutely!
Because you're going to get stuck in an arbitrary turnrate that can't be exceeded otherwise what is in your graphic happens. And if you decide to limit it to a certain angle, then it's just going to look silly turning faster than it possibly could with that visual angle.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: steering wheel to left and right with bos/cob file
Upon further reading of OP, perhaps I should state it thusly...
While limiting the angle will look pretty silly when the unit pulls a hard turn, limiting the angle is as simple as:
if heading > x
heading = y
end
I can't remember if spring angles use negative numbers (I should know this but it escapes me atm). If it does use negative numbers you'll need a statement to limit the negative angle as well.
While limiting the angle will look pretty silly when the unit pulls a hard turn, limiting the angle is as simple as:
if heading > x
heading = y
end
I can't remember if spring angles use negative numbers (I should know this but it escapes me atm). If it does use negative numbers you'll need a statement to limit the negative angle as well.
Re: steering wheel to left and right with bos/cob file
thanks for the response. actually wheel is turning on and on like a clock - thats looking silly. no wheel turn while unit is steering left and right is also not top of the game. and the wheel turn must fit also to the model of the unit. for that reason i want to limit it. probably i have made sth wrong on my first attempt also cause armmlv is turning wheel like it should without seeing some limit. so i have to look again to understand this topic better and i will try the proposed code soon. thank you.
PS: heading = direction/turning?
PS: heading = direction/turning?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: steering wheel to left and right with bos/cob file
Yes, heading is one of the arguments in your wheelcontrol() function, so you should be able to use turn wheel to heading.
Just make sure that earlier in the function you have limited the angles.
Just make sure that earlier in the function you have limited the angles.