Raised This Month: $32 Target: $400
 8% 

GetClientEyeAngles() returns false and does not store any data (Portal Modding)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FixingLime
New Member
Join Date: Jul 2021
Old 07-29-2021 , 18:20   GetClientEyeAngles() returns false and does not store any data (Portal Modding)
Reply With Quote #1

Hello everyone. I don't know if this place is active or not, but I thought I'd give it a try and make my first post. I'm attempting to make a simple SourceMod plugin for Portal that outputs the look direction of the player to a file in real-time. However, when I use the GetClientEyeAngles() function to store the look direction, the function returns false and doesn't store any data. Here is my code:

Code:
#include <sourcemod>
#include <sdktools>
 
public Plugin myinfo = {
	name = "Portal Plugin",
	author = "Me",
	description = "Portal Plugin",
	version = "1.0",
};

public void OnGameFrame() {	
	new Float:eyeAng[3];
	
	if (!GetClientEyeAngles(1, eyeAng)) {
	PrintToChat(1, "Failed");
	}
	
	PrintToChat(1,"Look Angle: %f, %f, %f", eyeAng[0], eyeAng[1], eyeAng[2]);
		
}
As you can see, I attempt to call this function every game frame. I then create a float vector for the data to be stored in and try to call the function. I print "Failed" to the chat if the function returns false, which according to the documentation at https://sourcemod.dev/#/sdktools_fun...lientEyeAngles means that the function failed in some way. I also attempt to print the values stored in eyeAng to the chat, which should show the result of GetClientEyeAngles() but instead displays nothing but 0 for each value.
I'm not sure exactly why this function is failing. There don't seem to be any errors or compiling issues and after reading the documentation, I believe I'm using the function properly. Any help with this issue? Thanks a lot!
FixingLime is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 07-29-2021 , 18:39   Re: GetClientEyeAngles() returns false and does not store any data (Portal Modding)
Reply With Quote #2

Does portal even have dedicated servers? I thought the first game was single player? If so then sourcemod would have to be installed on your game client and then you run into issues like this as it's not supported to run on the game client itself. You might want to lean towards writing a "valve server plugin" in c++, but this would require decent knowledge of reverse engineering and source engine.
backwards is offline
FixingLime
New Member
Join Date: Jul 2021
Old 07-29-2021 , 18:46   Re: GetClientEyeAngles() returns false and does not store any data (Portal Modding)
Reply With Quote #3

Ah okay, I guess I glossed over the fact that SourceMod was intended for dedicated servers only. I assumed that since Portal had some sort of local client-server interactions it could work, but it makes sense that SourceMod isn't the correct tool for my applications. Thanks for the info and I'll check out some other options like the Valve plugin.
FixingLime is offline
Reply


Thread Tools
Display Modes

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 15:21.


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