Jump to content

[IV | SNT] Question about SNT objects...


Recommended Posts

DaBOSS54320

Edit: I figured it out now. Guess I posted this topic and gave up a lil too early... sorry bout that. Moderators can delete it if you want. But here's what I found out: offz is "obj.GetOffsetPosition(obj.Position).Z" with "obj" being your Object.

 

 

So I've been making my own object creator thing (It's like GTAO's a little bit, I'll probably make a topic on it later) and I want to make an option on it to save to objects.ini for use with Simple Native Trainer since far more people have that than my mod, and I don't want to force people to get my mod to load objects made with it. This is a fairly easy task for me to save the info to objects.ini except for 1 part... what is "offz" in SNT's objects.ini?

From "offz" I would think "offset z" but from what I tried, I don't think it's distance off the ground or z height from zero, and have no idea what else it could be.

 

I really didn't want to make a topic for this since it's just 1 little question but... couldn't figure it out after multiple attempts and asking some friends privately... thanks in advance if you know/answer.

 

To clarify, by offz I mean the "offz" in this (from my most recent saved objects.ini):

 

[1]
x=2336.58
y=785.368
z=7.50695
h=56.313
Model=96563979
qx=-0.0925108
qy=0.102251
qz=0.463401
qw=0.875355
offz=-656.655
Dynamic=0
Edited by DaBOSS54320
Link to comment
https://gtaforums.com/topic/779702-iv-snt-question-about-snt-objects/
Share on other sites

this makes no sense...

 

obj.GetOffsetPosition(obj.Position).Z

 

u dont use the position in world coordinates to offset another world position, u create a vector3 and describe each vector's offset with x, y and z... so something like this is in front, above and to the left (1 distance unit in each direction)...

 

obj.GetOffsetPosition(new Vector3(-1f, 1f, 1f))

 

obj.GetOffsetPosition(obj.Position) this will just double the distance the object is from the world coordinates origin or 0, 0, 0. So basically u can just do.. obj.Position.Z * 2f if that is what u really want

Game.DisplayText(obj.GetOffsetPosition(obj.Position).Z == obj.Position.Z * 2f);//output: true

offsetz = -656.655 sounds like it is being offset from something in the clouds... appears odd but not sure how his script works or what he even means by offsetz

Edited by byteMe420

this makes no sense...

 

obj.GetOffsetPosition(obj.Position).Z

 

u dont use the position in world coordinates to offset another world position, u create a vector3 and describe each vector's offset with x, y and z... so something like this is in front, above and to the left (1 distance unit in each direction)...

 

obj.GetOffsetPosition(new Vector3(-1f, 1f, 1f))

 

obj.GetOffsetPosition(obj.Position) this will just double the distance the object is from the world coordinates origin or 0, 0, 0. So basically u can just do.. obj.Position.Z * 2f if that is what u really want

Game.DisplayText(obj.GetOffsetPosition(obj.Position).Z == obj.Position.Z * 2f);//output: true

offsetz = -656.655 sounds like it is being offset from something in the clouds... appears odd but not sure how his script works or what he even means by offsetz

Try rotating the object before getting the offset position and then check if it is the same as just doubling Z.

 

this makes no sense...

 

obj.GetOffsetPosition(obj.Position).Z

 

u dont use the position in world coordinates to offset another world position, u create a vector3 and describe each vector's offset with x, y and z... so something like this is in front, above and to the left (1 distance unit in each direction)...

 

obj.GetOffsetPosition(new Vector3(-1f, 1f, 1f))

 

obj.GetOffsetPosition(obj.Position) this will just double the distance the object is from the world coordinates origin or 0, 0, 0. So basically u can just do.. obj.Position.Z * 2f if that is what u really want

Game.DisplayText(obj.GetOffsetPosition(obj.Position).Z == obj.Position.Z * 2f);//output: true if object rotation is zero, good point LetsPlayorDy

offsetz = -656.655 sounds like it is being offset from something in the clouds... appears odd but not sure how his script works or what he even means by offsetz

Try rotating the object before getting the offset position and then check if it is the same as just doubling Z.

 

 

yeah true i didnt think of that actually when i quickly wrote my post, if the object is rotated and oriented different than the world then yeah it would produce a differnt world coordinate z, good point.

 

Then if that is the case, it makes even less sense to offset using the world position value as the return value is random unless you are calling this kinda code knowing the rotation beforehand. Now if you are calling this on randomly rotated objects the Z value is random pretty much random unless maybe you want to detect if an object has fallen over because then the Z value wont change much from its current position z or maybe if it is upside down or rightside up, etc.. Although using the world position to accomplish that makes no sense. IMO, it sounds like a random number generator and .net has a random class for that.

 

Just trying to picture the logic, he wants to travel up the object's Z axis in the amount of the object's world position Z and get the world Z at that point? what is that for?

Edited by byteMe420

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.