Ok, it's time to explain something about it. I don't know what you already know about CON coding, but i'll talk about all is needed.
You should know that sprites in the map have two parameters, the picnum and an #id (and many others things like x,y,z,spritepal etc )
The picnum is which type of sprite it is (BARREL, EXPLOSION2, GOBELIN, CHAINGUNSPRITE etc) , and it is the same thing when you write "define GOBELIN XX" : a GOBELIN sprite has picnum equal to XX.
The #id is an identification number in the map and is strictly different for each sprite, not depending by its picnum . For example in a map two GOBELIN have surely different id, and this is different from the player sprite, an explosion or another enemy.
Many command like set/getactor, or canseespr etc use the #id. Every time a sprite needs to do something with another sprite, it needs to know its id and store it into a number ( for example, declaring a per-actor variable called "enemyid", "myenemy", or "target" etc, ). THISACTOR always means the id of the sprite are you in.
That's how canseespr works, for example: canseespr (id1) (id2) (result) -> canseespr THISACTOR myenemy allyseenemy (within the ALLY)
So if you want an ALLY fires a GOBELIN , it needs to find a GOBELIN sprite in the map and get its ID.
Here is the hardest part.
To find a sprite with a certain picnum you could use the findnearactor function (
http://wiki.eduke32....i/Findnearactor ) , or using a cycle that checks EVERY sprite in the map by passing through all #ids sequencially and checking if its picnum is GOBELIN or XX ( whilevarn loop
http://wiki.eduke32.com/wiki/Whilevarn ) , and there are also other methods from other modders here.
But everytime you acquire a GOBELIN or another enemy by finding its id, you should check many things, like if it's alive, if its visible ( here comes canseespr), is within a certain distance and so on.
If it fails, the actor checks for enemy again. Continuosly.
When all is right the actor (the ally) could stop to scan for enemies.
The enemy dies ? Check for enemy again.
I could post entire code segments and explains many other things (like other people could do), but i think you should understand all these things before.