AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [EXTENSION] Output Info (https://forums.alliedmods.net/showthread.php?t=305343)

hmmmmm 02-16-2018 13:37

[EXTENSION] Output Info
 
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?
https://i.imgur.com/TYrPgyY.png
^ 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




SHUFEN 02-16-2018 13:59

Re: [EXTENSION] Output Info
 
kinda good modified from original OutputInfo.
Btw all credits are in BotoX, Not him.

hmmmmm 02-16-2018 14:25

Re: [EXTENSION] Output Info
 
Quote:

Originally Posted by SHUFEN.jp (Post 2578534)
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.

IT_KILLER 03-10-2018 14:21

Re: [EXTENSION] Output Info
 
Good changes, it would be great if anyone wants to compile for linux users. Thanks!

Drixevel 03-13-2018 07:30

Re: [EXTENSION] Output Info
 
Any chance for TF2 support?

hmmmmm 03-13-2018 07:57

Re: [EXTENSION] Output Info
 
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.

PerfectLaugh 02-13-2019 10:46

Re: [EXTENSION] Output Info
 
BTW
https://github.com/PerfectLaugh/sm-ext-outputinfo
I added ambuild and current (20190213) linux support.
You may have a look.

hmmmmm 02-13-2019 22:00

Re: [EXTENSION] Output Info
 
Great work, thanks!

_GamerX 02-14-2019 12:03

Re: [EXTENSION] Output Info
 
Quote:

Originally Posted by PerfectLaugh (Post 2639477)
BTW
https://github.com/PerfectLaugh/sm-ext-outputinfo
I added ambuild and current (20190213) linux support.
You may have a look.

Great !

Spirit_12 06-22-2019 16:00

Re: [EXTENSION] Output Info
 
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.


All times are GMT -4. The time now is 00:19.

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