Перейти к содержимому


Фотография

CAR rotation values in IPL (.WPL / .XPL) files?


  • Авторизуйтесь для ответа в теме
Сообщений в теме: 5

#1 LOKIOLR

LOKIOLR

    Новичок

  • Пользователи
  • Pip
  • 4 сообщений

Отправлено 27 January 2012 - 16:24

So I've been trying to figure this out for a few days now. It doesn't look exactly like a quaternion, radeon, or eular measurement. Here's what I think it might be: WPL (Stream section) Unknown 4 - quaternion real (expressed in an unusual way?) Unknown 5 - quaternion j (expressed in an unusual way?) Unknown 6 - degree of variation I think Unknown 4 & 5 could be a single axis of quaternion set since cars would only need to be rotated along the Z axis (they're kind of rotated then dropped by the game since spawning a vehicle at a higher elevation always results with it being on the next solid object below it). The other values would be static which is why they aren't defined like they are with object placements. I believe Unknown 6 has to do with some sort of randomization or variation since I can record the heading angle using the simple native trainer on certain vehicle spawns with the exact same values in the WPL and the heading angles are all very different (within a few degrees =/-) Any thoughts on this? I'm trying to develop something to take vehicles objects placed via the simple native trainer's object spawner and translate them into something that can be imported into a WPL file. I have everything done except for the rotations. I just have to find how they are expressed in the WPL files so I can setup the translating. Any ideas? On another related note, I did figure out that UNKNKOWN 3 in SECTION 0 is an object draw distance distance override. -1 will default to the defined draw distance in the IDE files and any other number will set the draw distance of that particular item. GTA IV uses this mainly for interior sets.

#2 3doomer

3doomer

    Участник

  • Staff
  • PipPip
  • 24 сообщений

Отправлено 27 January 2012 - 18:30

Car rotation's a vector[X, Y].

From GIMS IV:

dline - WPL car section instance parameters array

Read:
Angle = (acos (dot (normalize [dline[4],dline[5],0]) [0,1,0]))
if dline[4] > 0 then
	Angle *= -1
TheCar.rotation = Angle
Write:
Angle = (TheCar.rotation as EulerAngles)
dline[4] = (sin Angle.z)
dline[5] = (cos Angle.z)

6th parameter deals with car spawning somehow(I've figured that there's only 2-3 values when car spawns, one of them - 4.0757)

Сообщение отредактировал 3doomer: 27 January 2012 - 18:39


#3 LOKIOLR

LOKIOLR

    Новичок

  • Пользователи
  • Pip
  • 4 сообщений

Отправлено 28 January 2012 - 05:27

Car rotation's a vector[X, Y].

From GIMS IV:

dline - WPL car section instance parameters array

Read:

Angle = (acos (dot (normalize [dline[4],dline[5],0]) [0,1,0]))
if dline[4] > 0 then
	Angle *= -1
TheCar.rotation = Angle
Write:
Angle = (TheCar.rotation as EulerAngles)
dline[4] = (sin Angle.z)
dline[5] = (cos Angle.z)

6th parameter deals with car spawning somehow(I've figured that there's only 2-3 values when car spawns, one of them - 4.0757)


Thank you for your help. I thought the 12th parameter controlled when the vehicle spawns. Well more like, the 12th parameter defines the car group (which vehicles to spawn when a hash isn't defined in the 7th parameter), and that defines when it spawns. When I first started to figure out the vehicle spawning I had an issue where my spawns would only appear at night. Now I use 1633 for everything and they appear at all times of the day. Also I've put a bunch of different variables in the 6th parameter and it hasn't seemed to make a difference to whether something spawns or not. If I figure out what it does I'll be sure to follow up here. Thanks again.

#4 solom

solom

    Активный участник

  • Пользователи
  • PipPipPip
  • 267 сообщений
  • Пол:Мужчина


Отправлено 28 January 2012 - 19:43

LOKIORL You are make out some parameters in 'cars' section? I mean flags. If yes - please, write it in your post..

#5 LOKIOLR

LOKIOLR

    Новичок

  • Пользователи
  • Pip
  • 4 сообщений

Отправлено 31 January 2012 - 05:29

LOKIORL
You are make out some parameters in 'cars' section? I mean flags.
If yes - please, write it in your post..


I'm not 100% positive on the 12th Parameter in the cars section. It's either car groups or some sort of flag. Based on some trial and error experiments that was what I came up with. But the UNKNOWN 3 in Section 0 is draw distance for sure. I use it to create some mock LOD objects for my map edits.

I will look into it a bit more once I finish working on the car rotation stuff.

Сообщение отредактировал LOKIOLR: 31 January 2012 - 05:37


#6 LOKIOLR

LOKIOLR

    Новичок

  • Пользователи
  • Pip
  • 4 сообщений

Отправлено 04 February 2012 - 06:12

I can confirm the 6th parameter in the STREAM section is for degree of variation. Not sure if the value stands for actual degrees or a percentage but the larger the number, the larger the random variation is. A value of 0 will not vary from the angle defined in parameter 4 and 5.




Количество пользователей, читающих эту тему: 1

0 пользователей, 1 гостей, 0 анонимных