bolmin 33 Posted May 24, 2020 Share Posted May 24, 2020 (edited) 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, 2020 by bolmin Quote Link to comment Share on other sites More sharing options...
LMS 674 Posted May 24, 2020 Share Posted May 24, 2020 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. Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted May 25, 2020 Author Share Posted May 25, 2020 thanks for the reply, I will try it out. Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted May 31, 2020 Author Share Posted May 31, 2020 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? Quote Link to comment Share on other sites More sharing options...
LMS 674 Posted May 31, 2020 Share Posted May 31, 2020 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. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 1, 2020 Share Posted June 1, 2020 Could you use the clear method names instead of the hashed names? Otherwise its difficult to read your code. Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 1, 2020 Author Share Posted June 1, 2020 I replaced the hashes with the clear names, sorry for not doing this in the original post Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 1, 2020 Share Posted June 1, 2020 (edited) 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, 2020 by HughJanus Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 1, 2020 Author Share Posted June 1, 2020 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 Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 2, 2020 Share Posted June 2, 2020 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 Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 2, 2020 Author Share Posted June 2, 2020 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 Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 3, 2020 Share Posted June 3, 2020 (edited) Can you post a code snippet with which you already got prompts to work? Edited June 3, 2020 by HughJanus Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 6, 2020 Author Share Posted June 6, 2020 the code that works is exactly the same but without GET_GROUP_ID and SET_GROUP. also sorry for late response. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 6, 2020 Share Posted June 6, 2020 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? Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 7, 2020 Author Share Posted June 7, 2020 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 Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 7, 2020 Share Posted June 7, 2020 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? Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 7, 2020 Author Share Posted June 7, 2020 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 . Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 8, 2020 Share Posted June 8, 2020 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. Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 8, 2020 Author Share Posted June 8, 2020 Thanks for reaching out to him. In the mod when you approach a campfire a prompt shows up to call the wagon Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted June 9, 2020 Share Posted June 9, 2020 Ah, I see. So seeing the code would indeed solve the problem. Quote Link to comment Share on other sites More sharing options...
ThreeSocks 15 Posted June 9, 2020 Share Posted June 9, 2020 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); 2 Quote Link to comment Share on other sites More sharing options...
bolmin 33 Posted June 9, 2020 Author Share Posted June 9, 2020 (edited) 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, 2020 by bolmin Quote Link to comment Share on other sites More sharing options...
ThreeSocks 15 Posted June 9, 2020 Share Posted June 9, 2020 1 hour ago, 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 Quote Link to comment Share on other sites More sharing options...
Sinonim 0 Posted June 10, 2023 Share Posted June 10, 2023 which libraries needs to this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.