Jobegiar99
Member
Hi!
I hope that this message finds you well . I created a DLL with c++ to implement A* into a project I'm developing. When I run the code in repl.it it works perfectly, but when I add the extension in Game Maker and call the function the game never runs, it runs if I remove all the other functions inside the function I'm calling.
Example that does not work when calling the dll and crashes the game:
Example that does work when calling the dll:
The error that I get on Game maker is the following:
X://windows/Runner.exe exited with non-zero status (-1073741819)
elapsed time 00:00:03.9759511s for command "C:\ProgramData/GameMakerStudio2/Cache/runtimes\runtime-2.3.2.426/bin/Igor.exe" -j=8 -options="C:\Users\berna\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 06/12/2021 14:42:50
"cmd" /c subst Z: /d
elapsed time 00:00:00.0247640s for command "cmd" /c subst Z: /d started at 06/12/2021 14:42:54
"cmd" /c subst Y: /d
elapsed time 00:00:00.0289235s for command "cmd" /c subst Y: /d started at 06/12/2021 14:42:54
"cmd" /c subst X: /d
elapsed time 00:00:00.0259305s for command "cmd" /c subst X: /d started at 06/12/2021 14:42:54
FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window.
Thanks for taking part of your time to try and help me! Or just to read this post!
I hope that this message finds you well . I created a DLL with c++ to implement A* into a project I'm developing. When I run the code in repl.it it works perfectly, but when I add the extension in Game Maker and call the function the game never runs, it runs if I remove all the other functions inside the function I'm calling.
Example that does not work when calling the dll and crashes the game:
C++:
GMEXPORT char* obtainNextMove(string matrixSTR, string playerPosSTR, string enemyPosSTR){
vector<vector<char>> matrix = stringToMatrix(matrixSTR);
Point goal = obtainPointInfo(playerPosSTR);
Point start = obtainPointInfo(enemyPosSTR);
Path* GoalPath = reverse( AStar(matrix, goal, start ) ) ;
if ( GoalPath ){
Point nextMovePoint = ( GoalPath ->previous != nullptr )
? GoalPath -> previous ->point
: GoalPath -> point;
string nextMoveString = to_string( (int) nextMovePoint.xPos ) + ";" + to_string( (int) nextMovePoint.yPos ) + "\0";
return (char*)nextMoveString.c_str();
}
return (char*) "No Path\0";
}
C++:
GMEXPORT char* obtainNextMove(string matrixSTR, string playerPosSTR, string enemyPosSTR){
return (char*) "No Path\0";
}
X://windows/Runner.exe exited with non-zero status (-1073741819)
elapsed time 00:00:03.9759511s for command "C:\ProgramData/GameMakerStudio2/Cache/runtimes\runtime-2.3.2.426/bin/Igor.exe" -j=8 -options="C:\Users\berna\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 06/12/2021 14:42:50
"cmd" /c subst Z: /d
elapsed time 00:00:00.0247640s for command "cmd" /c subst Z: /d started at 06/12/2021 14:42:54
"cmd" /c subst Y: /d
elapsed time 00:00:00.0289235s for command "cmd" /c subst Y: /d started at 06/12/2021 14:42:54
"cmd" /c subst X: /d
elapsed time 00:00:00.0259305s for command "cmd" /c subst X: /d started at 06/12/2021 14:42:54
FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window.
Thanks for taking part of your time to try and help me! Or just to read this post!