The above video goes away if you are a member and logged in, so log in now!
|
| |
Would you like to get all the new info from PSX-Scene in your email each day?
| |
|
221Likes
-
02-14-2013,08:02 PM

Originally Posted by
jumper
By empty quaternion values, do you mean when only x y z are given? I was under the impression that object.ini's that only give x y z use euler angles, and x y z w use quaternions, which are really different. I'll have to try to dig up an ini with only x y z and see what happens.
It should be possible to generate quaternions from euler angles but I haven't had much luck doing that with vehicles, but that may be due to using three seperate natives to get the car angles and probably implementing that wrong. This is the equation:
quaternion X = (COS(roll / 2) * COS(pitch / 2) * COS(yaw / 2) + SIN(roll / 2) * SIN(pitch / 2) * SIN(yaw / 2))
quaternion Y = (SIN(roll / 2) * COS(pitch / 2) * COS(yaw / 2) - COS(roll / 2) * SIN(pitch / 2) * SIN(yaw / 2))
quaternion Z = (COS(roll / 2) * SIN(pitch / 2) * COS(yaw / 2) + SIN(roll / 2) * COS(pitch / 2) * SIN(yaw / 2))
quaternion W = (COS(roll / 2) * COS(pitch / 2) * SIN(yaw / 2) - SIN(roll / 2) * SIN(pitch / 2) * COS(yaw / 2))
I have a feeling I'm just inputting the wrong angles because my output is very close but never correct, parameters get switched around and sometimes are negative instead of positive.
Or another idea that's far simpler and avoids all the math, is that if only x y z is given, you might be able to use SET_OBJECT_ROTATION instead of SET_OBJECT_QUATERNION. I have no idea if the order of the rotation parameters will match up with what the ini gives though.
I see that now that you pointed it out, honestly I didn't even look I was only using the output from three's converter.
I also have a feeling SET_OBJECT_HEADING might be redundant and not needed but I haven't tested that theory.
if you get a negative yaw, pitch or roll just add 360.0 to it and you'll get the positive counter part
edit: btw here is an article about quaternions and spatial rotation http://en.wikipedia.org/wiki/Quatern...atial_rotation see if that helps
i can't help atm coz as soon as i started reading that article my brain melted
-
02-14-2013,08:17 PM

Originally Posted by
jumper
By empty quaternion values, do you mean when only x y z are given?
Yeah the legacy type objects.ini. I'll give it a test myself and see what we get. Maths isn't a strong point so if some extra work needs in that area I'll need your help.
Also I've just noticed the value offz in some objects.ini (heli cannon). Obviously short for offset. But I can't think what it could be used for.
EDIT: Just tested legacy type objects.ini (with some empty quaternion values) on my converter and some objects are rotated wrong. I don't fancy banging my head up against the wall at this one especially at this time of night
I'll leave it up to someone else if they fancy it.
Also the converter posted in the first post cant process the 'legacy type' ini's too.
EDIT2:

Originally Posted by
jumper
Or another idea that's far simpler and avoids all the math, is that if only x y z is given, you might be able to use SET_OBJECT_ROTATION instead of SET_OBJECT_QUATERNION. I have no idea if the order of the rotation parameters will match up with what the ini gives though.
Just tried this (using SET_OBJECT_ROTATION) and the map looks much better. Just some objects are a little off now. It could be the map though I'll find another one.
Last edited by Three-Socks; 02-14-2013 at 09:25 PM.
-
02-14-2013,09:42 PM

Originally Posted by
jumper
Or another idea that's far simpler and avoids all the math, is that if only x y z is given, you might be able to use SET_OBJECT_ROTATION instead of SET_OBJECT_QUATERNION. I have no idea if the order of the rotation parameters will match up with what the ini gives though.
Just tried it with another map mod (legacy one with missing quaternion values) and it looked perfect. So what you said is right. I'll add support to legacy ini's when I update it next. Thanks for the help.
-
02-14-2013,09:55 PM
This is great stuff. I've always been a huge fan of map mods, but it's always been such a disappointment not being able to really use them online. Between the fix that Creighton made for keeping objects in place and the new converter that Three-Socks is working on, I see a huge comeback in the VERY near future for map mods in Freemode lobbies. This is a game changer, in my opinion. GTA just got a lot more fun!
-
02-14-2013,10:59 PM
Added legacy support and two new options "Automatically set blip coord at map." & "Teleport to map when spawned." to converter. Both options untested yet so I have no idea how it will turn out.
http://178.17.41.133/GTA/object2sco/
EDIT: removed teleport option. Causes too many problems with no simple fix.
Last edited by Three-Socks; 02-15-2013 at 08:11 AM.
-
02-15-2013,05:57 AM
Well making health pickups was simple enough, unfortunately other players will not be able to see or use them even if you're host. (the 100.0 are x y z coordinates)
Pickup new_pickup;
CREATE_PICKUP(1069950328, 23, 100.0, 100.0, 100.0, &new_pickup, 0);
They seem to create their own blip and respawn with the same frequency as any other health pickups, I guess to remove them you use REMOVE_PICKUP (haven't tried)
-
02-15-2013,06:05 AM

Originally Posted by
jumper
Well making health pickups was simple enough, unfortunately other players will not be able to see or use them even if you're host. (the 100.0 are x y z coordinates)
Pickup new_pickup;
CREATE_PICKUP(1069950328, 23, 100.0, 100.0, 100.0, &new_pickup, 0);
They seem to create their own blip and respawn with the same frequency as any other health pickups, I guess to remove them you use REMOVE_PICKUP (haven't tried)
I think you can use these for setting the regen times these was gonna be included in the host options in network trainer but never really tested them
extern void SET_ARMOUR_PICKUP_NETWORK_REGEN_TIME(ScriptAny);
extern void SET_HEALTH_PICKUP_NETWORK_REGEN_TIME(ScriptAny);
extern void SET_WEAPON_PICKUP_NETWORK_REGEN_TIME(ScriptAny, ScriptAny);
extern void SET_MONEY_PICKUP_NETWORK_REGEN_TIME(ScriptAny);
RESET_HEALTH_PICKUP_NETWORK_REGEN_TIME;
RESET_ARMOUR_PICKUP_NETWORK_REGEN_TIME;
RESET_WEAPON_PICKUP_NETWORK_REGEN_TIME;
RESET_MONEY_PICKUP_NETWORK_REGEN_TIME;
-
02-15-2013,08:00 AM
what are those glowing markers the player can walk into, such as in front of hotdog stands and some doors? just attach a script to one of those that restores the health/armor of whoever walks through it
-
02-15-2013,09:14 AM
@ribonucleic
they are chevrons threesocks has an example file on these on his bitbucket.
-
02-15-2013,04:24 PM
As far as I know chevrons won't be seen by other players either unless you spawn an object with the chevron model. I think something like a green cube would be more obvious to players, but seeing as most of these map mods are close to or beyond the object limit, adding an object may not be the way to go. Maybe an invincible ped that hangs out near the ramps, people can run him over to fix their car?
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|