Everything posted by ainesophaur
-
[Rage] Pointing at Cars
I was able to use the native in less than a few minutes. It was able to detect a car that I spawned and then a random ped across the street. unsafe Entity DetectEntityPlayerAimingAt() { uint handle; Rage.Native.NativeFunction.CallByName<bool>("GET_ENTITY_PLAYER_IS_FREE_AIMING_AT", Game.LocalPlayer, &handle); if (handle == 0) { return null; } return World.GetEntityByHandle<Rage.Entity>(handle); }
-
[Rage] Pointing at Cars
Would @Stealth22 idea work if the vehicle is perpendicular or not directly in front of? I don't see a reason not to use the native if it does everything you're looking for. Pointers are not complicated once they're understood.
-
[Rage] Pointing at Cars
BOOL GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(Player player, Entity *entity) I'm still a bit new to c# but have you tried to pass off a pointer handler to the entity and not the actual entity object? I'll play around with it later tonight to see what I can come up with. The rage sample project for natives show how to work with handlers // Pointers cannot be used directly with dynamic dispatching. If a native requires pointers, convert it to an IntPtr. Ped ped = Game.LocalPlayer.Character.GetNearbyPeds(1).First(); uint pedHandle = ped.Handle; // Handle of first character around the player's character. NativeFunction.Natives.DeletePed(new IntPtr(&pedHandle));
-
[Rage] Pointing at Cars
In regards to the "What vehicle is the user looking at".. this may not be entirely what you're looking for but it may get you started. private Vector3 GetCameraPosition() { return NativeFunction.Natives.GetGameplayCamCoord<Vector3>(); } private Vector3 GetCameraRot() { return NativeFunction.Natives.GetGameplayCamRot<Vector3>(0); } public static Vector3 RotationToDirection(Vector3 Rotation) { 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)((double)((float)(-(float)Math.Sin((double)num))) * (double)num3), Y = (float)((double)((float)Math.Cos((double)num)) * (double)num3), Z = (float)Math.Sin((double)num2) }; } private Vector3 GetCameraLookingAt() { float forwardAmount = 10f; //Any amount forward of the player Vector3 camPos = GetCameraPosition(); Vector3 camRot = GetCameraRot(); Vector3 cameraDir = RotationToDirection(camRot); return camPos + cameraDir * MARKER_OFFSET.OFFSET_FORWARD; } You can then use GetCameraLookingAt() and pass it off to either the rage function to get all vehicles and determine which is in the vector3 or you can use the native to get any random vehicle in the sphere. I use the functions to create a checkpoint marker to visually give me a clue for what I'm looking at.
-
GetPersonaForPed doesn't return true for IsCop on dead peds
I understand now. There isn't any within Rage, however the native function itself takes the same Peds that you have in Rage and the return type is an int that's described in the native. Is there a reason for not wanting to use the native or were you just hoping the equivalent static method existed in Rage? Edit: The result of the native can be cast to the relationship enum in Rage http://docs.ragepluginhook.net/html/FBC57062.htm
-
GetPersonaForPed doesn't return true for IsCop on dead peds
Can you elaborate more on what you're looking to accomplish? A simple compare between two peds would just be an equality check if(pedA.RelationGroup == pedBRelationGroup)
-
Unit Testing
You're a genius .. Further in the logs it does show that it's trying to load RagePluginHookSDK.dll but I copied the DLL and had both names which worked. I can't believe I didn't try that.. Thanks again. On a side note, it's more to verify behavior of your project. For instance, the test I'm writing is to have a binder of keys and actions to simultaneously react to key presses on a keyboard and controller that I'm interested in. With the unit test, I can verify the behavior of my code in pure c# environment.. Not having to load the game, clean objects up, etc.. After having a full suite of tests, Id be able to verify that my plugins work as expected in 20 seconds without launching the game.. At least as much as possible.
-
Unit Testing
I posted my question on the RAGE forum but haven't had any responses. In short, is there any way to include/use the RAGE SDK in unit testing? I get an error which makes no sense and I'd love to have guarantees in my coding. I find it super difficult to see large projects like Rage and LSPD:FR can have such scalable projects without unit testing... Especially with the ability to mock objects Sorry for the tagging that's about to happen.. But I'm dying to understand it.. @Sam, @LMS, @alexguirre, @ScottehBoyy, @Albo1125, @LtFlash
-
Placing a vehicle at the side of the road
Nothing I could find in directly attacking a vehicle.. But I did find a task to throw a projectile at a coord which could be the vehicle. http://www.dev-c.com/nativedb/func/info/7285951dbf6b5a51 Optionally there is a rage task to attack a ped.. If there is a driver you can target them but I doubt that's your end goal.
-
Placing a vehicle at the side of the road
I'm sure you can get the heading by getting the vehicles with a driver in a sphere around your target. Chances are they'll be lined up with the heading of the road.
-
How can I make my spawned ped hold an object (i.e. a cigar, cellphone, etc..)?
Was going through the rage forums last night and came across this http://forums.ragepluginhook.net/default.aspx?g=posts&t=543
-
Discussion of spawn points (developer feedback requested)
The way I chose spawn points was by setting a map marker and grabbing the coords of the waypoint via code.. So I was able to quickly obtain a few decent spawn points. I was considering building an XML doc that would be shared via this form. It'd be composed of a list of locations and possibly a couple tags to reference the ideal callout candidate.. Eg an ally on xyz Street would be good for hookers, drugs, murder, but not a welfare check. If we have enough contributions we could have a great locations list that give a consistent feel for the developers and players. I can see the need for some callouts to have a random spawn location.. But too many times do I find peds in the middle of a road or a car in the middle of an ocean
-
[WIP] RAGEObjectPlacer
No problem. I wanted the feedback to know how the community would want to use it.. thank you for providing it ;). I use a gamepad too and I know how much the back and forth slows me down.
-
[WIP] RAGEObjectPlacer
I was able to get this added for you ;) As you rotate the camera and move, the marker / items update accordingly. I also got the logic in that spawns an officer in the car who drives up to your marker. You can then rotate the car for fine adjustments. Once you "set" it's position the officer will get out and stand next to his cruiser until dismissed. I'm going to spend a few days testing it and cleaning up the code as I'm going to open source the project.
-
Discussion of spawn points (developer feedback requested)
As always, thanks a ton @Albo1125. Ill give the vector3 extension a shot
-
Discussion of spawn points (developer feedback requested)
As I'm developing my first plugin, I'm noticing a lot of woes that many first versions of popular plugins face in terms of spawn points. Example, @Albo1125 tow truck went through improvements of the spawn logic (same with the transport backup).. I remember the early days where items would spawn either next to me or in a canal. Obviously those days are gone (for the most part) but I'm sure it wracked his brain as it is mine currently. I'm sure it also took a lot of time and frustration to nail it. After seeing the discussion on blip colors, I wanted to see what the community concession is in terms of dealing with spawn points. In my mind, I'm thinking of traveling around los Santos and statically picking out spawn points, guaranteeing a minimum and maximum distance when picking the spawn point. I've also thought of getting a random vehicle within a sphere and then spawning the vehicles behind it.. But I'm sure it'll lead to me spawning a vehicle that physically collides with another Is everyone still depending on natives when spawning items like vehicles and peds, or have some used static spawn points. Am I missing any RAGE methods or native methods which allow me to detect a road with an X and Y offset? Or would I have to loop through the values returned from natives until I find one that satisfies my requirements?
-
[WIP] RAGEObjectPlacer
It would be difficult in my mind to support the controller since every sensible combination to move around the objects would clash with default keys on the controller
-
Determine if Ped has line of sight to another Ped
The issue I think you'll find with Albo1125's suggestion is it only checks if they're "facing" the player, not whether they have a clear line of site. Earlier I was looking at the native function for cast ray's...essentially you give it point A and point B and it comes back with a result of whether it has a straight line with no obstructions. It may give false positives if there is a car in the "way", but you can visibly see the player. I thought there was a RAGE function for something along the lines of "Can see player" int _CAST_RAY_POINT_TO_POINT(float x1, float y1, float z1, float x2, float y2, float z2, intflags, Entity entity, int p8) // 377906D8A31E5586 8251485D Not sure how or why this differs from 0x7EE9F5D83DD4F90E, but it does. This function casts a ray from Point1 to Point2 and returns it's ray handle. A simple ray cast will 'shoot' a line from point A to point B, and return whether or not the ray reached it's destination or if it hit anything and if it did hit anything, will return the handle of what it hit (entity handle) and coordinates of where the ray reached. You can use _GET_RAYCAST_RESULT to get the result of the raycast Entity is an entity to ignore, such as the player. Flags are intersection bit flags. They tell the ray what to care about and what not to care about when casting. Passing -1 will intersect with everything, presumably. Flags: 1: Intersect with map 2: Intersect with mission entities? (includes train) 4: Intersect with peds? (same as 8) 8: Intersect with peds? (same as 4) 10: vehicles 16: Intersect with objects 19: Unkown 32: Unknown 64: Unknown 128: Unknown 256: Intersect with vegetation (plants, coral. trees not included) 512: Unknown NOTE: Raycasts that intersect with mission_entites (flag = 2) has limited range and will not register for far away entites. The range seems to be about 30 metres.
-
[WIP] RAGEObjectPlacer
You're currently in the middle of an investigation and you decide to close off the road. You walk to each end of the road and spawn something in front of you. Its in the wrong place. Remove, retry.. again, and again. Meet RAGEObjectPlacer.. You will be able to spawn a variety of items (barriers, cones, police cars) and place them in the world via keyboard (and soon to be mouse) Planned Features: Model lists populated via XML to allow users to strip out items they dont need. Traffic redirect (Detect traffic flowing towards the placed items and either stop them, or redirect them to another route) Ability to spawn groups of items (Police car with cones behind it or multiple cones in a line) I'm interested in feedback from the community, especially on two questions Should a police officer be spawned outside of the driver door with a police car Should there be an option to set a marker and have a spawned police car drive up to the scene (immersion) I've completed most of the core logic and I'm looking to release this in less than a week (Possibly without all of the planned features included)
-
Give ped weapon broken?
Make sure the ragehooksdk that your project references is the same one you're using in GTA. If your project is trying to include the ragenativesdk that it shipped with, then chances are it's not the same rage hook version you're using in game
-
Give ped weapon broken?
What version of rage plugin are you using?
-
When should I start a new GameFiber?
I'm curious if there are any "dont's" when using a game fiber.. Such as don't start a fiber within a fiber. I haven't noticed any adverse effects to over using fibers.. But Ive only developed things I need.
-
Wilderness Callouts
In the next update can you remove the debug messages on Process? It's just wasting resources and it floods the screen with Wilderness Process()
- 302 comments
- 66 reviews
-
NFS Spike Mod - Drop spikes strips on the go !
For the controller it would be nice to have a combo key.. Like hold A + DpadRight Too many mod controls are clashing on the controller
- 33 comments
- 7 reviews
-
Code 3 Callouts
Exciting.. I've been waiting for a plugin like this! Edit: I love the small details and additions such as the unit code, the automatic GPS points and the code 4 clearing of the callout. Very very nice ;)
- 422 comments
- 73 reviews