[ANY] Trigger v1.1
1 Attachment(s)
Although I have been using SourceMod and coding private plugins for some time, this is my very first public release, but I felt it to be useful enough to release at large.
The inspiration for this plugin was the "Trigger Mapentities" plugin written by HSFighter. It had been a useful device for map development and testing, not to mention the occasional prank. However, we soon learned its limitations, such as requiring the class name to be able to fire the event. It also couldn't accept input values. This is the result of my development to create a better version. It basically mimics the function of the "ent_fire" cheat command, enabling the triggering of any and all matching entities complete with optional input, but without spoiling your session by activating cheat mode. I only delve into Team Fortress 2, but the basic nature of this plugin should render it mod-agnostic. No CVARs are used other than the version CVAR "sm_trigger_version". It's as simple as loading it to enable the commands and unloading it to remove them. The plugin provides three commands, all with ROOT flag restrictions (easy to change in the source) due to their technical or powerful nature:
Standard disclaimers apply. You assume all responsibility for the use of this plugin. Having said that, I sincerely hope this plugin is of use to anyone. I know it has been for myself. |
Re: [ANY] Trigger v1.0
A very handy plugin indeed. Useful for triggering those eastereggs!
|
Re: [ANY] Trigger v1.1
sizeof is a compile-time operator :) I see you're doing manual counting using while loops and the like which isn't required, but sizeof saves a lot of headache :P
I don't understand why you can't use FindEntityByClassname, but I'm going to assume there's a good reason for it as you're pulling in sdktools anyways. PHP Code:
PHP Code:
Regardless, seems relatively sane, nice job! |
Re: [ANY] Trigger v1.1
I was specifically AVOIDING using that because an entity match can match entities of DIFFERENT classes (IOW, the same name may apply to a logic_case and a logic_relay). ent_fire doesn't filter by class, neither does the base event logic system, so mine doesn't filter either. Besides, I don't think FindEntityByClassname works non non-edicts like logic_case, which was one of the problems I had with Trigger Mapentities.
The code you see for finding entities is essentially copied from SMLib, but I avoid using SMLib itself to reduce the overhead, and I can see why they used this technique. It's basically the only way to go. As for the other code, I'll look at tweaking it. I'll look into sizeof. My coding base is C, however, and I'd always been taught there that sizeof counts in bytes, which is why it's used in memory operations. My array is of strings and other variable-length constructs which, in my thinking, can throw off sizeof. Oh, the -2 and -1? Those are defined returns from GetClientAimTarget(), the function I use to aim at an entity. The descriptions I use are based on the API documentation (-1 if no entity is being aimed at. -2 if the function is not supported). GetClientAimTarget is one reason I still use SDKTools. One last thing: ClassName here is an OUTPUT, meant to report the class of a found entity for reporting (for atypical matching). |
Re: [ANY] Trigger v1.2
2 Attachment(s)
Converted to new-syntax for SM 1.11, should work on SM 1.10.
Added classname-targeting to sm_trigger and sm_findentity that functions similar to ent_fire. |
Re: [ANY] Trigger v1.1
This is a good thing, if you can list the execution code triggered by him, it is convenient to call in other programs
how to execute on server Code:
sm_trigger filter_generator testactivator [Trigger] Triggered input 'TestActivator' of 'filter_generator'. |
All times are GMT -4. The time now is 08:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.