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

HookEntityOutput OnStartTouch - Get the actual output?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-06-2014 , 03:17   HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #1

PHP Code:
public HookTrigger_OnStartTouch(const String:sOutput[], iSelfiCallerFloat:flDelay)
{
    
decl String:sKeyInfo[256]; // !activator,SetFogController,fog_sewer,0,-1
    
GetEntPropString(iSelfProp_Data"m_OnStartTouch"sKeyInfosizeof(sKeyInfo));

#if defined DEBUG
    
LogMessage("trigger_multiple: %s"sKeyInfo);
#endif

    
if (StrContains(sKeyInfo"SetFogController") != STRING_NOT_FOUND
    {
        
// Block the change
    
}

    return;

Stack error because m_OnStartTouch isn't actually a string.

How can I get the contents of its "keyvalue" like I see when entspying it?



sOutput will only ever tell me "OnStartTouch" which is useless.
__________________

Last edited by Chdata; 02-06-2014 at 03:19.
Chdata is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 02-06-2014 , 06:00   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #2

You might want to get string of AddOutput or FireUser1 somehow.
Code:
decl String:output[32]; // Add output to kill itself when time is expired Format(output, sizeof(output), "OnUser1 !self:kill::%0.2f:-1", GetConVar[ItemLifeTime][Value]); // Set a string in the global variant object and properly add output to make it work SetVariantString(output); AcceptEntityInput(item, "AddOutput"); AcceptEntityInput(item, "FireUser1");
Or better retrieve the hammer id.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-06-2014 , 07:04   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #3

I dunno if hammer id would work for making this change work for any map arbitrarily.

Or I'm not understanding your suggestion completely ;o
__________________

Last edited by Chdata; 02-06-2014 at 07:23.
Chdata is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 02-06-2014 , 08:24   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #4

I ain't so great when I come to these complex things, but wouldn't that be a data array?

I would imagine you have to check each offset of "m_OnStartTouch", specifying the correct data type for each.
CoolJosh3k is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-06-2014 , 11:23   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #5

I don't think it's currently possible to read the Output-chain of an entity. The only way is probably to use SDKHooks, it has something like an OnLevelInit-hook where the whole KeyValue file from the map is passed.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-06-2014 , 18:49   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #6

Is there perhaps another method I could use to stop trigger_multiple from changing the env_fog_controller, when I have a custom spawned fog controller set to a player?

On any map.

I'm not sure if I can even tell what fog the player is set to aside from what I can track in my plugin whenever I manually change it.

So if a trigger_multiple changes it, that's not a change by my plugin so I wouldn't be able to do something like, if currentfog != mysetfog.
__________________

Last edited by Chdata; 02-06-2014 at 18:52.
Chdata is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-06-2014 , 19:56   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #7

Quote:
Originally Posted by Chdata View Post
PHP Code:
public HookTrigger_OnStartTouch(const String:sOutput[], iSelfiCallerFloat:flDelay)
{
    
decl String:sKeyInfo[256]; // !activator,SetFogController,fog_sewer,0,-1
    
GetEntPropString(iSelfProp_Data"m_OnStartTouch"sKeyInfosizeof(sKeyInfo));

#if defined DEBUG
    
LogMessage("trigger_multiple: %s"sKeyInfo);
#endif

    
if (StrContains(sKeyInfo"SetFogController") != STRING_NOT_FOUND
    {
        
// Block the change
    
}

    return;

Stack error because m_OnStartTouch isn't actually a string.

How can I get the contents of its "keyvalue" like I see when entspying it?



sOutput will only ever tell me "OnStartTouch" which is useless.
SourceMod still doesn't have support for reading CUtlVectors, which this presumably is when loaded on the server.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-06-2014 at 19:57.
Powerlord is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 09-13-2017 , 13:27   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #8

Any progress on this? or do we have to use https://sm.alliedmods.net/new-api/sdkhooks/OnLevelInit ?
__________________
ImACow is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 09-13-2017 , 18:00   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #9

Quote:
Originally Posted by Chdata View Post
Is there perhaps another method I could use to stop trigger_multiple from changing the env_fog_controller, when I have a custom spawned fog controller set to a player?

On any map.

I'm not sure if I can even tell what fog the player is set to aside from what I can track in my plugin whenever I manually change it.

So if a trigger_multiple changes it, that's not a change by my plugin so I wouldn't be able to do something like, if currentfog != mysetfog.
Disable the trigger so it doesn't report touch

Disable touch

or ReFire the fog settings
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 09-14-2017 , 12:46   Re: HookEntityOutput OnStartTouch - Get the actual output?
Reply With Quote #10

On second thought: https://sm.alliedmods.net/new-api/sdkhooks/OnLevelInit doesn't seem to trigger in CSGO
__________________
ImACow 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 22:37.


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