View Single Post
Solokiller
Senior Member
Join Date: Sep 2015
Old 11-23-2016 , 14:15   Re: AngelScript Mod Loader
Reply With Quote #3

Pawn declarations don't really work with Angelscript. Angelscript is very similar to C++, but API functionality is provided automatically, not in a header that has to be included. It is possible to provide the same natives and forwards, but due to the cell based approach any C++ code will need to be wrapped by Pawn's cell functions, whereas Angelscript can access it directly.
Angelscript's C++ code is just that, C++ code. Angelscript scripts pass in data types that were registered by the program, and the native type is used by C++ code to communicate.

Then there's the need to map IDs in Pawn to the objects they represent. If the ID isn't just the memory address then you'll need lookup tables, and since Angelscript uses reference counting for reference types it'll complicate matters.

Functionality wise i can provide natives and forwards as long as it only concerns the engine API and new Metamod features (Steamworks API callbacks, etc). Game specific code is off limits because i'd have to get the addresses for every function every time they release an update, and the functions would need to be unoptimized so function arguments are passed on the stack. Otherwise you end up calling a function that is optimized to pass arguments through registers.

Once you factor in cross-platform support it really gets nuts. I know that there are AMX plugins that do this (Orpheus?) so it is possible, but beyond what i can provide, at least on short notice. I'm sure the functionality provided by Orpheus can be used by this too though, but it'll take some doing.
Solokiller is offline