Skip to content

Instantly share code, notes, and snippets.

View draobrehtom's full-sized avatar
😁
Suffering from idleness

Drao draobrehtom

😁
Suffering from idleness
View GitHub Profile

RedM MoveNetwork Research

Introduction

MoveNetwork natives in RedM are typically used to control specific scenarios that have multiple animation steps and involve interacting with items/objects in the world.

For example, MoveNetwork natives are used to control (portions of) the bathing sequence, campfire interaction, base game character creation char movement, and many of the minigame sequences found in the game.

They are also used in the safe-cracking minigame - this is the example we will be using in this documentation, as it relates to the vault itself.

Prompt Research

Note: The code examples below should work on RedM. On other frameworks, you may need to adjust some function names.

Creating prompts

To create a prompt, start with _UI_PROMPT_REGISTER_BEGIN (0x04F97DE45A519419), set up some settings, then finish with _UI_PROMPT_REGISTER_END (0xF7AA2696A22AD8B9). While there's a native to create prompts (_UI_PROMPT_CREATE (0x29FA7910726C3889)), there aren't many exemples around.

A prompt basically needs a control and a text. You can find a list of controls here Controls (femga/rdr3_discoveries). The text has to be created with VAR_STRING (0xFA925AC00EB830B9).

--[[
Copyright 2022 ZeroDream
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER