@GamerJoey369 Set (Some Entity).IsPersistent to true.
Vehicle v = World.CreateVehicle(VehicleHash.Adder, Game.Player.Character.Position + new Vector3(0, 10, 0));
v.IsPersistent = true; //this method also works on peds/vehicles/objects.
I decided to give modding a chance, a while back. I started learning lua first then c#, however, I don't really know the languages that well or coding in general. When ever I have a problem, I just search it up or ask the community and the wonderful people at gtaforums and gta5-mods have answers.
@GamerJoey369 Set (Some Entity).IsPersistent to true.
Vehicle v = World.CreateVehicle(VehicleHash.Adder, Game.Player.Character.Position + new Vector3(0, 10, 0));
v.IsPersistent = true; //this method also works on peds/vehicles/objects.
@Jitnaught Thanks for the reply. It's good to know it's not just me. I downloaded the source code and i'm now looking at it. I mean they have to have a way to make changes while in the game. It's such a huge project, restarting over and over again just doesn't seem like something they would do. I really don't know c++, but the only thing that I see differently about the registering and unregistering is that SHVDN uses WINAPI instead of what Alexander blade had in his sample file, which is APIENTRY for DLLMain. Searching online the consensuses is that they are the "same" but on a technical level different, which I don't quite understand. Another thing is SHVDN is registering and unregistering scripts with the address operator "&" while the samples don't use the operator. I hope these things make a difference but from the looks of it I don't think it will. Anyways, I've been trying to test out my idea but I keep getting other little errors that I still need to solve, It might be a while
@xxx78 Yeah that's a good one. I use it and my game hasn't updated for about a year now, but I have the retail version of gta5.
I recently started trying to learn how to make asi and learn a little bit of c++, and I am having some problems whenever I press reload(control + r), the scripthookdotnet.asi stops working, while all the other .asi mods restart including my own test.asi. I found this very frustrating because I would need to restart gtav to work on c# code. I just wanted to know if I'm missing a step for scripthookdotnet.asi reloading? I know that the .asi script needs the unregister keyword, but I would assume scripthookdotnet.asi had that. Is there anything that I can do?
@Jitnaught Oh ok got it, only major changes to the game. Thanks.
Hi all,
I don't really know which thread to put this question, but it is directed towards modders or anyone that owns both Retail GTAV and steam GTAV. I was wondering if any modders have both versions of GTAV, so that they could check how their code behaves on both versions? I know there is some difference but I don't know what it is, some mods for some reason work better for retail("PC") versions, like GTAVLauncherBypass or codewalker. I would like to test out my mods on different versions, so if you have both versions, is it worth it? does it make a difference?
@gxfire I will see if I will add it. It shouldn't be too hard since it's a effects change.
@ikt I didn't realize your function said "GetOffsetInWorldCoords". My function does the other one and gets the offset.
@ikt Yeah you're right about that, more choice is better.
public Vector3 GetOffsetGivenWorldCoords(Vector3 Origin, Vector3 Rotation, Vector3 Position)
{
Vector3 RightVector = RelativeRightVector(Rotation);
Vector3 ForwardVector = RotationToDirection(Rotation);
return new Vector3(-1 * Vector3.Dot(RightVector, (Origin - Position)), -1 * Vector3.Dot(ForwardVector, (Origin - Position)), Position.Z - Origin.Z);
}
public Vector3 RelativeRightVector(Vector3 Rotation)//source is from scripthookdotnet
{
double num = Math.Cos(Rotation.Y * (Math.PI / 180.0));
return new Vector3((float)(Math.Cos(-Rotation.Z * (Math.PI / 180.0)) * num), (float)(Math.Sin(Rotation.Z * (Math.PI / 180.0)) * num), (float)Math.Sin(-Rotation.Y * (Math.PI / 180.0)));
}
public Vector3 RotationToDirection(Vector3 Rotation)//I forgot where I got this from, I had it for a long time
{
float z = Rotation.Z;
float num = z * 0.0174532924f;
float x = Rotation.X;
float num2 = x * 0.0174532924f;
float num3 = Math.Abs((float)Math.Cos((double)num2));
return new Vector3
{
X = (-(float)Math.Sin(num)) * num3,
Y = (float)Math.Cos(num) * num3,
Z = (float)Math.Sin(num2)
};
}
@ikt great job. I made my own implementation using dot product instead. I wish I had searched on google with parameter site: gta5-mods.com instead of just gtaforums.com . I thought there was no information about it, it took me some time to make own re-implementation. I was going to post my findings here as well, but yours is more efficient.