GameMonkey Script

GameMonkey Script Forums
It is currently Tue Oct 23, 2018 3:57 pm

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Thu May 21, 2009 9:26 am 
Offline

Joined: Sun Jul 29, 2007 11:52 am
Posts: 33
Location: Canberra, Australia
Yeah I'll agree. I integrated Python into the work engine and was required to implement unloading support - however, it will only unload modules that were loaded from an archive - that is ones that aren't put into the global table. Basically a script which defines the current world will be unloadable, as no other module should really be touching it anyway, it's not directly importable. Script code which is used to control behavoir is always loaded, so unloading is not a worry for it.

Regarding the changes I've made, you want me to just zip it all up and email it over? Give you a chance to look it over? I'm also currently putting support in to directly load modules too, where it adds a global _MODULES table, and will call a user callback which is responsible for loading in the module, hopefully I'll have that done in a few evenings time.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 21, 2009 9:46 am 
Offline

Joined: Thu Jan 01, 2004 4:31 pm
Posts: 307
I've been having to resist putting in namespaces/modules into my C# reimplementation of the GM machine. It makes a lot of sense to have stuff like this in.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 21, 2009 3:09 pm 
Offline

Joined: Fri Jan 14, 2005 2:28 am
Posts: 439
Sure you can zip it up and send it.

Richy2k, check out the latest revision of gm_ex and see if my version of module stuff is what you were thinking. I added a "import" in gmMachineLib.cpp that basically does what I've outlined, and has a function pointer callback so the user can provide the actual file loading functionality. Quick and dirty but it works.

downgraded, what benefit are you thinking namespaces would provide out of curiousity? I always figured that given the behavior of tables, they effectively acted as name spaces anyways, so there wasn't much use for them outside grouping related functions/variables in languages like lua, GM, etc.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 21, 2009 6:50 pm 
Offline

Joined: Sun Jul 29, 2007 11:52 am
Posts: 33
Location: Canberra, Australia
Looks good to me :-) I'll zip up what I've done and send it over. It's still WIP, but I've done the annoying lengthy part of the allocations, except for the GM_DELETE_ARRAY bit - 0 is the length substituted in for now until I figure out a clean way to do it - as it just calls delete[] at the moment underneath. I've fired it to your hotmail address.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2010 5:54 pm 
Offline

Joined: Tue Jul 27, 2010 5:52 pm
Posts: 5
I just used VC's preprocessor cl.exe.

Then I compiled the resultant .i files into .gmlibs.

works great.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2010 6:08 pm 
Offline

Joined: Fri Jan 14, 2005 2:28 am
Posts: 439
I think a MSVC style of #include could produce a lot of redundant code if used in a scripting languages, which I think is why the module and import concepts work the way that they do in scripting languages like lua
.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 28, 2010 9:56 pm 
Offline

Joined: Tue Jul 27, 2010 5:52 pm
Posts: 5
Maybe you are right. I'm not sure. I just needed something quick and dirty.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group