Raised This Month: $51 Target: $400
 12% 

Viper


Post New Thread Reply   
 
Thread Tools Display Modes
theY4Kman
Join Date: Jun 2007
Location: Yak
Old 03-17-2010 , 20:00   Re: [EXTENSION] Viper
Reply With Quote #21

Quote:
Originally Posted by recon0 View Post
Just wondering: Where do you set the module search path?
PluginSys.cpp, lines 249 to 281:

Code:
/* Clear sys.path and add the plug-in's folder, as well as Python's libs */ char *path_string = new char[PLATFORM_MAX_PATH]; size_t len = strrchr(m_sPath, '/') - m_sPath; strncpy(path_string, m_sPath, len); path_string[len] = '\0'; PyObject *newpath = PyList_New(5); PyList_SetItem(newpath, 0, PyString_FromString(path_string)); g_pSM->BuildPath(SourceMod::Path_SM, path_string, PLATFORM_MAX_PATH, "extensions/viper/lib"); /* Let's keep the folder separators consistent */ StrReplace(path_string, "\\", "/", PLATFORM_MAX_PATH); PyList_SetItem(newpath, 1, PyString_FromString(path_string)); PyList_SetItem(newpath, 2, PyString_FromFormat("%s/lib-dynload", path_string)); PyList_SetItem(newpath, 3, PyString_FromFormat("%s/site-packages", path_string)); #ifdef WIN32 g_pSM->BuildPath(SourceMod::Path_SM, path_string, PLATFORM_MAX_PATH,     "extensions/viper/lib/plat-win"); #else g_pSM->BuildPath(SourceMod::Path_SM, path_string, PLATFORM_MAX_PATH,     "extensions/viper/lib/plat-linux2"); #endif StrReplace(path_string, "\\", "/", PLATFORM_MAX_PATH); PyList_SetItem(newpath, 4, PyString_FromString(path_string)); delete [] path_string; // SetObject increases the refcnt by one PySys_SetObject("path", newpath); Py_DECREF(newpath);

So, the module path ends up being:
  1. '/path/to/plugin'
  2. '/sourcemod/extensions/viper/lib'
  3. '/sourcemod/extensions/viper/lib/lib-dynload'
  4. '/sourcemod/extensions/viper/lib/site-packages'
  5. '/sourcemod/extensions/viper/lib/plat-linux2' or '/sourcemod/extensions/viper/lib/plat-win'
__________________
http://y4kstudios.com
Is that loud enough? Oh, while I have you, check out Viper.
theY4Kman is offline
Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 03-18-2010 , 03:13   Re: [EXTENSION] Viper
Reply With Quote #22

Thanks y4k
__________________
recon0 is offline
ANTiCHRiST
Member
Join Date: Mar 2009
Location: Vienna, Austria
Old 04-05-2010 , 20:14   Re: [EXTENSION] Viper
Reply With Quote #23

what everything can done by this port of python?
__________________
ANTiCHRiST is offline
Send a message via ICQ to ANTiCHRiST Send a message via MSN to ANTiCHRiST
theY4Kman
Join Date: Jun 2007
Location: Yak
Old 04-05-2010 , 20:37   Re: [EXTENSION] Viper
Reply With Quote #24

I have the API documentation up at http://y4kstudios.com/sourcemod/viper/docs/, but so far you can do everything that doesn't require usermessages, menus, or SDKTools. So an IRC Relay, messing with entity net props, etc. It's not quite up to feature parity with SourceMod, but it's getting there.
__________________
http://y4kstudios.com
Is that loud enough? Oh, while I have you, check out Viper.
theY4Kman is offline
Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
shizam
New Member
Join Date: May 2010
Old 05-15-2010 , 21:58   Re: [EXTENSION] Viper
Reply With Quote #25

The server crashes when the server has eventscripts with this.
shizam is offline
theY4Kman
Join Date: Jun 2007
Location: Yak
Old 05-16-2010 , 00:11   Re: [EXTENSION] Viper
Reply With Quote #26

What engine/mod are you using? I've tested EventScripts and Viper on the Orange Box and Episode 1 engine (TF2 and CS:S).
__________________
http://y4kstudios.com
Is that loud enough? Oh, while I have you, check out Viper.
theY4Kman is offline
Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
shizam
New Member
Join Date: May 2010
Old 05-20-2010 , 00:59   Re: [EXTENSION] Viper
Reply With Quote #27

I tried it on HL2DM. it crashes whenever the level changes. A "Assertion Failed: CWorkThreadPool::StopWorkThreads: Some threads required forcible termination." message shows up before it crashes with a memory could not be read error.
shizam is offline
Menace.
Junior Member
Join Date: Jun 2010
Old 06-08-2010 , 09:33   Re: [EXTENSION] Viper
Reply With Quote #28

Quote:
Originally Posted by theY4Kman View Post
What engine/mod are you using? I've tested EventScripts and Viper on the Orange Box and Episode 1 engine (TF2 and CS:S).
Can you make an example for popup and messages to send ? I'm writing scripts at all in Eventscripts Python now ...
Menace. is offline
theY4Kman
Join Date: Jun 2007
Location: Yak
Old 06-08-2010 , 10:15   Re: [EXTENSION] Viper
Reply With Quote #29

Quote:
Originally Posted by shizam View Post
I tried it on HL2DM. it crashes whenever the level changes. A "Assertion Failed: CWorkThreadPool::StopWorkThreads: Some threads required forcible termination." message shows up before it crashes with a memory could not be read error.
Ah, I can understand why that error sounds reasonable. I'd have to test around in the same environment to fix it, which I shall add to the todo list ;)


Quote:
Originally Posted by Menace. View Post
Can you make an example for popup and messages to send ? I'm writing scripts at all in Eventscripts Python now ...
Unfortunately, I have not written those libraries for Viper, yet (you're referring to SourceMod's menus and usermessages libraries, I assume). They're on their way, though.
__________________
http://y4kstudios.com
Is that loud enough? Oh, while I have you, check out Viper.
theY4Kman is offline
Send a message via ICQ to theY4Kman Send a message via AIM to theY4Kman Send a message via MSN to theY4Kman Send a message via Yahoo to theY4Kman Send a message via Skype™ to theY4Kman
alinayg
Senior Member
Join Date: Apr 2009
Location: USA, RI
Old 06-11-2010 , 21:46   Re: [EXTENSION] Viper
Reply With Quote #30

Has anything been made using your Viper Extension yak?
__________________
alinayg is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode