Jump to content

Gacsam

Members
  • Posts

    13
  • Joined

  • Last visited

Personal Information

  • Country
    United Kingdom
  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Gacsam's Achievements

Feller

Feller (1/10)

0

Reputation

  1. Guess I should've put a bit more into research and realised DotNet version hasn't been updated for a year haha. Oh well, transferring doesn't seem too hard. Does ScriptHook have a way to reload runtime, like ScriptHookDotNet had F8 to reload scripts? Also, does anyone have example code of using GetPrivateProfileString for arrays? (like a ped list for example) I attempted it with isingstream but it just crashed the whole game.
  2. Gacsam

    GET_PED_CROUCH_MOVEMENT

    GET_PED_CROUCH_MOVEMENT or _0xD5FE956C70FF370B returns True when player (or other ped) is crouched, including walking, running, climbing and dropping from low heights. (low = no ragdoll effect)
  3. I managed to get the code running by creating a new string with it but the new prompt still doesn't appear. I don't really know pointers so probably messed something up. The only information I can see about InputArgument is on the screenshot. unsafe { fixed (char* promptText = "Prompt") { string promptString = Function.Call<string>(Hash._CREATE_VAR_STRING, 10, "LITERAL_STRING", new string(promptText)); Function.Call(Hash._UIPROMPT_SET_TEXT, joinPrompt, promptString); // "ACT_HUNTING_PROMPT" } }
  4. Adding this line results in the exact same error on promptText as before, no matter if it's <char*>, <string> or anything else. Yes it's all inside unsafe{ fixed{ Function.Call<char*>(Hash._CREATE_VAR_STRING, 10, "LITERAL_STRING", promptText);
  5. Well, I tried, now I get an error CS1503: cannot convert char* to Native.InputArgument, (char** if I use &testValue) so I guess that's progress? I tried converting it back to a string with CREATE_VAR_STRING but it gave me the exact same error. The line looks like this: unsafe { fixed (char* promptText = "Prompt") { Function.Call(Hash._UIPROMPT_SET_TEXT, joinPrompt, promptText); // "ACT_HUNTING_PROMPT" } }
  6. I tried using the _DATABINDING_ADD_DATA_STRING function to see if I can inject the strings myself, but DOES_TEXT_LABEL_EXIST always resulted in False no matter which added variable I used, but all the existing ones (like the WARDROBE ones) came out true. Looks like String Translator will have to do. Is there a way to make the transition from CLEAR_PED_TASKS smooth? Whenever I try it the ped just goes ramrod straight, or would I need an "opposite" of the task - such as making them stand up when they're sitting down?
  7. So is this a matter of language difference? Is it possible that the C++ version can somehow...bypass the search of a label and takes the string input as the label content, but the C# version doesn't have that functionality?
  8. So that brings us back to _UIPROMPT_SET_TEXT, hell, this is really confusing since it looks like it should work just fine. What value should _CREATE_VAR_STRING return? It looks like it returns the exact same string when returning a string.
  9. I've been testing around and realised that _UIPROMPT_REGISTER_BEGIN outputs a Prompt and I've been using int all this time. Displaying the result of _CREATE_VAR_STRING(string) gives out the same string as the input, is it Trying to get the Prompt via Function.Call<Prompt>(Hash._UIPROMPT_REGISTER_BEGIN); results in an error Unable to cast native value to object of type 'RDR2.UI.Prompt'. Weirdly enough, int worked with the existing prompt text. Do I need to create the prompt first with _UIPROMPT_CREATE? Any idea how I would go about it? The only mention of the method is in the campfire thread which I browsed through many times and it's only mentioned.
  10. Unfortunately neither work, I'm testing my mod with subtitles for now, the prompts are the final bits really. Both lines throw some errors about protected memory, bloody UIs always being an issue hah
  11. I've narrowed down the issue to the CREATE_VAR_STRING command, I managed to dig around and found a command with an existing prompt, the prompt shows up just fine. Function.Call(Hash._UIPROMPT_SET_TEXT, prompt, "WARDROBE_INSPECT_PROMPT"); Is there somewhere a list of all other prompts such as WARDROBE_INSPECT_PROMPT? Or would anyone have an idea how to get the _CREATE_VAR_STRING working?
  12. Hi, I've been working on a mod and I'm almost there, but I've gotten stuck on prompts and got no clue how to fix it up. I am using the ScriptHookRDRNetAPI. I'd really appreciate if someone could look over and point out where the issue lies. Some notes to narrow down the issue: Function.Call<string>(Hash._CREATE_VAR_STRING is where I think the issue lies but that's just assumption. _CREATE_VAR_STRING in NativeDB is shown as a const char*, but: const char* gives an error: char* cannot be declared as a const (commented out) Function.Call<char*> gives an error: char* cannot be used as an argument (commented out) changing string to any other kind of variable, like a long immediately crashes the game upon reloading script. targetEntity is 100% working, I have used it to check if I'm targeting specific models. Function.Call<Hash>(Hash.GET_HASH_KEY seems to be working exactly the same as Game.GenerateHash( tested by comparing models, so I doubt that's causing any issues. Both ShowSubtitle commands fire off with the current code, but prompt does not appear. RDR2.UI.Screen.ShowSubtitle("Initialising"); Entity targetEntity = outputTarget.GetResult<Entity>(); int groupID = Function.Call<int>(Hash._UIPROMPT_GET_GROUP_ID_FOR_TARGET_ENTITY, targetEntity); int basicPrompt = Function.Call<int>(Hash._UIPROMPT_REGISTER_BEGIN); //const char* promptString = Function.Call<char*>(Hash._CREATE_VAR_STRING, 10, "LITERAL_STRING", "Prompt"); Function.Call(Hash._UIPROMPT_SET_CONTROL_ACTION, basicPrompt, Game.GenerateHash("INPUT_FRONTEND_LS")); Function.Call(Hash._UIPROMPT_SET_TEXT, basicPrompt, Function.Call<string>(Hash._CREATE_VAR_STRING, 10, "LITERAL_STRING", "Prompt")); Function.Call(Hash._UIPROMPT_SET_PRIORITY, basicPrompt, 5); Function.Call(Hash._UIPROMPT_SET_ATTRIBUTE, basicPrompt, 18, 1); Function.Call(Hash._UIPROMPT_SET_STANDARDIZED_HOLD_MODE, basicPrompt, 1); Function.Call(Hash._UIPROMPT_SET_GROUP, basicPrompt,groupID, 0); Function.Call(Hash._UIPROMPT_SET_ENABLED, basicPrompt, true); Function.Call(Hash._UIPROMPT_SET_VISIBLE, basicPrompt, true); Function.Call(Hash._UIPROMPT_REGISTER_END, basicPrompt); RDR2.UI.Screen.ShowSubtitle("Initialising finished");
  13. From my testing "free aim" means your aim being free - not locked onto a ped - as it works when not targeting anything or "freely"? aiming around with a gun. I'm using ScriptHookDotNet and this piece of code to check what you're locked onto. OutputArgument outputTarget = new OutputArgument(); if (Function.Call<bool>(Hash.IS_PLAYER_TARGETTING_ANYTHING, Game.Player)){ if (Function.Call<bool>(Hash.GET_PLAYER_TARGET_ENTITY, Game.Player, outputTarget)){ if (outputTarget.GetResult<Entity>().EntityType == EntityType.Ped){ Ped theTarget = outputTarget.GetResult<Ped>();
×
×
  • Create New...