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

[EXTENSION] Output Info


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 02-16-2018 , 13:37   [EXTENSION] Output Info
Reply With Quote #1

Original extension by BotoX: https://gogs.botox.bz/CSSZombieEscape/sm-ext-outputinfo
Almost all credits to him.

The original extension would let you get info about entity output actions, but was kind of limited in that it only let you read them without modifying them in any way, so I added functionality to also let you set those values.

I also added Insert/RemoveOutputAction, but these 2 natives currently only work on CS:GO on windows. This is because they need a bit of gamedata to achieve without leaking any memory. Getting the gamedata was bad enough with all of the inlining on windows, and I can't test it on linux.
Feel free to contribute by adding gamedata for other games/systems or suggesting a method of doing this without using any gamedata. Other than those 2 natives, the extension should work on any game

What are entity output actions?

^ Basically this stuff

Fields:
"OnTrigger" - The output
"!activator" - The target, in this context means apply this action to activator
"AddOutput" - Target input, what action to call
"gravity -0.5" - Parameter, value passed into 'AddOutput'
"0.00" - Delay in seconds before applying this action
"No" - Times to fire, in this context 'No' means fire indefinitely

Example plugin:
Here's a simple example plugin that modifies trigger_multiples that set your gravity to 1 so that they instead set your gravity to 0.5
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <outputinfo>

public void OnPluginStart()
{
    
HookEvent"round_start"Event_RoundStartPost );
}

public 
void Event_RoundStartPostEvent event, const char[] namebool dontBroadcast )
{
    
// loops through all trigger_multiple and change any 'gravity 1' parameters into 'gravity 0.5'
    
int ent = -1;
    while( ( 
ent FindEntityByClassnameent"trigger_multiple" ) ) != -)
    {
        
int count GetOutputActionCountent"m_OnTrigger" );
        for( 
int i 0counti++ )
        {
            
char buffer[32];
            
GetOutputActionParameterent"m_OnTrigger"ibuffersizeofbuffer ) );
            
            if( 
StrEqualbuffer"gravity 1" ) )
            {
                
SetOutputActionParameterent"m_OnTrigger"i"gravity 0.5" );
            }
        }
    }

Changelog:
Code:
- Added "times to fire" field
- Added setters for all of the action fields
- Added insert/remove action natives (CS:GO windows only)
Planned:
Code:
- Change the bool return to instead throw an error when an action index is out of bounds
- Make EventAction methodmaps for sexier syntax



Last edited by hmmmmm; 02-16-2018 at 14:46.
hmmmmm is offline
SHUFEN
Senior Member
Join Date: Jun 2014
Location: Japan, Tokyo
Old 02-16-2018 , 13:59   Re: [EXTENSION] Output Info
Reply With Quote #2

kinda good modified from original OutputInfo.
Btw all credits are in BotoX, Not him.
SHUFEN is offline
Send a message via Skype™ to SHUFEN
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 02-16-2018 , 14:25   Re: [EXTENSION] Output Info
Reply With Quote #3

Quote:
Originally Posted by SHUFEN.jp View Post
kinda good modified from original OutputInfo.
Btw all credits are in BotoX, Not him.
Thanks, I've changed the credits. Wasn't aware who made it, I only found it on GitHub after needing something like this for a plugin I was working on.

Last edited by hmmmmm; 02-16-2018 at 14:25.
hmmmmm is offline
IT_KILLER
Member
Join Date: Jul 2017
Old 03-10-2018 , 14:21   Re: [EXTENSION] Output Info
Reply With Quote #4

Good changes, it would be great if anyone wants to compile for linux users. Thanks!
__________________
If you have any suggestions for improvement, let me know. I appreciate all feedback.
>>> GITHUB <<<
IT_KILLER is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 03-13-2018 , 07:30   Re: [EXTENSION] Output Info
Reply With Quote #5

Any chance for TF2 support?
Drixevel is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 03-13-2018 , 07:57   Re: [EXTENSION] Output Info
Reply With Quote #6

Other than the Insert/RemoveOutputAction natives, I don't see why not. You'll have to test it out though. I'll add the binary.
hmmmmm is offline
PerfectLaugh
Junior Member
Join Date: Oct 2014
Old 02-13-2019 , 10:46   Re: [EXTENSION] Output Info
Reply With Quote #7

BTW
https://github.com/PerfectLaugh/sm-ext-outputinfo
I added ambuild and current (20190213) linux support.
You may have a look.
PerfectLaugh is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 02-13-2019 , 22:00   Re: [EXTENSION] Output Info
Reply With Quote #8

Great work, thanks!
hmmmmm is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 02-14-2019 , 12:03   Re: [EXTENSION] Output Info
Reply With Quote #9

Quote:
Originally Posted by PerfectLaugh View Post
BTW
https://github.com/PerfectLaugh/sm-ext-outputinfo
I added ambuild and current (20190213) linux support.
You may have a look.
Great !
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 06-22-2019 , 16:00   Re: [EXTENSION] Output Info
Reply With Quote #10

I would highly recommend you to put the natives and forwards in your main thread. That would help clarify a lot of the stuff about the extension.
__________________
Spirit_12 is online now
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 14:44.


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