Welcome, Guest! Login | Register
3D Rad DLL functions...
Info
Report
87 Posts

I did some research and seems like 3D Rad uses as arguments an array of floats as arguments (ewwwww) .

Defining a function:

main.h
  
#ifndef __MAIN_H__
#define __MAIN_H__

#include <windows.h>
#include <fstream>
#include <stdlib.h>
#include <cstdint>

//Safe guards for the compiler, #pragma once works too, but I'm using a shitty GNU compiler and I'm not sure if this will work.
#ifdef BUILD_DLL
    #define DLL_EXPORT __declspec(dllexport)
#else
    #define DLL_EXPORT __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C"
{
#endif

void DLL_EXPORT MyFunction(float *args)

#ifdef __cplusplus
}
#endif

#endif // __MAIN_H__


  Remember, headers contain function prototypes, struct, typedefs definitions , and class definitions...

main.cpp :
#include "main.h"

void DLL_EXPORT MyFunction(float *args)
{
    args[3] = args[1] + args[2];
}
  Right now I'm trying to make the function above work, I will of course keep you updated.



Update 1: MyFunction() works fine for me, see the attachement.



Update 2: Templates and functions overloads don't work with the extern C thing, but they aren't needed in 3D Rad.
Created on: 1 month ago
Edited on: 1 month ago
Info
Report
252 Posts

@athanatos, I quickly added the {hr} tag. Are these horizontal lines any better?
Created on: 1 month ago
Info
Report
87 Posts

It's better now @PowerSupersport .
Created on: 1 month ago
Edited on: 1 month ago
Info
Report
87 Posts

Did anyone try running the project? Is it working?
Created on: 1 month ago
Info
Report
176 Posts

Quote from: Athanatos

Did anyone try running the project? Is it working?

did you upload a new build anywhere?
Created on: 1 month ago
Info
Report
87 Posts

I attached the first build into the first post.
Created on: 1 month ago
Info
Report
176 Posts

wait wait what am i supposed to test i'm dumb
Created on: 1 month ago
Info
Report
307 Posts

I tested @athanatos i got a 0 resesult
Created on: 1 month ago
Edited on: 1 month ago
Info
Report
87 Posts

Quote from: Time Stop Dev

wait wait what am i supposed to test i'm dumb

Download the archive and see the read me file.

Quote from: TinSoldier

I tested @athanatos i got a 0 resesult

Wait what? What do you mean? Did it work or not?
Created on: 1 month ago
Info
Report
133 Posts

@tinsoldier sure its in the right place? You'll get either -1 or 0 if it's not installed right.

@athanatos looks good here, I get exactly the right value (105)
Created on: 1 month ago
Info
Report
87 Posts

It's good then, let me make the MessageBox functions.
Created on: 1 month ago
Info
Report
307 Posts

@redneckbogan  we got it fixed, it works for me too.
Created on: 1 month ago
Info
Report
87 Posts

Created on: 4 weeks ago
Info
Report
87 Posts

New function: MSGBOX. Installation is the same. Copy the plugin into <3D Rad root>/3DRad_res/objects/Script/ and run the project.

Files attached, and a screenshot with the correct result attached

Github release: https://github.com/NicusorN5/3D_Rad_Extender_Lib/releases/tag/0.0.2
Created on: 4 weeks ago
Edited on: 4 weeks ago
Info
Report
133 Posts

Doesn't work for me, it doesn't attempt to load the DLL since it claims its missing. I've installed it into the right place as well
Created on: 3 weeks ago
Info
Report
307 Posts

worked for me, @redneckbogan did you save it to the right place ?
Created on: 3 weeks ago
Info
Report
87 Posts

@redneckbogan Try deleting the old file and adding the new one, since I know some persons that have a similar issue when replacing files in Windows.

@tinsoldier Was the message box right too? If yes then it's good.


On-topic

Anyway, new testing release, same steps, any changes are explained in the project. The needed files are attached.

Known issue: When the cursor hidding/showing isnt working for the second playtesting, BUT IT WORKED FOR THE FIRST TIME, restarting 3D Rad seems to fix this.

Github release: https://github.com/NicusorN5/3D_Rad_Extender_Lib/releases/tag/0.0.3
Created on: 3 weeks ago
Edited on: 3 weeks ago
Info
Report
307 Posts

@Athanatos yes the message box looked proper and closed when clicking ok
Created on: 3 weeks ago
Info
Report
87 Posts

Created on: 3 weeks ago
Info
Report
307 Posts

@athanatos

Am i daydreaming, but i had the thought, is it possible to re-create all 3drads current functions ( objects ) as loadable .DLL's that could replace 3drads objects but work better and have added functions.

In other words, creating a new 3drad inside 3drad all loaded as DLL(s)..

Does that make any sense as something of value worth doing or ??

[EDIT]
I tested the new DLL and all the projects, they seemed to work.

The one thing i missing is an easy return process.. what i mean is how would i test for a specific responce from the user if they pressed cancel or retry for instance ? , or do i need to figure out your scripting to add this myself if its there and i didnt see it ?

Also what is the text printed after clicking a box, it looks like key values to me ?

Also on the box with [Cancel] what keypress is supported there... it seems to be missing ?
Created on: 3 weeks ago
Edited on: 3 weeks ago
Info
Report
87 Posts

You can try recreating the 3D Rad object by making some complicated DirectX hooks and memory manipulations over 3D Rad (requires a lot of experience tho, and I don't have it. )

The testing for a response is kinda easy to implement btw since MessageBoxA() returns a 32-bit int.

The text is added for debug purposes, it contains the float array raw data used as the parameters in the dll.
Created on: 3 weeks ago
Info
Report
133 Posts

Appologies for taking so long to get back to you @athanatos, still no luck for me even after re-installing it. Happens with both the msgbox demo and the mouse cursor one but doesn't happen with the original test you put through.
Created on: 3 weeks ago
Info
Report
33 Posts

Quote from: TinSoldier

@athanatos

Am i daydreaming, but i had the thought, is it possible to re-create all 3drads current functions ( objects ) as loadable .DLL's that could replace 3drads objects but work better and have added functions.

In other words, creating a new 3drad inside 3drad all loaded as DLL(s)..

Does that make any sense as something of value worth doing or ??


I was thinking the same actually a while back, 3drad sits on top of the 3impact engine dll, so maybe we could have a intermediate dll to intercept the calls from 3drad and do some extra things. I think its possible to inspect the calls being made on the dll, if we can study that, I think it would make a great first step.

I don't have experience with c,c++ but its something I wanted to try, just to get around my annoyances with 3drad's instancing abilities somehow.
Created on: 2 weeks ago
Info
Report
133 Posts

@hawk Theoretically it's entirely possible to do that, provided you can correctly route any calls made by 3DRad to the 3Impact core structure if you aren't going to make any changes. IIRC this was how the PhysX engine was implemented on those v7 betas since those had the ODE engine on the v6 branch as well.

Practically, the best way I can see this working is exposing the 3Impact core, which can then be manipulated by scripts (aka. what @athanatos is doing with the class libraries).
Created on: 2 weeks ago
Info
Report
87 Posts

3D Rad can only use functions from libraries, not classes sadly.

Exposing 3Impact requires assembly and reverse engineering. (if you want to modify it and make cool changes)
Created on: 2 weeks ago
Edited on: 2 weeks ago
Reply
Preview
Post
Or use the advanced reply form here...
Sponsored