1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

GTA5 Plugin Help ? pleeeease :)

Discussion in 'SimTools Plugins' started by SilentChill, Feb 2, 2016.

  1. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Hi folks,

    I'm really struggling trying to make a plugin. I have all the information I need (I think) however I have no idea how to do it since I can't code :(

    I might be totally wrong with this anyways but maybe you guys can say if it can be done or not i'm sure it can someway as Force Dynamics have it working @value1 @yobuddy @prilad

    There is a mod you can add to GTA5 called ScriptHook5.NET so that you can pretty much modify anything and call up data that you need. Here is the post over at http://gtaforums.com/topic/789907-vrel-community-script-hook-v-net

    ----------------------------------------------------------------------------------------------------------------

    Community Script Hook V .NET

    You may remember the .NET ScriptHook back from GTAIV, it allowed using the easy to learn, but extremly powerful .NET languages to write scripts that can be executed ingame.

    About

    This ASI plugin for the just released Script Hook V attempts to recreate this experience for GTAV. It's full source code is hosted on Github, development is community-driven and open to everybody, so contributions are warmly welcomed.

    Right now it's able to load, compile and run .NET scripts and reload them while the game is running (press the "Insert" key). It also comes with a vast scripting API abstracting away the native function calls (you can still do those manually through "GTA.Native.Function.Call" though). Scripts are executed in a separate AppDomain, any exceptions thrown thus shouldn't affect the game or ScriptHook.

    Thanks a lot to Alexander Blade for Script Hook V and HazardX for the inspiration with his GTAIV .NET ScriptHook.

    Download Latest Binary Release
    Installation

    1. Install both the Microsoft .NET Framework 4.5.2 and the Visual C++ Redistributable Package for Visual Studio 2013 (x64) (or loading will fail).
    2. Download and install the latest Script Hook V (including the ASI loader).
    3. Download Community Script Hook V .NET and copy the ASI file into your game folder.
    4. Create (or download) a C#/VisualBasic code file (.cs, .vb) or compiled .NET assembly (.dll) inside the "scripts" folder in your game directory and start scripting!
    Contributing

    Important files:

    • source/core/Main.cpp: The main script entry point
    • source/core/ScriptDomain.cpp: .NET script manager. Loads, compiles and executes the scripts.
    • source/core/Script.hpp: Class from which all scripts have to inherit, handles the script main loop.
    • source/core/Native.cpp: Managed to native function call conversion.
    • source/core/NativeHashes.hpp: Native function hash enumeration.
    The remaining files in source/scripting implement the scripting API. Any help on improving that API is much appreciated.



    Documentation

    Either use notepad to edit source code scripts directly or use Visual Studio to compile them to assemblies. Going down the Visual Studio way has the advantage of syntax highlighting, code completion and Intellisense (since there is no API documentation yet). Just create a C# or VisualBasic class library project, add a reference to Script Hook V .NET (rename the ASI to DLL) in the project properties and you are ready to go.

    If something doesn't work, check the log file. It catches exceptions and gives you all the information to get to the bottom of the problem.

    -----------------------------------------------------------------------------------------------


    Now here below are the commands you can use in a script to get what you want and what I was thinking is that some of these could be exported somehow and used in simtools .

    upload_2016-2-2_18-41-59.png

    Am I barking up the wrong tree here or do you think this is doable ?

    Thanks in advance for your input if you have any :D


    I am still messing with CheatEngine trying to get some memory addresses but so far I think I have only found one which would be of no use for motion lol
    • Like Like x 1
  2. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    OK I'm getting somewhere now I have the hook for the Heading


    upload_2016-2-2_21-31-15.png


    upload_2016-2-2_21-30-57.png

    I know there is 1000000's of results but I know the location as my computer crashed just before I got to save the address :(

    I have no idea what to do with it yet but its progress :p



    edit: I have restarted game 3 times and its the correct address also it only changes when you ghet in a car which is a bonus I suppose :)
    • Like Like x 2
    Last edited: Feb 2, 2016
  3. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Okay I now have SPEED location no pointers its a static address :p

    upload_2016-2-2_22-6-28.png

    This is a slow and hard learning process :)
    • Like Like x 3
  4. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,162
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,207Coins
    Ratings:
    +2,168 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    You get this and you will be elevated to the rank of elite.....and then you can make us hundreds of other plugins....now.....so get busy.....quickly :grin
    • Agree Agree x 2
    • Like Like x 1
  5. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    @Historiker haha I have no idea what I'm doing really but I'm getting there .....hopefully, maybe, possibly.

    I had to give up last night after 4 hours I got just Heading(Yaw) and Speed.

    Tonight I will try my hardest to get Pitch and Roll.
    • Like Like x 1
    • Winner Winner x 1
  6. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,234
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    149,078Coins
    Ratings:
    +10,928 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Think of us all as a giant team cheering you on as you slave away @SilentChill, surely @value1 uses something like that or an obsession with puzzles to keep himself motivated to create and update plugins :grin
    • Like Like x 1
  7. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Haha @noorbeast at least @value1 knows what he's doing, unless he's been bluffing this whole time :p

    I've gone begging on gtaforums to see if someone can make a script to show all the accelerometers and Roll/pitch displayed on the game screen . Simple if you know how. It will make it easy then to get the right memory addresses ;)
    • Like Like x 3
  8. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I have found 3 more addresses but they arent stable the keep jumping to negative values and back to the correct ones, I am struggling lol

    upload_2016-2-3_21-1-3.png


    Enough for tonight tho will have to try again tomorrow
    • Like Like x 4
  9. Pedro Pablo

    Pedro Pablo Active Member

    Joined:
    Dec 7, 2015
    Messages:
    119
    Occupation:
    Software Developer
    Location:
    Valparaiso, Chile
    Balance:
    599Coins
    Ratings:
    +47 / 0 / -0
  10. Pedro Pablo

    Pedro Pablo Active Member

    Joined:
    Dec 7, 2015
    Messages:
    119
    Occupation:
    Software Developer
    Location:
    Valparaiso, Chile
    Balance:
    599Coins
    Ratings:
    +47 / 0 / -0
  11. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF

    I have got a mod for showing coords and stuff and changed it to get all the rotation values and vectors and also velocities. Problem is none of the velocity values are any good they go negative and positive with in the 360 degree heading. The rotation values I cannot find the base memory addresses I can find the value in CheatEngine but the value changes to something completely different before I can find the correct address.
  12. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,842Coins
    Ratings:
    +3,325 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    To convert the speed values from world coordinate system into local coordinate system, you must find the transformation matrix, a 3×3 matrix.
    To find stable values for rotation, you must find the pointers to the rotation memory location. There are a few examples in the forum for other simulations.
    • Informative Informative x 2
  13. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    There is an entity matrix which should supply the correct values, I will have to write a little C# script and try and display them, i think i'm kinda getting my head around this.

    I have found all sorts of values apart from forces and the rotation angles which unfortunately are what I need.

    Would post a picture but im at work will update with one later
    • Like Like x 3
  14. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,842Coins
    Ratings:
    +3,325 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    You can calculate the Euler angles (pitch, roll and yaw) from the unity matrix :thumbs
    • Agree Agree x 1
    • Informative Informative x 1
  15. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Calcualte ??? Euler ??? WTF is that lolol will it not just give me numbers automatically ;) best dust my calculator off :D

    I will find them then I will let you do the math @value1 how does that sound :thumbs
  16. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,842Coins
    Ratings:
    +3,325 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    Typically pitch, roll and yaw are calculated from the unit vectors like
    Code:
    Pitch_MemHook = Atan2(Vector.Fy, Vector.Uy)
    Roll_MemHook = Asin(Vector.Ry)
    Yaw_MemHook = -Atan2(Vector.Rx, Vector.Rz)
    Depending on the coordinate/transformation matrix, the math varies.

    Surge, sway and heave are transformed from world to local coordinates like
    Code:
    Surge_MemHook = -(ax * Vector.Fx + ay * Vector.Fy + az * Vector.Fz)
    Sway_MemHook = -(ax * Vector.Rx + ay * Vector.Ry + az * Vector.Rz)
    Heave_MemHook = ax * Vector.Ux + ay * Vector.Uy + az * Vector.Uz
    Find stable pointers for speed/accelerations and to the transformation matrix and I can help you further (if I find the time ;) )
    • Informative Informative x 3
  17. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,562Coins
    Ratings:
    +3,489 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Wowzers lol . There's me just thinking some numbers going up and down would do lol

    Hopefully I will have a breakthrough soon ;)
    • Funny Funny x 2
    • Optimistic Optimistic x 1