Using Dll's

Making a mod? Looking for help with using Radiant? Everything mod or new-game related goes here.

Moderator: Monk

Using Dll's

Postby mrnoone » Mon Jan 18, 2010 9:34 pm

Hi, I'm new here and I have started making a game. I know that there is one way to make this use DLL's but how do I make it use them by default and not the .vm's? I searched for this and didn't find anything.
mrnoone
 
Posts: 2
Joined: Mon Jan 18, 2010 9:24 pm

Re: Using Dll's

Postby Monk » Tue Feb 02, 2010 1:48 pm

viewtopic.php?f=15&t=116

Last post there is about using DLLs instead of QVMs.
Monk
 
Posts: 275
Joined: Thu Aug 21, 2008 12:27 am

Re: Using Dll's

Postby mrnoone » Wed Jun 23, 2010 5:52 pm

It's been a while but, Isn't there a way to either make it use dll's by default? I want qvm's off entirly instead of having to set them off in a cfg. Either that or how do I create QVMs?
mrnoone
 
Posts: 2
Joined: Mon Jan 18, 2010 9:24 pm

Re: Using Dll's

Postby speaker » Thu Jun 24, 2010 7:23 am

mrnoone wrote:It's been a while but, Isn't there a way to either make it use dll's by default? I want qvm's off entirly instead of having to set them off in a cfg. Either that or how do I create QVMs?


In the file 'vm.c' (folder 'qcommon') there is a function called 'VM_Create' that is responsible for loading a DLL or a QVM module. This is the code fragment for DLLs:

Code: Select all
  if (interpret == VMI_NATIVE)
  {
    // try to load as a system dll
    Com_Printf("Loading dll file %s.\n", vm->name);
    vm->dllHandle =
      Sys_LoadDll(module, vm->fqpath, &vm->entryPoint, VM_DllSyscall);
    if (vm->dllHandle)
    {
      return vm;
    }

    Com_Printf("Failed to load dll, looking for qvm.\n");
    interpret = VMI_COMPILED;
  }


if you change the 'if' (interpret == VM_NATIVE)' statement to 'if (1)', then the function will always try to load a DLL and abort with an error if none is available.

Hope this helps.

Speaker
User avatar
speaker
 
Posts: 13
Joined: Sun Nov 23, 2008 9:26 am
Location: Szeged, Hungary


Return to Modifications, Total Conversions, New Games

Who is online

Users browsing this forum: No registered users and 1 guest

cron