Everything posted by ainesophaur
-
CALLING DEVS / PLAYERS - Callout Probability
Realistically, as mentioned above.. There's no way to have a centralized consistency because anyone can mark their callouts as high. We should create a shared library (similar to the update manager plugin) which plugins can participate in.. Then we can manually trigger each callouts based on randomness without a weight on priority. Edit: tagging @Darkmyre
-
[REL | WIP] LSPDFR Computer+
How many monitors do you have?
-
[REL | WIP] LSPDFR Computer+
My mouse issue on C+ stopped after I switched the games primary output monitor to monitor 1. Normally I play in surround mode which combines my monitors to act as one.. but with the RPH bug I can only play with the single monitor. Once I selected the output monitor (in gta settings) to the primary monitor of my PC it stopped with the invisible mouse and FPS drop. Any other monitor would cause my FPS to drop to 1 and the mouse to never appear
-
[REL | WIP] LSPDFR Computer+
By chance, are you playing offline? I noticed it wouldn't appear for me when I was offline
-
Follow
If the titles of the posts were accurate then I don't see a problem with multiple posts while search doesn't work.. That way people can just glace over the titles instead of hoping a random thread with 20 questions has the answer they're looking for. I wonder if the forums used have a Q&A plugin which would give a feel like stack overflow. Anyone know what type of forum software is in use?
-
Follow
No I definitely didn't so I apologize if it seemed I was jumping on you.. I wasn't. I just didn't want any of us to scare people away from seeking help.. The past few months have been amazing with plugins and you're one of the pioneers who is always helping out.. So again, sorry if it felt like I was targeting you over one post
-
Follow
While I partially agree, I don't feel it's our place to put down someone looking for help.. It's why the forum exists (yes it was an API discussion forum but it's grown since the sub forum was created) This is one of the only forums where people can get great help..the rage forum is dead. It's extremely overwhelming for new developers who never worked with c# before (or any type of coding) With all of that said.. OP.. Here are some suggestions. They're quite short 1. When you're trying to figure out how to do something in the game look through the Rage api documentation.. Specifically the Entity, Object, Ped, Vector3 and Vehicle classes.. 9/10 what you're looking for is there 2. Experiment a little.. You won't destroy anything with wrong ideas. 3. Try to collect a few problems that you can't figure out and make a post
-
[SOLVED] Changing CalloutProbabilty
Can your provide your code from onBeforeCallout? Are you calling base.onBeforeCallout before returning from the method?
-
Looking for Mentor?
Don't feel bad about posting topics to figure something out.. Chances are there are other people who share your position and posting your questions here allow everyone to learn
-
[SOLVED] Changing CalloutProbabilty
It looks like the crash is occurring in your plugin and not in lspdfr itself. Copy the pdb and the DLL generated by VS so your crash reports can tell you where it crashed instead of ????????
-
[SOLVED] Changing CalloutProbabilty
Checkout towards the bottom
-
Persuit
Vehciles in Rage have a TopSpeed property that you can set. You'll want to save the original top speed to a variable and restore it when your call out is done http://docs.ragepluginhook.net/html/977B7F06.htm
-
[SOLVED] Rage Native UI Refresh Menu Item List
[Deleted, will reopen my github issue one day]
-
[SOLVED] Rage Native UI Refresh Menu Item List
Just out of curiosity.. Why not just pass the reference to the list vs copying the elements?
-
[SOLVED] Rage Native UI Refresh Menu Item List
Are you making the list a List<dynamic>? I believe the only way I got it to work was to remove the uimenu item and put it back in the previous index position
-
Download Center API
Is there anything in the works (jwt, oauth2) for authenticating users against lcpdfr?
-
[SOLVED] Peds not fighting
Can you post the relevant code?
-
Placing objects on the ground
That's funny .. I noticed in your road management video where the object movement and snaps to the ground seemed a bit different than what I experimented with. But it works properly
-
Blip Still Active After Arrest/Death.
Give this a review.. I added comments in order to explain whats going on. It's not intended to copy & pasted, rather it should explain how to use the enumerators to cycle through messages using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using LSPD_First_Response.Mod.Callouts; using System.Windows.Forms; using Rage; namespace FR_Wanted { public class WantedController : Callout { Vector3 SpawnPoint = new Vector3(-1758.445f, 125.273f, 64.774f); enum CalloutStates { None = 0, Traveling, OnScene, BeingAttacked }; enum ConversationTypes { Impatient, Regular, Danger, None = 0 } /** * Imagine you had three different types of dialogs a suspect could use. * I used the enum above to track them and the variable below to track which one is picked */ ConversationTypes Current = ConversationTypes.None; CalloutStates CalloutState = CalloutStates.None; List<String>.Enumerator CurrentDialog; /** * The below variable is a dictionary which means it stores items as a Key, Value pair rather * than a flat list. */ Dictionary<ConversationTypes, List<String>> DialogMessages = new Dictionary<ConversationTypes, List<string>>() { /** * We are creating the list of dictionary entries during the construction of the dictionary. * Alternatively we could have DialogMessages = new Dictionary() and then done the following.. * List<String> regular = new List<string>(); * regular.Add("Hello Officer"); * regular.Add("I'm sorry"); * ... * DialogMessages.Add(ConversationTypes.Regular, regular); * * But why have all that extra code :) * http://stackoverflow.com/questions/17047602/proper-way-to-initialize-a-c-sharp-dictionary-with-values-already-in-it */ { ConversationTypes.Regular, new List<string>() { "Hello Officer", "I'm sorry for not paying attention", "Have a nice day" } }, { ConversationTypes.Danger, new List<string>() { "You better get away from me", "I'm having a bad day", "Ok time to die" } }, { ConversationTypes.Impatient, new List<string>() { "I dont have time for this", "Can we hurry this up", "Can you do anything right" } } }; public override bool OnCalloutAccepted() { //We set our state for the conversation type Current = ConversationTypes.Impatient; CalloutState = CalloutStates.Traveling; //Set CurrentDialog to use an Enumerator of the List<String> of conversation messages CurrentDialog = DialogMessages[Current].GetEnumerator(); return base.OnCalloutAccepted(); } public override void Process() { if(CalloutState != CalloutStates.OnScene && Game.LocalPlayer.Character.Position.DistanceTo(SpawnPoint) <= 20f) { CalloutState = CalloutStates.OnScene; } /** * Imagine our keybinding was to use K as the conversation key * We want to check if the player presses K, and if they do, check to see if there is anything * left to say in the conversation. If there isn't make the Ped flee * * Current Dialog is an enumerator which has a method called MoveNext * which will give us a boolean if there are any more items to enumerate though */ if (Game.IsKeyDown(Keys.K)) { if (CurrentDialog.MoveNext()) { //Show the next message in the enumerator Game.DisplaySubtitle(CurrentDialog.Current, 2000); } else { //We have no more messages... if we had a Ped, we could do something like // currentPed.Tasks.FightAgainst(Game.LocalPlayer.Character); CalloutState = CalloutStates.BeingAttacked; } } GameFiber.Yield(); } } }
-
Blip Still Active After Arrest/Death.
The process function I put was to depict the override process function you have in your call out.. You wouldn't call process from within process If you provide the entire .cs file I'll provide you with a clean, documented version of it. If you're worried someone will steal your code, then erase that worry.. It benefits everyone to share things as everyone learns from it
-
Blip Still Active After Arrest/Death.
Finally around to the computer and snagged a few mins to give an example of what I was talking about with dictionaries EDIT: Dont remove the items from the list :) there are smarter ways like using enumerators.. I just wrote this as quickly as possible and then realized what I had done enum ConversationTypes { Impatient, Regular, Danger, None = 0 } /** * Imagine you had three different types of dialogs a suspect could use. * I used the enum above to track them and the variable below to track which one is picked */ ConversationTypes Current = ConversationTypes.None; /** * The below variable is a dictionary which means it stores items as a Key, Value pair rather * than a flat list. */ Dictionary<ConversationTypes, List<String>> DialogMessages = new Dictionary<ConversationTypes, List<string>>() { /** * We are creating the list of dictionary entries during the construction of the dictionary. * Alternatively we could have DialogMessages = new Dictionary() and then done the following.. * List<String> regular = new List<string>(); * regular.Add("Hello Officer"); * regular.Add("I'm sorry"); * ... * DialogMessages.Add(ConversationTypes.Regular, regular); * * But why have all that extra code :) * http://stackoverflow.com/questions/17047602/proper-way-to-initialize-a-c-sharp-dictionary-with-values-already-in-it */ { ConversationTypes.Regular, new List<string>() { "Hello Officer", "I'm sorry for not paying attention", "Have a nice day" } }, { ConversationTypes.Danger, new List<string>() { "You better get away from me", "I'm having a bad day", "Ok time to die" } }, { ConversationTypes.Impatient, new List<string>() { "I dont have time for this", "Can we hurry this up", "Can you do anything right" } } }; void Process() { /** * Imagine you've triggered some process to show the messages. * and you determined the conversation should be Impatient */ List<String> messages = DialogMessages[ConversationTypes.Impatient]; //Now you're showing the messge.. normally you'd check to see if there are any items left // For bravarity sake we'll just do some basic things // while(messages.Count > 0) String messageToShow = messages[0]; // Show the message messages.RemoveAt(0); //If there are no more items left, we are done. }
-
Blip Still Active After Arrest/Death.
It'd be better to keep the entire conversation in a list. Then you can sequentially show the text and remove it from the list. Once all the items are removed from the list, the conversation is over. The only reason I would use an enum to track state is if you had multiple conversations.. Which I would then store them in a dictionary with the enum of conversation types as the key and the list of strings for the conversation as the value. I'm on my phone ATM so if it all doesn't make sense I can post an example later
-
Blip Still Active After Arrest/Death.
I've experienced this too. I prefer initializing the blip myself and keeping a reference to it.
-
Placing objects on the ground
http://docs.ragepluginhook.net/html/CF0B1476.htm should do the trick
-
Getting the closest set location? [SOLVED]
Vector3 pos1 = Game.LocalPlayer.Character.Position.GetOffsetPositionFront(50f); Vector3 pos2 = Game.LocalPlayer.Character.Position.GetOffsetPositionFront(65f); Vector3 pos3 = Game.LocalPlayer.Character.Position.GetOffsetPositionFront(80f); float pos1travel = Game.LocalPlayer.Character.Position.TravelDistanceTo(pos1); float pos2travel = Game.LocalPlayer.Character.Position.TravelDistanceTo(pos2); float pos3travel = Game.LocalPlayer.Character.Position.TravelDistanceTo(pos3); if(pos1travel <= pos2travel && pos1travel <= pos3travel) { //pos1 } else if(pos2travel <= pos1travel && pos2travel <= pos3travel) { //pos2 } else { //pos3 } When you're checking the first distance, you should check it against all available distances (eg, pos2 and pos3). I'd check less than or equal to because if they're equal. Obviously if you have more than a few values to check, this solution wouldn't be the best as it would become very messy to maintain as you add values.