communication between two plugins
I was wondering how could I establish communication between an amxx plugin and a metamod plugin - more precisely, an amxmodx plugin sets the game rule and a metamod bot should be aware about what's going on in the match.
It's been suggested that I could use engine messages, but I lack of understanding the mechanism. I guess those messages have fixed sequences of parameters for each type of "event". I couldn't find where/how they are set in hlsdk, all I found was about SVC_TEMPENTITY. Can I use a custom sequence of parameters and just return supercede? Otherwise, if I would only be able to use existent messages patterns, wouldn't that be confused with 'real' engine messages. I'd appreciate any information you could provide. |
Re: communication between two plugins
If You are using "standard" AMX X / AMX natives, they are using HL messages only AMX X / AMX with its plugin can hook, because metamod blocks them to intercept by other mm plugins.
Example: Code:
static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_user_team(index, team, model = 0); = 3 params Code:
cs_set_user_team2(id, team, modelname[]); |
Re: communication between two plugins
Thanks KWo, I understand now why engine messages should be sent instead.
But wouldn't these messages be confused with "real" game messages anyway? I mean, suppose csflags plugin (an amxx plugin that adds "capture the flag" gameplay to cs) would send a message every time a flag is captured so bots (metamod) would be aware of the event. If it used an existent message like teaminfo or whatever, wouldn't that cause some mess in game? |
Re: communication between two plugins
Everytime You want to send a HL message You need to know what it is for the game. If it's only some visual effect meesage, it cannot destroy the gameplaying. If it's changing something for players (because HL messages sent by AMX X can hit players; they only cannot hit other mm plugins - including mm bots) - and You know what is happening for them - just the same will happen for bots.
Hint Test first the plugin normal way (with HL messages sent normal way by AMX X) on CZERO bots. Metamod doesn't block (it just cannot) sending the messages to them. If everything is OK - You can try to convert the plugin to use emessages. More than likely the bots will not react on Your flags at all, since they don't know what such flags are for (there is no code in bots to react on such things, I guess)... |
Re: communication between two plugins
Quote:
So, if it used a visual message just like you said (mostly tempentity messages), bots should still be able to distinguish those messages from "real" engine messages. I suppose these messages should contain a special value in a parameter so bots would know they're coming from csflags plugin (?). |
Re: communication between two plugins
They will not know where this message is coming from, so You don't need that extra info include there (even no way to tell that). I wish You good luck with this, but I don't think You will be finally happy. The bots are really stupid and You need to put also the "AI" to the code so they can react on the messages You are going to send them. They don't have eyes, they are using tracelines and tracehulls to "see" obstacles or objectivities.
|
Re: communication between two plugins
About the amxx->metamod plugin communication, I've done some tests and it works fine so far.
Quote:
Luckily csflags plugin stores lots of information in the flags entities (I was trying to avoid abusing from global variables in amxx). So basically I would add some "objectives waypoints" (thoses flags are fixed just like in dod), and try add some "extra behavior" to an existent bot; I wouldn't have to code the hardest parts :P... |
Re: communication between two plugins
Just in case someone faces the same problem in counter-strike - CZCareer messages are very useful for this purpose since they have no effect in multiplayer matches. The first argument must be a string, then you may format the message as you like.
|
All times are GMT +2. The time now is 04:20. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.