Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Pages: 1 ... 5 6 [7] 8

Author Topic: Vehicle script [version 1.4.0]  (Read 81856 times)

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #90 on: February 10, 2015, 08:37:16 am »

Just been messing around with M7's Tiger 2 tank and was wondering would it be possible to add gears to the tank? and also would it be possible to make it either manual or automatic gear changing or must they be mapped to the gear shift up/down only?

Atm the Tiger2 has a single gear and its quite unrealistic in the way it takes off.

PS. I'm doing this for learning purposes, once I'm happy I'll make my own tank(s). Real rusty in doing scripts, will get there.
« Last Edit: February 10, 2015, 08:42:20 am by PRiME »
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #91 on: February 10, 2015, 09:21:23 am »

I really wanted to add gears to the tiger2 but because of the script to get the tank turning without using turning wheels, i couldn't just add script for gears and get it to move more than a snail pace. It would be really great if you could get this to work though.
Logged

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #92 on: February 10, 2015, 09:29:28 am »

I'm making decent progress, I have the gears added but unsure how they function in general. I managed to fix the reverse gear which wasn't working but it seems to go at the forward max speed. Will need to figure out howto cap it to 2 reverse gears at max of -14kph. (The tank moves more like a heavy tiger 2 tank now. Still couple little quirks such as not being able to turn when going above 24kph or so, this is likely a realistic quirk however when you think about it).

The other thing I want to play with is adding a projectile to the gun including sound (since you can shoot now), then after that I was going to look into hooking the view to locations so you can turn turret and commander view moves with it (over the cupola).

But first things first, figuring out howto cap the reverse speed.
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #93 on: February 10, 2015, 10:14:26 am »

Are you using already made gear script (from giucam or hrrrrr) or you do plan to make a new one from scratch?
Logged

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #94 on: February 10, 2015, 10:16:45 am »

I'm going to try and get giucam's one working correctly first, then maybe I can simplify it if possible since Tiger 2 isn't exactly a sports performance vehicle.

Logged

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #95 on: February 11, 2015, 10:20:44 am »

Well I figured out the issue with this script for the Tiger, its mostly related to the Torque values being extremely rigid, if you go too far out of what they are (~400) such as 1850N.m which is what the Tiger 2 had then it basically stalls the script in a loop.

I'm in the process of finding where this hold up is happening, being the very amateur that I am, this could take some time. It will be some basic value, will figure it out.


Edit: Seems the max torque you can have before things go downhill (tank doesn't move) is around 700. Will continue looking into this tomorrow.

Edit2: So the problem turns out to be a double edged blade, yes the script does react odd when dealing with high torque engines, but the main contribution to the Tiger 2 movement problem is you (M7) have specified weights (large) inside the model itself, thus compounding the issue. You should only use a 0-1 value to help with balance then when you put the mass in with the scripts it distributes this correctly.

Atm the Tiger 2 tank appears to have ~10k-20k weight added to it via the model alone (you specified 20k in the script, this is added to the model weighting/or multiplied, whichever). Outtera appears to factor this into its own mass calculation (as to determine weight distribution and balance, or the tank would flip over etc) thus you have a compounding effect. I will now just move onto making my own tank (Sherman firefly or something), my skills in this area have been dormant for 10years, this will be interesting to say the least, LOL


PS. I'm 10years rusty to all this tank building and script stuff, please be gentle with me if I turn out to be completely wrong  =|
« Last Edit: February 11, 2015, 10:27:37 pm by PRiME »
Logged

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #96 on: February 25, 2015, 10:21:15 am »

Just wanted to update this and say there is nothing wrong with M7's Tiger model, the issue turns out to be related to wheel assignment, seems the more wheels you add the more it factors into vehicle weight or ability to move. Bit odd, but now I know whats directly causing it I can find a solution, really only the middle wheels need animation effect only.

PS. Got my M4A4VC Firefly working at very basic level, now to iron out the scripting and hope they add in something to allow you to rig the ballistic firing system to the cannon barrel (with adjusted properties to suit the caliber).
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2520
  • #1 Outerra Fan Boy
    • My Youtube
Re: Vehicle script [version 1.4.0]
« Reply #97 on: February 25, 2015, 07:05:17 pm »

Keep working. If we don't get ground vehicle scripts working as best we can the Fly-Boys are going to flight sim us into oblivion.

It is a war now.
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #98 on: February 26, 2015, 01:19:38 am »

Well atm I'm going to make my own suited for larger vehicles such as tanks, (tracked vehicles infact). I will use some ideas from what other people have done, will probably take me a while to suss it all out, only got the basics down atm.

Also while I'm at it, does anyone know a tutorial on howto rig a Turret/Mantlet/Barrel correctly? I have each set as a bone because each part can move separate from the other but in different axis, and atm they kinda don't move correctly. I have a idea of fixing it by changing the center of mass to match the turret but was wondering if there was a simpler way.

1) Turret pivots around the Z axis in a circle.
2) Mantlet moves up/down the Z axis in a but also moves a bit in the X axis as it pivots up/down.
3) The gun follows the Mantlet but also has additional action when fired causing it to recoil back.

