This is a discussion on No Drama KO - releasing soon! within the Private Servers forums, part of the Knight Online (ko4life.com) category; Originally Posted by Prodigy™
really nick? is their such a thing as selective reading? lol
At this point it`s just ...
Page: 35
[ame=http://www.youtube.com/watch?v=MJKwNKrSOkA&feature=related]YouTube - It's Over 9000 Remix [[BEST SOUND QUALITY]]][/ame]
This server is gonna be some of the best servers that was ever.
i thought twostars was the best why take this long when noobs bring out servers that people flock to alot quicker.
Pew Pew Pew *spam*
Almost finished refactoring the scripting engine code, about ready to go through and implement the bindings for all classes (methods, properties) & global functions that scripts may ever need access to.
C++ test case app (working almost identically to the emulator, just without the actual loader sequence & relevant data)
AngelScript:Code:int main(int argc, char** argv) { // Load this from the relevant location in the real deal. For now, hardcoded. Test *test = NULL; int module_id = 12345; asDWORD return_result = 0, test_value = 12; string string_result; // initial init sScriptMgr.Init(); // ... yada yada yada, load stuff // bind our classes AS_REGISTER_CLASS(Test) AS_REGISTER_CLASS_OVERLOAD(Test,InstantiateWithString,string) AS_REGISTER_CLASS_PROPERTY(Test,m_test,int) AS_REGISTER_CLASS_METHOD(Test,PrintName,void,void) AS_REGISTER_CLASS_METHOD(Test,ChangeName,void,string) // add any global funcs (I clearly neglected this wrapper macro!) AS_REGISTER_FUNCTION("void print(const string &in)", print) // finally load our scripts sScriptMgr.LoadScripts(); // Let's see how well we interface! test = new Test("Instantiated within C++"); // Bit ugly, but it's not like it's used overly much.. and in keeping as concise as it is, it is actually quite neat (just... awkward syntactically) // Call function main() with args and retrieve a result AS_CALL_AR(module_id, main, test << "hi" << test_value, return_result); printf("main() returned %i\n", return_result); // Call function getTestResult() with args and retrieve a return value AS_CALL_AR(module_id, getTestResult, return_result, return_result); printf("getTestResult() returned %i\n", return_result); // Call function getResultNoArgs() without args, but retrieve a return value AS_CALL_R(12345 /* manually specified */, getResultNoArgs, string_result); printf("getResultNoArgs() returned %s\n", string_result.c_str()); // Call function doPrintStuff() without args, and without a return value AS_CALL(module_id, doPrintStuff); printf("Called doPrintStuff()\n"); test->PrintName(); test->Release(); system("pause"); return 0; }
Output:Code:int main(Test @obj, string test, int test2) { Test t("Instantiated within the script"); t.PrintName(); print("Test val = " + t.m_test + "\n"); print("Test - " + test + "\n"); obj.PrintName(); obj.ChangeName("Changed within the script"); return test2; } int getTestResult(int modifier) { return 1337 - modifier; } string getResultNoArgs() { return "Hi, I am a test string."; } void doPrintStuff() { print("Printing stuff, as requested!\n"); }
Call code's a liiiiiittle awkward, but neat in its own way.Code:Loaded module with ID #12345 Done loading scripts... [932700] Name is: Instantiated within the script Test val = 10 Test - hi [127610] Name is: Instantiated within C++ [127610] Changing name from Instantiated within C++ to Changed within the script main() returned 12 getTestResult() returned 1337 getResultNoArgs() returned Hi, I am a test string. Printing stuff, as requested! Called doPrintStuff() [127610] Name is: Changed within the script Press any key to continue . . .
Why am I pasting this? I don't know, but I guess I'm just saying that I'm still here, and still working on stuff. Mmmmmm. Scripted AI logic.
Last edited by twostars; 04-24-2011 at 09:29 PM. Reason: No scrited AI logicz, just scripted AI logicz kthx.
Bookmarks