• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

what variables can be passed over a host-client connection?

Started by TheJamsh, October 24, 2009, 05:01:11 AM

Previous topic - Next topic

TheJamsh

seeking a bit of outside help for the pack here... One of the new extra options pages lets you change vehicle list. Now these lists are radio buttons with variables assigned to them, but the variables are shell-based ones, NOT Ivars or SVars etc...

This is the Host CFG (not whole thing, just an example):

ConfigureVarSys()
{
CreateInteger("extraoptions.vehiclelist", 0);
SetIntegerRange("extraoptions.vehiclelist", 0, 16);
}

CreateControl("MPVehicles", "BUTTON")
{
ColorGroup("BLACKBLUE");
Geometry("TOP", "LEFT");
Position(0, 0);
Size(125, 0);
BorderSize(5);
BevelSize(3);
JustifyText("LEFT");
Style("ROLLOVER", "RADIO");
Font("TINY");
Text("Stock: MP Vehicles");
Cursor("Highlight");
useVar("extraoptions.vehiclelist");
value(1);

NotifyParent("Button::Select", "StockMPVehicles");
}

OnEvent("StockMPVehicles")
{
Cmd("network.session.svar4 mpvehicles.txt");
Cmd("network.session.ivar4 2147483647");
}


Now imagine that lower area many times over and arranged correctly to give multiple buttons. Below is the client version. No matter what i do, i CANT get the client version to read the same as whatever the host selects. It will always stay blank and not show which vehicle list has been selected. Do i HAVE to assign an svar to this to make it work correctly?


ConfigureVarSys()
{
CreateInteger("extraoptions.vehiclelist", 0);
SetIntegerRange("extraoptions.vehiclelist", 0, 16);
}


CreateControl("MPVehicles", "BUTTON")
{
ColorGroup("BLACKBLUE");
Geometry("TOP", "LEFT");
Position(0, 0);
Size(125, 0);
BorderSize(5);
BevelSize(3);
JustifyText("LEFT");
Style("ROLLOVER", "RADIO", "INERT");
Font("TINY");
Text("Stock: MP Vehicles");
Cursor("Highlight");
useVar("extraoptions.vehiclelist");
value(1);

NotifyParent("Button::Select", "StockMPVehicles");
}

OnEvent("StockMPVehicles")
{
Cmd("network.session.svar4 mpvehicles.txt");
Cmd("network.session.ivar4 2147483647");
}


BZII Expansion Pack Development Leader. Coming Soon.

TheJamsh

ive just noticed that the clients have the notify parent and onevent sections. Will erasing that make any difference. I assume its not-needed...


BZII Expansion Pack Development Leader. Coming Soon.

General BlackDragon

Radio buttons MUST have a var assigned to them, or last i checked, AV.

you can makeup an ivar up to 60 (? 65?) for your own stuff. Even if it's not used by DLL.



*****General BlackDragon*****

TheJamsh

Thought that was the case. So essentially the shell variable (even though it makes them work as radio buttons) is useless?

I can just pick one at random of course (so long as it isnt used)



BZII Expansion Pack Development Leader. Coming Soon.

General BlackDragon

No, it adds a min/max to radio buttons and allows the radio button to function (i.e. selecting option 1 makes option 1 stay lit up)

and yes, i believe 33 + are available.



*****General BlackDragon*****

TheJamsh

Well for something like this i guess i dont need the shell variable now then. Now to find an un-used stock variable...

Ivars go up to 64, svars go to 32 i believe. Ivar seems safer though


BZII Expansion Pack Development Leader. Coming Soon.

Nielk1

Vars are not passed server to client if changed after launch anymore. That was cheating anyway.

Click on the image...

TheJamsh

Thats fine, its for the pre-game shell so we needn't worry. It IS working now anyhow


BZII Expansion Pack Development Leader. Coming Soon.