I decided to share some plug-in examples at Modcrafters.com. Since the place is barely alive, I thought it might be better to link some of them here. If you have useful plugin code, please share them here!

Gonna arguably hijack this thread a bit and post an example plugin of my own. Using this plugin will allow Place COP to be used without blanking out the unit's button set, and also to be used repeatedly. This by itself isn't terribly useful, though it could be used for, say, a teleporting Gateway, or some kind of warp-capable starship, but it could be nice to know for further plugin development. This is a practical example; start a game as Zerg and you should be able to figure it out.

(If you're going to use this, the unit will also need to be given access to the CTF COP2 order in Firegraft.)

Another plugin trick, not discovered by me, allows the creation of buttons which cost resources and can be detected by a plugin. Basically, on a unit that is not a structure, Carrier, or Reaver (or hero Carrier/Reaver), place a Create Unit button set to train a unit you're not using and update the requirements. The unit won't actually train, but the button press will be noted in the unit's queue[0] variable. Let's say we set the Goliath turret to cost 25 minerals, and gave the Marine the ability to train it, and used the following plugin. This would allow Marines to heal 20 HP at the cost of 25 minerals! (I think. I haven't tested this one recently.)

[quote name='Arcanes_Lutarez' date='20 November 2012 - 07:42 AM' timestamp='1353364937' post='11242']hello, i need help, i need create a plugin for a build with psi like the pylon, when i create a building with psi in datedit, in the moment that the build die, the psi don't disappear[/quote]

Now add #include "psifield.h" in game.h.All you need to do is modify UnitCanMakePsiField() and UnitNeedsPsiFieldDestructor() to change the unit ID to the one of your choice. You also need to add the following code to qdp.cpp, inside the InitializePlugin() function: