Author Topic: AngelScript questions (not related to FOnline API)  (Read 9634 times)

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: AngelScript questions (not related to FOnline API)
« Reply #15 on: June 18, 2013, 03:30:43 pm »
I am using asGetActiveContext() function in my C++ code and I am trying to create DLL file, but I keep getting following error:
Code: [Select]
Creating library ./cam.lib and object ./cam.exp
cam.obj : error LNK2019: unresolved external symbol _asGetActiveContext referenced in function
"private: class asIScriptContext * __thiscall ScriptActionWrapper::PrepareContext(char *)" (?PrepareContext@ScriptActionWrapper@@AAEPAVasIScriptContext@@PAD@Z)
./cam.dll : fatal error LNK1120: 1 unresolved externals

When I compile it in Linux, I get no such an error. Does anyone have any clue, what could be the problem here and how to solve it?

Offline Berko

  • Tim Tom Ted
    • http://kabefis.deviantart.com/
Re: AngelScript questions (not related to FOnline API)
« Reply #16 on: June 18, 2013, 09:28:55 pm »
Not sure but I think you can't as we don't use library directly but engine do.
Use ScriptGetActiveContext(); instead, look to be a call to asGetActiveContext by engine that come from script (our dll).
I don't test it but it compile.

In our "script dll" we can use these things :
Code: [Select]
GameOptions * FOnline;
asIScriptEngine* ASEngine;
void ( * Log )( const char* frmt, ... );
asIScriptContext* ( *ScriptGetActiveContext )( );
const char* (ScriptGetLibraryOptions) ( );
const char* (ScriptGetLibraryVersion) ( );
2 angelscripts objects made by engine, 1 engine function and 2 angelscript functions wrapped by engine.
~~~ Ashes of Phoenix project --> http://fonline-aop.net/ ~~~

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: AngelScript questions (not related to FOnline API)
« Reply #17 on: June 19, 2013, 08:03:02 am »
Great, thanks, that solves the issue. :)

Re: AngelScript questions (not related to FOnline API)
« Reply #18 on: March 08, 2014, 06:36:17 pm »
I deleted a bunch of SDK maps and quests and now some of the scripts won't compile - debug & main. The issue is I don't know on which line do they fail to compile. How can I test it? I tried compiling them from Notepad++ but when I set -client of -mapper flags they fail with a lot of errors.

Offline Wipe

  • Rotator
  • Random is god
Re: AngelScript questions (not related to FOnline API)
« Reply #19 on: March 08, 2014, 06:52:32 pm »
These two are server scripts, so you shouldn't add -client or -mapper at all; without them, ASCompiler always assume that scripts is server-side.
Games are meant to be created, not played...

Re: AngelScript questions (not related to FOnline API)
« Reply #20 on: March 08, 2014, 09:30:00 pm »
I restored back everything I deleted. It's best to delete those later when I get more familiar with the engine.

Offline Wipe

  • Rotator
  • Random is god
Re: AngelScript questions (not related to FOnline API)
« Reply #21 on: March 09, 2014, 08:41:00 am »
Before removing module file from disk, i'd first disable it in scripts.cfg, by simply removing @ at the start of its line. That way you can always see if you didn't forgot to move some required function, or if other module isn't importing anything from it - import can be pain in the ass sometimes, especially that error message isn't helpful at all.
Games are meant to be created, not played...