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] 2

Author Topic: Importing tanks  (Read 22396 times)

murkz

  • Full Member
  • ***
  • Posts: 152
    • The Antisocial Gamer
Importing tanks
« on: November 13, 2012, 03:12:48 am »

Hi Outerra,

I am having some issues but progressing slowly :)

I have the test tank in, that is the good news.

It floats in the air, the wheels are about 1 meter off the ground, I have also included some images of the model in Max and the hierarchy, can you confirm these are correct.


Floating above the terrain, I cant seem to enter the vehicle either. When I press enter the vehicle just rolls down hill.



« Last Edit: November 13, 2012, 03:32:05 pm by cameni »
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Importer
« Reply #1 on: November 13, 2012, 03:16:12 am »

There seems to be an error in your script - something about EF not defined, if I can decipher it right from the picture.
Logged

murkz

  • Full Member
  • ***
  • Posts: 152
    • The Antisocial Gamer
Re: Importer
« Reply #2 on: November 13, 2012, 03:46:31 am »

Ok the model is moving and I am driving it :) Thank you Outerra. The wheels are still not on the floor and do seem to react to the terrain undulations but the wheels are at least 750 mm above the terrain.

I also seem to have the gun facing the wrong way :D should be easy enough to fix...

I copied in the config file for the BMW and the error was gone.

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Importer
« Reply #3 on: November 13, 2012, 03:50:01 am »

Did you adjust the wheel size (radius) in the init_chassis, before adding the wheels?
Logged

murkz

  • Full Member
  • ***
  • Posts: 152
    • The Antisocial Gamer
Re: Importer
« Reply #4 on: November 13, 2012, 03:56:31 am »

Ok it is now on the ground, it was my noob error. I had the wheel circumference set to 1 meter instead of .5

Thank you cameni for all your help :)



And here she is, a real thing of beauty  :-*

A small update 8 wheels added:

« Last Edit: November 13, 2012, 07:41:24 am by murkz »
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2520
  • #1 Outerra Fan Boy
    • My Youtube
Re: Importer
« Reply #5 on: November 13, 2012, 12:14:38 pm »

How does it turn? Can you set it up to actually turn like a tank yet?
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

murkz

  • Full Member
  • ***
  • Posts: 152
    • The Antisocial Gamer
Re: Importer
« Reply #6 on: November 13, 2012, 01:07:20 pm »

How does it turn? Can you set it up to actually turn like a tank yet?

Unfortunately it steers like a car at the moment but I have pushed on with another of my vehicles :)





I have a few issues with this as well.

1, The wheels that touch the ground rotate and the higher ones only when they touch the ground. They should turn all the time but I don't know how.

2. I don't know how to make the steering wheel turn

3. What does Outerra have planned for tracks? There are several options that I know of :)

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Importer
« Reply #7 on: November 13, 2012, 01:53:02 pm »

I guess it could turn like a tank, needs to change the sign of engine force applied to the wheels to be different on each side when turning, or brake one side.

Only the wheels that touch the ground are rotating with animate_wheels() currently, but you could rotate it manually via geomob. The same for the steering wheel: first call get_geomob(0) to get the geometry object, then get the joint of the steering wheel and call one of the rotate methods on it.
Code: [Select]
function init_vehicle() {
  this.geom = this.get_geomob(0);
  this.swheel = this.geom.get_joint("your steering wheel node");
}

function update_frame(...){
  ...
  this.geom.rotate_joint_orig(this.swheel, angle, {x:0,y:0,z:1});
}
This assumes you have the steering wheel as an object with rotation axis aligned with z, change if needed.

Once there's a specific track physics, it will solve the wheel rotation problem as well as other things. But I didn't think it through yet completely.
« Last Edit: November 13, 2012, 01:56:50 pm by cameni »
Logged

murkz

  • Full Member
  • ***
  • Posts: 152
    • The Antisocial Gamer
Re: Importer
« Reply #8 on: November 13, 2012, 03:14:29 pm »

I guess it could turn like a tank, needs to change the sign of engine force applied to the wheels to be different on each side when turning, or brake one side.

So how would I accomplish this please Cameni and can we use one key for each tracks brake i.e:

W forward, Q left track brake, E right track brake.

Veteran66

  • Newbie
  • Posts: 2
  • newbie
Re: Importer
« Reply #9 on: November 13, 2012, 03:24:35 pm »

This look good Murkz, so we get a Panzer simulator with Outerra :)
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Importer
« Reply #10 on: November 13, 2012, 03:28:37 pm »

You could try something like conditioning it based on the steering value. For negative steering value, brake wheels on one side, for positive the other.

For better (custom) control we first need to expose general inputs in the script, so that you can bind whatever you need there. Right now you are getting only the engine power (-1..1), brakes (0..1) and steering (-1..1) axes.

Btw I'm going to move these posts to the importer thread, they contain info that will be useful for others and easier to find there.
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2520
  • #1 Outerra Fan Boy
    • My Youtube
Re: Importing tanks
« Reply #11 on: November 13, 2012, 04:00:16 pm »

When I would code steering for tanks in garrys mod I would do so with WASD keys and it looked like this..
FB Controller...
10=W or Forward
5=S or Reverse

LR Controller...
4=A or left
6=D or right

Tl is Track Left, Tr is Track Right output

Wl is weld left and Wr is weld right (In game to stop the tracks from moving at all IE drag)

WB is weld both or to simulate a locking differential between the two so you drive strait.

Code: [Select]
FB == 10 -> Tl=1 Tr=1 Wl=0 Wr=0 WB=1;
FB == 5 -> Tl=-1 Tr=-1 Wl=0 Wr=0 WB=1;
LR == 6 -> Tr=8 Tl=-8 Wl=0 Wr=0 WB=0;
LR == 4 -> Tr=-8 Tl=8 Wl=0 Wr=0 WB=0;
FB==10 & LR==6 -> Tr=4 Tl=-2 Wl=0;
FB==10 & LR==4 -> Tl=4 Tr=-2 Wr=0;
FB==5 & LR==6 -> Tl=-4 Tr=-2 Wr=0;
FB==5 & LR==4 -> Tr=-4 Tl=-2 Wl=0;
FB == 0 & LR == 0 -> Wl=1 Wr=1 Tl=0 Tr=0 WB=1;

You would do something similar to to control a tank with a 4 way controller.
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

murkz

  • Full Member
  • ***
  • Posts: 152
    • The Antisocial Gamer
Re: Importing tanks
« Reply #12 on: November 13, 2012, 04:09:27 pm »



A small youtube video.

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2520
  • #1 Outerra Fan Boy
    • My Youtube
Re: Importing tanks
« Reply #13 on: November 13, 2012, 08:54:57 pm »

I want tracks so bad now.
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

Donken

  • Newbie
  • Posts: 2
  • newbie
Re: Importing tanks
« Reply #14 on: November 14, 2012, 12:35:05 am »

Oh, a panzer simulator in outerra? That would be a dream! I already have lots of ideas.
Logged
Pages: [1] 2