VaultNetwork.net Vault Network Boards
Author Topic: Need help togglign VT options from another plugin [Locked]
mav_sc  1 star
Posts: 131
Registered:
VI, I'm trying to change some options like enablebuffing, enablelooting, etc.. from another plugin.

I'm using commands like:
Util.Host.Actions.AddChatText("/vt opt set EnableLooting " + value.ToString(), 0);

Using AddChatRaw and InvokeChatParser also doesn't seem to work.

How can I add a chat command into the global stream so that other plugins will see and parse it with Core_CommandLineText?

Thanks!
-lino-  1 star
Posts: 177
Registered:
You can't (thru Decal methods).
mav_sc  1 star
Posts: 131
Registered:
Ok, figured as much.

I guess I'll just send the commands via postmessage.

Thanks!
Paraduck  2 stars
Title: quantum mechanic
Posts: 484
Registered: 2001-2-27 18:19:03
Yeah, I've been using PostMessage to send keyboard input, if I want it to be seen by other plugins. I notice that V appears to have plans to allow certain VTank options to be controlled externally (load uTank2.dll in VS and take a look at the object browser), but I haven't seen anything about it yet.

 

-----signature-----
We are like dwarfs sitting on the shoulders of giants. We see more and things that are more distant than they did,
not because our sight is superior or because we are taller than they, but because they raise us up and their
great stature adds to ours
mav_sc  1 star
Posts: 131
Registered:
Ya I remember reading about using V's dll. I completely forgot about that though and did zero investigation before I implemented my postmessage methods though.

Oh well.

Few tips about using postmessage. You need the proper scan code for your message to work. Using spy++ helps.

Also, you can't send enter, then your text message, then enter, all consecutively. AC needs a little space between the enter, middle text, and final enter. Right now I'm using 60ms spacing which seems to work. 40ms spacing failed rarely.
Virindi-Inquisitor  4 stars
Posts: 1,538
Registered: 2001-11-18 22:25:54
mav_sc posted:

Also, you can't send enter, then your text message, then enter, all consecutively. AC needs a little space between the enter, middle text, and final enter. Right now I'm using 60ms spacing which seems to work. 40ms spacing failed rarely.



A better method for this, if you are writing an actual plugin, would be to wait for the next frame to be processed before sending the key.


Paraduck posted:

I notice that V appears to have plans to allow certain VTank options to be controlled externally (load uTank2.dll in VS and take a look at the object browser), but I haven't seen anything about it yet.



These methods are mostly locked to prevent use by UCM and DT helper plugins. Their purpose is to allow me (and potentially others) to write utilities such as the vtminiremote (in vhuds) which conform to the design goals of VTank.

Plugins and utilities which don't have the special approval needed to use these functions can always just set and get settings through the use of the console commands (http://www.virindi.net/wiki/index.php/Virindi_Tank_Commands) and hotkeys.

 

-----signature-----
Virindi
---
****Virindi Plugins FAQ**** http://www.virindi.net/wiki/index.php/Virindi_Plugins_FAQ
http://www.virindi.net - Virindi Tank, Follower, Integrator, Reporter, VCS5, XPHelper, Item Tool, HUDs, etc...
Decal Core Dev - http://www.decaldev.com
mav_sc  1 star
Posts: 131
Registered:
VI, I'm not sure how to detect when the next frame is processed, and am not sure what exactly you mean by frame.

GFX frame or net frame?

Using the get and set options via postmessage is working for me now, so I'm happy with it.
Virindi-Inquisitor  4 stars
Posts: 1,538
Registered: 2001-11-18 22:25:54
Frame, as in, 3d engine frame. If you hook the Host.Underlying.Hooks.RenderPreUI event, it will called once per frame...just don't put a lot of stuff in there, or unhook it when you're done, because if you take time in that event it is easy to decrease your framerate.

 

-----signature-----
Virindi
---
****Virindi Plugins FAQ**** http://www.virindi.net/wiki/index.php/Virindi_Plugins_FAQ
http://www.virindi.net - Virindi Tank, Follower, Integrator, Reporter, VCS5, XPHelper, Item Tool, HUDs, etc...
Decal Core Dev - http://www.decaldev.com
mav_sc  1 star
Posts: 131
Registered:
Thanks for the tip VI.

The event I'm using is:
Util.Core.RenderFrame += new EventHandler<EventArgs>(Core_RenderFrame);

It seems much more reliable, and WAY faster than using a random ms delay.
Virindi-Inquisitor  4 stars
Posts: 1,538
Registered: 2001-11-18 22:25:54
Yes, in Decal.Adapter, the once per frame hook was not present in 2960. It has been added in 2961.

If you want your plugin to be public at some point it might be a good idea to use the interop one so that it works with 2960...until 2961 is officially released, at least.

 

-----signature-----
Virindi
---
****Virindi Plugins FAQ**** http://www.virindi.net/wiki/index.php/Virindi_Plugins_FAQ
http://www.virindi.net - Virindi Tank, Follower, Integrator, Reporter, VCS5, XPHelper, Item Tool, HUDs, etc...
Decal Core Dev - http://www.decaldev.com

VaultNetwork.net is an independently operated community forum and is not affiliated with, endorsed by, or technically based on IGN, GameSpy, FilePlanet, GameStats, or the former IGN/GameSpy Vault Network.
References to VaultNetwork.net mean this site/domain. VNBoards-style presentation is a visual homage only. By using this site, you agree to the forum rules.