Does Squirrel have class destructors?
I think no.
Also can I make destructors using squirrel plugin?
I think Yes
Quote from: ysc3839 on Jun 22, 2016, 09:38 AMDoes Squirrel have class destructors?
No, Squirrel does not have any concept of destructors.
Quote from: ysc3839 on Jun 22, 2016, 10:08 AMAlso can I make destructors using squirrel plugin?
Yes, but not for script types. For your registered types.
Quote from: . on Jun 22, 2016, 10:57 AMQuote from: ysc3839 on Jun 22, 2016, 09:38 AMDoes Squirrel have class destructors?
No, Squirrel does not have any concept of destructors.
Quote from: ysc3839 on Jun 22, 2016, 10:08 AMAlso can I make destructors using squirrel plugin?
Yes, but not for script types. For your registered types.
Thanks. I want to know if I registered a class using plugin, can it support destructors?
Also, is there any sample code?
Register it how? With Sqrat the binding utility or manually through the provided API?
Quote from: . on Jun 22, 2016, 02:46 PMRegister it how? With Sqrat the binding utility or manually through the provided API?
Thanks. I'll see sqrat.
Solved.
Quote from: ysc3839 on Jun 22, 2016, 03:05 PMThanks. I'll see sqrat.
Solved.
Using Sqrat in modules for the official plugin could prove to be a bit difficult without compiling Squirrel into your module again (
must be same version). You might be able to trick Sqrat and use it without having to link your program to Squirrel.
Quote from: . on Jun 22, 2016, 03:22 PMQuote from: ysc3839 on Jun 22, 2016, 03:05 PMThanks. I'll see sqrat.
Solved.
Using Sqrat in modules for the official plugin could prove to be a bit difficult without compiling Squirrel into your module again (must be same version). You might be able to trick Sqrat and use it without having to link your program to Squirrel.
Thanks. I'm seeing 0.4 Socket.
Quote from: ysc3839 on Jun 22, 2016, 03:37 PMThanks. I'm seeing 0.4 Socket.
Well, that's because it compiles Squirrel again into the module. You should find the actual Squirrel source in there with the module. Which is not ideal. because you will end up having a VM that will receive memory allocations from both the main plugin and your module. Either way, you're in for some subtle crashes if you follow the same approach.
You could look at how I made Sqrat think that Squirrel is compiled into my modules here (https://github.com/iSLC/VCMP-SqMod/tree/master/shared). Although, it involved making some modifications to Sqrat (
regarding what headers it should include). Actually, I did a lot of other modifications to Sqrat as well. But that's ok since Sqrat is no longer updated. This (https://github.com/iSLC/VCMP-SqMod/blob/master/shared/SqMod.inl) is what should interest you. And this (https://github.com/iSLC/VCMP-SqMod/blob/master/shared/SqAPI.h).
Quote from: . on Jun 22, 2016, 03:50 PMQuote from: ysc3839 on Jun 22, 2016, 03:37 PMThanks. I'm seeing 0.4 Socket.
Well, that's because it compiles Squirrel again into the module. You should find the actual Squirrel source in there with the module. Which is not ideal. because you will end up having a VM that will receive memory allocations from both the main plugin and your module. Either way, you're in for some subtle crashes if you follow the same approach.
You could look at how I made Sqrat think that Squirrel is compiled into my modules here (https://github.com/iSLC/VCMP-SqMod/tree/master/shared). Although, it involved making some modifications to Sqrat (regarding what headers it should include). Actually, I did a lot of other modifications to Sqrat as well. But that's ok since Sqrat is no longer updated. This (https://github.com/iSLC/VCMP-SqMod/blob/master/shared/SqMod.inl) is what should interest you. And this (https://github.com/iSLC/VCMP-SqMod/blob/master/shared/SqAPI.h).
I don't know what you mean. 0.4 Socket source code don't include Squirrel. It uses main plugin's Squirrel VM.