Search found 20 matches

by inf
Wed Jan 03, 2018 8:19 pm
Forum: Plugin Development Support
Topic: Getting player properties slow?
Replies: 9
Views: 6689

Re: Getting player properties slow?

Ayuto wrote:EntityIter, PlayerIter, Entity and Player are the classes we really need be speed up.

If you show me your listener, I might can give you a few more hints.


That's ok, I think I've got the performance to an acceptable point, thanks for the help!
by inf
Wed Jan 03, 2018 6:30 pm
Forum: Plugin Development Support
Topic: Getting player properties slow?
Replies: 9
Views: 6689

Re: Getting player properties slow?

Thanks for this!

Is there anything else that's known to be slow that I should avoid in OnTick?
by inf
Wed Jan 03, 2018 5:38 am
Forum: Plugin Development Support
Topic: Getting player properties slow?
Replies: 9
Views: 6689

Re: Getting player properties slow?

player_info = client.player.playerinfo origin = player_info.origin eye_loc = Vector(origin.x, origin.y, origin.z + 64) angle = player_info.angles velocity = player.velocity After more testing I found even implementing this way is much faster, but still a bit sluggish :/. Any other suggestio...
by inf
Wed Jan 03, 2018 12:11 am
Forum: Plugin Development Support
Topic: Getting player properties slow?
Replies: 9
Views: 6689

Getting player properties slow?

I have an OnTick listener which gets each player's origin, eye_location, view_angle, and velocity every tick. I've been dealing with performance issues with my plugin which get worse with every active player. I did a test with python's time module (on windows): start_time = time.clock() play...
by inf
Wed Dec 06, 2017 9:56 pm
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 19
Views: 20917

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

There is no outdated structure. It's just that CBotCmd and CUserCmd are different on CS:GO, but that doesn't matter, because you don't need them. You can use the bot controller to set the values. Ok, I see. Either way setting angles with a bot controller didn't work so I'll just force the angles on...
by inf
Wed Dec 06, 2017 6:32 pm
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 19
Views: 20917

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

The serverplugin_empty example contains an example on how to controll bots: https://github.com/alliedmodders/hl2sdk/blob/css/utils/serverplugin_sample/serverplugin_bot.cpp Basically, you just retrieve the bot controller and use it to set the bot's movement in an OnTick listener. I have tried this, ...
by inf
Wed Dec 06, 2017 5:17 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 19
Views: 20917

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

Did you try player.teleport(angles=your_angles) or simply player.set_view_angles(your_angles)? Yes teleporting every frame does work, delayed by one tick to prevent the server from crashing, but the bots movement is quite choppy. In SM implementations of what I'm trying to achieve such as this http...
by inf
Wed Dec 06, 2017 4:16 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 19
Views: 20917

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

The difference between UserCmd and BotCmd should not matter here because they are used for different functions. OnPlayerRunCommand is correct to returns a UserCmd even for bots because this is what the original hooked method is called with. You could try any of the following, I guess: from players....
by inf
Tue Dec 05, 2017 9:10 pm
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 19
Views: 20917

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

L'In20Cible wrote:

Syntax: Select all

player.angles = Vector(my_val_x, my_val_y, 0.0)
Doesn't works?


Does not seem to work... Working through this issue with iPlayer and I've been told about the differences between user_cmd and bot_cmd.

I'm wondering about players.bots.BotController, how would I obtain an instance of this?
by inf
Tue Dec 05, 2017 8:25 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 19
Views: 20917

Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

I'm having trouble setting user_cmd.view_angles in an OnPlayerRunCommand listener. I've tried both @OnPlayerRunCommand def run_cmd(player, user_cmd): user_cmd.view_angles.x = my_val_x user_cmd.view_angles.y = my_val_y and @OnPlayerRunCommand def run_cmd(player, user_cmd): user_cmd.vi...
by inf
Thu Nov 23, 2017 9:12 pm
Forum: Plugin Development Support
Topic: Forcing a user cmd on a player at any time?
Replies: 3
Views: 3383

Re: Forcing a user cmd on a player at any time?

I now see that OnPlayerRunCommand calls even if the player isn't moving. I guess this could work, unless someone has a better solution.
by inf
Thu Nov 23, 2017 9:07 pm
Forum: Plugin Development Support
Topic: Forcing a user cmd on a player at any time?
Replies: 3
Views: 3383

Forcing a user cmd on a player at any time?

How would I go about forcing a user cmd on a player? For example to force a player to +jump. I know you can change the buttons in a user_cmd in an OnPlayerRunCommand listener to force a player to press a button but how about at any given time?
by inf
Thu Nov 23, 2017 5:29 am
Forum: Plugin Development Support
Topic: Coding with VS Code
Replies: 3
Views: 3745

Re: Coding with VS Code

Create a venv and set your python path to its binary. Drag all the source-python packages to your lib/site-packages folder in the venv. This is how I got intellisense and pylint to work.
by inf
Fri Sep 01, 2017 6:27 am
Forum: Plugin Development Support
Topic: Hiding radar in csgo?
Replies: 5
Views: 4678

Re: Hiding radar in csgo?

L'In20Cible wrote:This is why. You are using PreEvent and that flag is reset when the players are spawning. Use a regular @Event.


This works, thanks!
by inf
Fri Sep 01, 2017 4:40 am
Forum: Plugin Development Support
Topic: Hiding radar in csgo?
Replies: 5
Views: 4678

Re: Hiding radar in csgo?

@PreEvent('player_spawn') def _player_spawn(game_event): client = client_manager.find_by_entity_index(index_from_userid(game_event.get_int('userid'))) if client is None: return EventAction.CONTINUE client.reset() client.player.set_godm...
by inf
Fri Sep 01, 2017 2:43 am
Forum: Plugin Development Support
Topic: Hiding radar in csgo?
Replies: 5
Views: 4678

Hiding radar in csgo?

Is this still possible to do?

Syntax: Select all

player.hidden_huds = HideHudFlags.RADAR

# and
player.hidden_huds = player.hidden_huds | HideHudFlags.RADAR


Don't seem to work.
by inf
Fri Aug 25, 2017 4:13 pm
Forum: Plugin Development Support
Topic: Installing Source.Python with pip on linux
Replies: 4
Views: 3707

Re: Installing Source.Python with pip on linux

I use vscode, what I did to get the autocompletions to work was set up a venv and copy the source.python modules to lib/site-packages. This worked for me, not sure how vim works.
by inf
Thu Aug 24, 2017 5:31 pm
Forum: Plugin Development Support
Topic: Calling virtual function CBaseTrigger::IsTouching?
Replies: 7
Views: 7029

Re: Calling virtual function CBaseTrigger::IsTouching?

If you still want to call a virtual function, this might help you. http://wiki.sourcepython.com/developing/module_tutorials/memory.html#calling-a-virtual-function Edit: What game/os btw. (sp info)? CSGO, hoping to support windows and linux. I think iPlayer's solution will work fine as long as I use...
by inf
Wed Aug 23, 2017 9:54 pm
Forum: Plugin Development Support
Topic: Calling virtual function CBaseTrigger::IsTouching?
Replies: 7
Views: 7029

Calling virtual function CBaseTrigger::IsTouching?

I wish to call this function: https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/server/triggers.cpp#L539 . I know it is possible to call virtual functions with the memory module, but I am unsure where to find the offsets for this particular function, as well as how to use the ...

Go to advanced search