help - radio emulation
hi,
amxmod x , bots stuff. i was trying to emulate those radio commands like 'taking fire', etc. i've written messages to BotVoice, SendAudio, TextMsg to 'throw' the parameters, and i managed to make the radio messages sound and display correctly, so it really looks like the "real" radio messages. but bots won't understand them. (neither csbots nor podbots) so i wonder if there's another variable must be set. maybe it would work for both bots...???:( |
Re: help - radio emulation
The bots needs to know the entity sending the message. What is your message sender edict_t * pointing to ?
|
Re: help - radio emulation
I’m actually not sendind the edict information directly.
The pev list is too big, I can’t guess which is the one for the sender, or I don’t know if it’s implicitly passed by the messages. So here’s a sample code: Code:
public Radio(id) Thanks. |
Re: help - radio emulation
Oh, stupid me... you're talking about AMX scripting, not C++ code... :(
Sorry I can't really help. Perhaps people like KWo or others with a good bit of knowledge in AMX scripting can. |
Re: help - radio emulation
To help him, I really need two know a lot of things:
1. How do bot percept my radio command, when I use "Follow me" for example - I need to know what is the most important thing the bots need to receive to intercept is a radio message. 2. Write_byte, write_string, message_begin etc - I believe they are some HL SDK functions used directly from sma scripts without necessity converting them to any C++ HL functions - so any bot coder should be able to say anything more tahn me about them (I don't know HL SDK). I will ask some AMX or AMX X developer if it's true. I used such commands sequence to clear-up buy icon - to prevent people buying any stuff. But for some reason it was not working for bots (for human players it's working great) - probably it's because of metamod preventing to send some messages to bots. 3. Need more knowledge about metamod - what is allowed , what is blocked etc. What is possible to send to another mm plugin - what is not. I think only Pierre with cooperation with Bailopan (AMX MOD X dev team, metamod maintainer) and T(+)rget (AMX dev team) can really help You. I will ask them to say us something more. |
Re: help - radio emulation
As for point #2, so far the main difference that I saw (but perhaps I haven't seen enough) between AMX scripts and C code is that in AMX scripts, they seem to never use the "edict" type, which is the fundamental entity type we use in HL. Don't know how they manage to do without... and I don't really want to know :D
|
Re: help - radio emulation
Edicts are passed around by their entity index. AMX Mod X has the entity_[get|set]_[type] functions for pulling things out of the entvars struct.
Of course, player indices are themselves edict indices, so your statement didn't make much sense. They don't pass around an edict type because Small is type-generic (it only has one data type, which is integral). That is why it uses entity indices. |
Re: help - radio emulation
I thought Small was a weak-typed language ?
Anyway, like I said, I don't know the AMX Mod X way of doing things at all, but provided there is a possibility to send and hook the same messages than in native code, it should be possible to send "fake" radio messages, and bots should be able to interpret them. But like I said too, for the bots to interpret them correctly, they need to know the sender of the message, and the sender of the message must be a valid player edict. That's all :) |
Re: help - radio emulation
Which one is the most relevant message event for the radio? (I mean, the one that bots would interpret as someone sending radio message.)
SendAudio? TextMsg? Both? I don’t know if it has something to do with that - I’m able to send those amx ‘fake messages’ when I’m dead, so maybe they’re not reliable enough for the bots… Thank you. Ps. Just made a test and verified that the radio messages are displayed to both teams (terrorists and cts). I’ve seen no way to limit the message scope except by the destinations constants, but I don’t know how to use it. Here’s the list from amxmod manual. Quote:
I’ll be trying them… |
Re: help - radio emulation
No, it has nothing to do with the message scopes. Looping through all the clients and sending a MSG_ONE_UNRELIABLE to those you want to receive the radio message is the only and right way to do.
The messages most bots hook when it comes to radio messages are TextMsg. The discriminative is a string, usually starting with "#". Look in some bot source code (for example, POD-bot mm) to see what are the audio message strings that can be used. edit: alternative method. Use PMTools to log in a text file (or just to display on the screen) what are the network messages that are sent when you fire a radio message yourself. |
All times are GMT +2. The time now is 03:31. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.