Posted May 24, 20204 yr I have made some mods for rdr2, so I am familiar with the basics.However, I really want to know how to make a prompt "bound" to a certain object group. Like it was done in the Hunting Wagon mod (link below), by making the "Hunting Wagon" prompt appear when you approached a campfire. I know how to create prompts and how to place them on certain coordinates, but I have no idea how to make them appear when you get near a player created campfire. Edited June 9, 20204 yr by bolmin
May 24, 20204 yr You can attach a prompt to an object so that it shows when you interact with it. To get an entity's group, use _PROMPT_GET_GROUP_ID_FOR_TARGET_ENTITY. Then use _PROMPT_SET_GROUP to give the prompt the group.
May 31, 20204 yr Author I tried many things but I can't make it work. I attached the code that I have written below. The prompt doesn't show up, I used the UIPROMPT_SET_ENABLE and SET_VISIBLE but still nothing. The hash I placed there was the player campfire according to the object scanner in the rampage trainer. What am I doing wrong?
May 31, 20204 yr You need to pass the entity handle to _PROMPT_GET_GROUP_ID_FOR_TARGET_ENTITY, I am not sure if that's what you are doing. Try spawning a ped for debugging purposes and attach the prompt to it instead.
June 1, 20204 yr Could you use the clear method names instead of the hashed names? Otherwise its difficult to read your code.
June 1, 20204 yr Author I replaced the hashes with the clear names, sorry for not doing this in the original post
June 1, 20204 yr The first thing I notice is that you disable your prompt at the end. I guess it should look like this: UI::_UIPROMPT_SET_ENABLED(Prompt_Camp, 1); Havent checked the rest yet, but those enabling methods are usually for toggling (0 is off and 1 is on). Or did I misunderstand it? Edited June 1, 20204 yr by HughJanus
June 1, 20204 yr Author I didn't show it but later in the code both SET_ENABLED and SET_VISIBLE are set to 1. I don't know why in this example I disabled it at the end
June 2, 20204 yr Have you gotten any prompt to work this way? I took a look at the uiprompt methods available and the first one is this (maybe you need to create one before registering?): _UIPROMPT_CREATE
June 2, 20204 yr Author I created prompts with this method before and they worked fine, but I never used GET_GROUP_ID and SET_GROUP to get a prompt to show when you approach an object
June 3, 20204 yr Can you post a code snippet with which you already got prompts to work? Edited June 3, 20204 yr by HughJanus
June 6, 20204 yr Author the code that works is exactly the same but without GET_GROUP_ID and SET_GROUP. also sorry for late response.
June 6, 20204 yr Have you tried using the group ID with something other than the campfire? With horses or peds, for example. Are you getting valid IDs with the current method?
June 7, 20204 yr Author I noticed that when I put the group id for something that already has prompts attached to it (for example an interactable object in the shop, a tent or a horse hitching post) there is a scripthook errror and when I put it on something else it doesn't work
June 7, 20204 yr But doesnt the player campfire also have prompts assigned already? Are you sure the campfire hash you are using is the correct one? Do you get a proper value back from the GET_GROUP_ID function for this hash?
June 7, 20204 yr Author Exactly, that is why I wonder how the creator of hunting wagon did it. I don't know if it is the correct one but I was looking through the objects list on this website and I tested it with all the campfire related stuff and it didn't work, then I used the object scanner from a trainer and used the hash from it instead .
June 8, 20204 yr In the mod thread of hunting wagon I just asked if the source code is available - maybe the creator shares his/her code, then we will see. How does the hunting wagon mod work? Do the prompts only appear when you approach the wagon from a certain direction? Maybe theres some trick to it.
June 8, 20204 yr Author Thanks for reaching out to him. In the mod when you approach a campfire a prompt shows up to call the wagon
June 9, 20204 yr Hi, some of the hunting wagon code isn't mine to share (menu base) and its a very bad learning resource tbh so I do plan on rewriting it some day and releasing it. But I'm more than happy to share any of the specifics of the hunting wagon part. Looks like you had the wrong group hash, it should be 1754796591 (0x6898122F). Exact code I use: wagon_menu_prompt = UI::_UIPROMPT_REGISTER_BEGIN(); UI::_UIPROMPT_SET_CONTROL_ACTION(wagon_menu_prompt, GAMEPLAY::GET_HASH_KEY("INPUT_FRONTEND_LS")); UI::_UIPROMPT_SET_TEXT(wagon_menu_prompt, _CREATE_VAR_STRING(10, "LITERAL_STRING", "Hunting Wagon")); UI::_UIPROMPT_SET_PRIORITY(wagon_menu_prompt, 1); UI::_UIPROMPT_SET_TRANSPORT_MODE(wagon_menu_prompt, 0); UI::_UIPROMPT_SET_ATTRIBUTE(wagon_menu_prompt, 18, 1); UI::_UIPROMPT_SET_STANDARDIZED_HOLD_MODE(wagon_menu_prompt, 1704213876); UI::_UIPROMPT_REGISTER_END(wagon_menu_prompt); UI::_UIPROMPT_SET_ENABLED(wagon_menu_prompt, true); UI::_UIPROMPT_SET_VISIBLE(wagon_menu_prompt, true); UI::_UIPROMPT_SET_GROUP(wagon_menu_prompt, 1754796591, 0);
June 9, 20204 yr Author Thank you for sharing the source it really helped me! Also thank you HughJanus for your help with the issue, much appreciated! edit: I am wondering, how did you get the correct hash for the campfire? I tried multiple tools and websites, but with the no effect as you can see. Edited June 9, 20204 yr by bolmin
June 9, 20204 yr On 6/9/2020 at 3:58 PM, bolmin said: Thank you for sharing the source it really helped me! Also thank you HughJanus for your help with the issue, much appreciated! edit: I am wondering, how did you get the correct hash for the campfire? I tried multiple tools and websites, but with the no effect as you can see. Decompiled script https://github.com/stianhje/rdr3-decompiled-scripts.1232/blob/master/script_rel/interactive_campfire.c#L2654 https://github.com/gottfriedleibniz/GTA-V-Script-Decompiler
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.