• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Problem with external functions

E

ECEngineering

Guest
I started working on a new game in GameMaker:Studio about 8 months ago and I was using the P3DC dll for 3d collision detection. After a couple of months I have paused the development of the game. A month ago I wanted to send the binary game file, along with the source code to one person so I compiled the game, tested the binary (It worked) and ziped it together with the source code so I could send it.

Now, one month later (today) I opened the project and tried to run it but as soon as the game starts, the error splashes telling me that there is an error in the external function (I was calling p3dc_init). I kept on clicking "ignore", so I can see which lines of code are problematic. After I went to see the code behind p3dc_init, I noticed that not all external code lines were reported in the error log, but only some of them. I tried restarting the computer and even reloading the latest working backup-source file (The one I ziped a month ago), but none of it helped. I know it is not my computer that is causing the problem because I can open the binary file from a month ago without getting any errors.

Since the last time I succesfully compiled the game (One month ago), there were few GM:S updates, so I figured that they might be the source of the problem.

If this means anything to you, these are the lines of code getting reported by the game (red ones):

n="P3DC_v6.0.1.dll";

//**Model Creation
global.p3dc_bdm = external_define(n,"bdm",dll_cdecl,ty_real,0);
global.p3dc_edm = external_define(n,"edm",dll_cdecl,ty_real,0);
global.p3dc_apm = external_define(n,"apm",dll_cdecl,ty_real,4,ty_string,ty_real,ty_real,ty_real);
global.p3dc_stm = external_define(n,"stm",dll_cdecl,ty_real,1,ty_real);
global.p3dc_brm = external_define(n,"brm",dll_cdecl,ty_real,1,ty_real);
global.p3dc_erm = external_define(n,"erm",dll_cdecl,ty_real,0);
global.p3dc_bs3 = external_define(n,"bs3",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_mat = external_define(n,"mat_exported",dll_cdecl,ty_real,9,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_apw = external_define(n,"apw",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_apf = external_define(n,"apf",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_apb = external_define(n,"apb",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_apc = external_define(n,"apc",dll_cdecl,ty_real,8,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_apo = external_define(n,"apo",dll_cdecl,ty_real,8,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);


//Overwrite
global.p3dc_obd = external_define(n,"obd",dll_cdecl,ty_real,2,ty_real,ty_real);
global.p3dc_oed = external_define(n,"oed",dll_cdecl,ty_real,0);
global.p3dc_opt = external_define(n,"opt",dll_cdecl,ty_real,9,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_opw = external_define(n,"opw",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_opf = external_define(n,"opf",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_opb = external_define(n,"opb",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_opc = external_define(n,"opc",dll_cdecl,ty_real,8,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_opo = external_define(n,"opo",dll_cdecl,ty_real,8,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);


//**Return Values
global.p3dc_gmn = external_define(n,"gmn",dll_cdecl,ty_real,0);
global.p3dc_gmt = external_define(n,"gmt",dll_cdecl,ty_real,1,ty_real);
global.p3dc_gms = external_define(n,"gms",dll_cdecl,ty_real,2,ty_real,ty_real);
global.p3dc_gtr = external_define(n,"gtr",dll_cdecl,ty_real,1,ty_real);
global.p3dc_gtm = external_define(n,"gtm",dll_cdecl,ty_real,0);

//**Collision Detection
global.p3dc_mcs = external_define(n,"mcs",dll_cdecl,ty_real,8,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_mcr = external_define(n,"mcr",dll_cdecl,ty_real,11,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);

global.p3dc_mc3 = external_define(n,"mc3",dll_cdecl,ty_real,4,ty_real,ty_real,ty_real,ty_real);
global.p3dc_mrs = external_define(n,"mrs",dll_cdecl,ty_real,10,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_mrf = external_define(n,"mrf",dll_cdecl,ty_real,7,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_mr3 = external_define(n,"mr3",dll_cdecl,ty_real,6,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);

global.p3dc_mrr = external_define(n,"mrr",dll_cdecl,ty_real,10,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real,ty_real);
global.p3dc_smr = external_define(n,"smr",dll_cdecl,ty_real,3,ty_real,ty_real,ty_real);

I hope that someone will be able to help. Thank you!
 

rIKmAN

Member
External define is the nasty way of using DLL's that I used to use. Had no end of issues with this, especially when making cross platform libraries.

It is much nicer, cleaner, and reccommended by YYG themselves, to import the DLL using the Extension system.

All of my extensions are now scriptless and the functions look and behave like they are native to GMS.

Give that a go. You'll never look back.
Hey wolff, I'm going to be looking at extensions in the next couple of weeks, are there any links you would recommend, anything else that would help or any other reading you would recommend other than these 3 links?

https://docs.yoyogames.com/source/dadiospice/001_advanced use/extensions/creating extensions.html
https://docs.yoyogames.com/source/dadiospice/001_advanced use/extensions/ios extensions.html
https://docs.yoyogames.com/source/dadiospice/001_advanced use/extensions/android extensions.html
 

ZAK!

Member
Is there still a fix to this? Using GMS 1.4.1757 and I'm also having this bug. Just inquiring. Thanks.

Also happens with ver 1.4.1763
 
Last edited:
C

cambalinho

Guest
i don't have sure, but it's similar with i had before.
so i have 1 question for you: the Target(Combo Box) have 'Windows' selection?
it's easy to change these without notice. is just a thot, but maybe it's your problem. because your game was working before.
and if you change the P3DC DLL version, please change, too, the scripts, because it can have a little diference.
 
Top