All of them follow the Turrets pivot around the Z axis obviously. Anyway was wondering if I was doing it wrong by selecting each as a individual bone or if there is something I can do to make the mantlet/barrel follow the turret but allow addition separate movement themselves.

Think I explained all that in a complicated way, sorry. Anyway any tips are welcome.

PS. Can't wait for ballistics function to open up for scripting and also functions to allow for track movement (rotation around the wheel cogs would be cool, perhaps follow a BezierCircle bone which is how I make my tracks in blender)
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Vehicle script [version 1.4.0]
« Reply #99 on: February 26, 2015, 02:33:47 am »

Well atm I'm going to make my own suited for larger vehicles such as tanks, (tracked vehicles infact). I will use some ideas from what other people have done, will probably take me a while to suss it all out, only got the basics down atm.


That would be nice !

As for the turret - its off topic, so check your PM for my message.
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #100 on: February 26, 2015, 10:17:06 am »

I have tried to message you a few times PytonPago but for some reason non of the messages are recorded in my Send Out box, so I have no clue as to if you ever get replies from me. :(
Logged

HiFlyer

  • Hero Member
  • *****
  • Posts: 1788
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #101 on: February 26, 2015, 10:23:45 am »

I have tried to message you a few times PytonPago but for some reason non of the messages are recorded in my Send Out box, so I have no clue as to if you ever get replies from me. :(

I had that problem here before. I found that sending a BCC to myself as well solved the problem.
Logged
Spex: Intel Core i7 6700K @ 4.6GHz / 32.0GB G.SKILL TridentZ Series Dual-Channel Ram / ASUS STRIX GeForce GTX 1080 / Sound Blaster Z / Oculus Rift VR Headset / Klipsch® Promedia 2.1 Computer Speakers / ASUS ROG SWIFT PG279Q ‑ 27" IPS LED Monitor ‑ QHD / 2x Samsung SSD 850 EVO 500GB / Windows 10 Pro

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #102 on: February 26, 2015, 12:06:34 pm »

Ok, will check that out.

Meanwhile I'm puzzled on howto use the following

method / wheel / int wheel_id - 0..n wheel id returns wheel_data structure with wheel info, get run-time wheel data

I have been trying testwheeldata = this.wheel(0, rpm); with no luck, I tried just having (0) and it reports back object, Object. I need it to report back the RPM for each wheel so I can detect better when the vehicle spins out or does weird things (tanks never spin out btw).
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Vehicle script [version 1.4.0]
« Reply #103 on: February 26, 2015, 12:27:43 pm »

Code: [Select]
//get wheel data for wheel 0
var testwheeldata = this.wheel(0);
var rpm = testwheeldata.rpm;
Logged

PRiME

  • Full Member
  • ***
  • Posts: 170
  • newbie
Re: Vehicle script [version 1.4.0]
« Reply #104 on: February 27, 2015, 12:09:49 am »

Cheers for that nugget,

Making slow progress here, now I wish to apply a gradual increase of wheel force the longer the user holds down forward or reverse (to my max defined value). I have come up with the idea to use something like the following in the update frame section. Similar to how the turrets work.


Clearly the below is wrong, basically when the user has forward down (1) I want a value to be added, and if finger is off forward then a value to decrease. Anyone have any ideas about this one? :)

function action(k,v,dt)
{
  switch(k){
  case AForward: EFMaxRate = EFMaxRate + AccelValue(v); break;
  }
}
Logged
Pages: 1 ... 5 6 [7] 8