Hi, sorry! boost.python didn't even get contact to Source.Pythons python instance. So I firstly tried to use the plain API.
Holy sh........ it works.
Time of life wasted: four hours.
Thank you...
Search found 21 matches
- Thu Oct 30, 2014 4:09 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
- Thu Oct 30, 2014 3:50 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
- Thu Oct 30, 2014 3:40 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
I call the init func. It doesn't work.
I also tried:
But it has no effect :/
I also tried:
Code: Select all
std::wstring x = Py_GetPath();
x += L";D:\\C++\\Source\\SrcDS\\games\\css\\cstrike\\addons\\sourcemod\\extensions";
Py_SetPath(x.c_str());
But it has no effect :/
- Thu Oct 30, 2014 3:32 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
- Thu Oct 30, 2014 3:01 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
Yes, works: http://img.r4nz.de/d2565.png
I guess the way is right that it doesn't lookup my dll for PyInit_pawnbridge, but adding it to sys.path doesn't seem the solution.
I guess the way is right that it doesn't lookup my dll for PyInit_pawnbridge, but adding it to sys.path doesn't seem the solution.
- Thu Oct 30, 2014 2:18 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
In co-work with your-name-here, I debugged a little bit. This is what comes out:http://img.unsuspicious.de/c5c33.png)
You see that this is definitely the same python instance running. Guess, it doesn't work either.
(bigger: You see that this is definitely the same python instance running. Guess, it doesn't work either.

- Thu Oct 30, 2014 1:48 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
- Thu Oct 30, 2014 1:38 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
- Thu Oct 30, 2014 1:32 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
Hi, this is out of the official documentation where they are saying "extending an embedded python". As for Python 2, you had to call the Py_Initialize() from extending libraries too. Even removing it, it does not change anything. Your code sample looks nearly the same as the code above. I am confuse...
- Thu Oct 30, 2014 12:21 pm
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
Your statement makes sense if considering the following sentence (same link as yours): and should be the only non-static item defined in the module file: PyMODINIT_FUNC PyInit_spam(void) { return PyModule_Create(&spammodule); } This is ok, since PyMODINIT_FUNC translates to an exporting function. Pr...
- Thu Oct 30, 2014 3:07 am
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
- Thu Oct 30, 2014 1:39 am
- Forum: General Discussion
- Topic: Extending via C++, adding a module throws exception
- Replies: 23
- Views: 32278
Extending via C++, adding a module throws exception
Hello, I'm trying to extend SP with a C++ addon. The following exception is thrown: sp load pbtest [SP] Loading plugin 'pbtest'... [SP] Caught an Exception: Traceback (most recent call last): File '..\addons\source-python\packages\source-python\plugins\manager.py', line 72, in __missing__ instance =...
- Mon Sep 16, 2013 7:11 am
- Forum: General Discussion
- Topic: Bot trying to login with my account
- Replies: 7
- Views: 2648545
Hello, it just came up again. Dear Chrisber, Someone has tried to log into your account on Source.Python with an incorrect password at least 5 times. This person has been prevented from attempting to login to your account for the next 15 minutes. The person trying to log into your account had the fo...
- Wed May 15, 2013 1:28 pm
- Forum: General Discussion
- Topic: Bot trying to login with my account
- Replies: 7
- Views: 2648545
Bot trying to login with my account
I received the following e-mail seconds ago: Dear Chrisber, Someone has tried to log into your account on Source.Python with an incorrect password at least 5 times. This person has been prevented from attempting to login to your account for the next 15 minutes. The person trying to log into your acc...
- Fri Jul 20, 2012 8:47 pm
- Forum: API Design
- Topic: Thinking of object orientation
- Replies: 3
- Views: 11041
- Fri Jul 20, 2012 7:24 am
- Forum: API Design
- Topic: Different execution contexts?
- Replies: 1
- Views: 7166
Different execution contexts?
Hello,
is Source.Python executing scripts currently in a seperated context? Or is it designed like EventScripts does this?
If it's not the case, do you ever thought aber doing this?
Chris
is Source.Python executing scripts currently in a seperated context? Or is it designed like EventScripts does this?
If it's not the case, do you ever thought aber doing this?
Chris
- Fri Jul 20, 2012 7:16 am
- Forum: API Design
- Topic: Thinking of object orientation
- Replies: 3
- Views: 11041
Thinking of object orientation
Hello everyone, I've seen that you are designing the core and the API. We all know how EventScripts worked - and of course we like it. But EventScripts was contaminated with the old EventScripts Shell language (this is not being ment negative). And now you have the chance to stop thinking of old beh...
- Fri Jul 20, 2012 7:08 am
- Forum: API Design
- Topic: Event system discussion
- Replies: 22
- Views: 88209
Which is good! ...and bad at the same time. This design speaks against the - more or less - strict typing of python. It is against its nature and that makes me think about to solve this. @ynh: I know it's a lot of work, but where's the problem to parse the resource files? I've did the same in Nativ...
- Fri Jul 20, 2012 7:02 am
- Forum: API Design
- Topic: Get/Set event variables
- Replies: 6
- Views: 22421
Well, object orientation is good. But why don't you allow a lot more intuitive design?
Syntax: Select all
def player_connect(ev):
ev["reason"] = ev["steamid"] + " left the game"
# or ev.reason / ev.steamid