Jump to content
Sign in to follow this  
giallustio

kbTell problem on MP

Recommended Posts

hi all! I have a little problem with the kbTell command in MP. In SP all works fine but not the same on the server.

this is my chat.bikb

class Sentences 
{
class Arty_Splash 
{
	text = "Splash! Over!";
	speech[] = {};
	class Arguments {};
};
};
class Arguments{};
class Special{};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university}; 

This is my server side script:

_group = creategroup west;
HQ_BLU = _group createUnit ["Logic",[0,0,333],[],0,"NONE"];
_group setGroupId ["CrossRoad"];
HQ_BLU kbAddTopic["HQ_BLU","Chat.bikb"];

My client side script:

player kbAddTopic["HQ_BLU","Chat.bikb"];

And the kbTell in a client side script:

HQ_BLU kbTell [player,"HQ_BLU","Arty_Splash",["","","",[]],true];

Any idea?

PS: Is possible use this command without the "ItemRadio"?I tried in SP but the text didn't show up.

Share this post


Link to post
Share on other sites

You have to execute kbTell where the unit is local. In case of a logic it is the server.

Xeno

Share this post


Link to post
Share on other sites

Thank you Xeno for your reply. Can you help me a little bit more? :)

How can i do that? Because the script is client side and i would like that all the players can read the text...

Share this post


Link to post
Share on other sites

You could try looking in Domination/Domino. But it isn't trivial to setup, and has quite a bit of other settings that needs to be in.

How I have set it up based on Domination:

//Client side artillery script, executed when player opens the dialog.
//Player: Initiating call.
player kbTell [
_speaker,d_kb_topic_side_arti,"ArtilleryInitiate",
["Team","",_firstsecondstr,[_firstsecondstr,"ThisIs"]],
["Spotter","",_spotter,[_spotter,"Pause","ComeIn"]],
true
];
//Server: Reply.
["d_artyfdcchat",[_ari_num,"ArtilleryGoAhead"]] call XNetCallEvent;

In the above, player is local and can kbTell normally. For the reply, the server is not local (script runs on client), and have to be instructed to start a script (i.e. via PVEHs) so that kbTell works properly.

//Server side artillery script, executed when rounds are created.
//Server reads out the fire mission, "shot message" basically.
_yourlogicunit kbTell [
d_hq_logic_en2,d_kb_topic_side_arti,"ArtilleryShotFirst",
["Team","",_aristr,[_aristr]],
["Battery","",_battery,[]],
["Salvo","",str(_series),[]],
["Flighttime","",_tofstring,_tofvoice],
true
];
//Client replies to that message.
["d_artyobschat",[_num_arti,"ArtilleryOTWReply"]] call XNetCallEvent;

But in the above, the opposite is true. That snippet is run on the server, so _yourlogicunit can kbTell as normal. That is then followed by a player reply, in which the clients are instructed (via PVEH'ish approach) to use the kbTell.

I really with there was a simpler way.

Share this post


Link to post
Share on other sites

Mmm...Well, but what's XNetCallEvent? And i think that d_hq_logic_en2 is another game logic created by the server, isn't it?

Share this post


Link to post
Share on other sites

I tried to use PVEH but it doesn't work...

Init.sqf

if (isServer) then {
_group_1 = creategroup west;
HQ_BLU_1 = _group_1 createUnit ["Logic",[0,0,333],[],0,"NONE"];
_group_1 setGroupId ["CrossRoad"];
HQ_BLU_1 kbAddTopic["HQ_BLU","Chat.bikb"];
_group_2 = creategroup west;
HQ_BLU_2 = _group_2 createUnit ["Logic",[0,0,333],[],0,"NONE"];
HQ_BLU_2 kbAddTopic["HQ_BLU","Chat.bikb"];
};
"HQ_Chat" addPublicVariableEventHandler 
{
HQ_BLU_1 kbTell (_this select 1);
};

In the client side script:

HQ_Chat = [HQ_BLU_2,"HQ_BLU","Arty_Acquired",["","","",[]],true];publicVariable "HQ_Chat";

Any help?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×