Page 1 of 1

A few BZ2 shell questions

Posted: Mon Sep 17, 2012 7:28 am
by Zero Angel
1) Is there any way to have a button press send a message to the chat shell (local only or broadcasted). Such as << Super Cool Recycler Variant Selected >>.


2) Is it possible to for a button to remain highlighted, and this event to be read by the client's shell even though the button performs an event instead of sets a var through UseVar?


3) Is it possible for a map's INF file to read a set of presets stored in a cfg file instead of having to manually have to update each maps's INF file if I want to change one setting globally?

Re: A few BZ2 shell questions

Posted: Mon Sep 17, 2012 10:24 am
by Red Spot
1) The game already does that. Name the recy and it should pretty much say what you want.

2) I think you can, but not sure. You can at least have a button be and stay highlighted, just make it so. (Not sure in regard to what you want/mean though)

3) You can make you shell read custom vars from a inf file.

Code: Select all

ivar33 = 0 // RS-V: Human scrapcheat duration/delay.
ivar34 = 0 // RS-V: AI scrapcheat duration/delay.
ivar35 = 0 // RS-V: Team A pre-set color.
ivar36 = 0 // RS-V: Team B pre-set color.
ivar37 = 100 // RS-V: Team A custom color "Red" value.
ivar38 = 0 // RS-V: Team A custom color "Green" value.
ivar39 = 20 // RS-V: Team A custom color "Blue" value.
ivar40 = 0 // RS-V: Team B custom color "Red" value.
ivar41 = 40 // RS-V: Team B custom color "Green" value.
ivar42 = 100 // RS-V: Team B custom color "Blue" value.
ivar43 = 1 // RS-V: Human base pools, 0..3. (see svar14)
ivar44 = 2 // RS-V: AI base pools, 0..3. (see svar14)

svar14 = "uepool01" // RS-V: Biometal pool that will be spawned in bases.

Re: A few BZ2 shell questions

Posted: Mon Sep 17, 2012 2:05 pm
by Zero Angel
Red Spot wrote:1) The game already does that. Name the recy and it should pretty much say what you want.
Yeah, but how can one have this notification transmitted to clients in the same way a notification is transmitted to clients whenever the map is changed?
2) I think you can, but not sure. You can at least have a button be and stay highlighted, just make it so. (Not sure in regard to what you want/mean though)
Nope. That seems to only work with buttons that have useVar. Also, i'm not sure if useVar can read svars.
3) You can make you shell read custom vars from a inf file.

Code: Select all

ivar33 = 0 // RS-V: Human scrapcheat duration/delay.
ivar34 = 0 // RS-V: AI scrapcheat duration/delay.
ivar35 = 0 // RS-V: Team A pre-set color.
ivar36 = 0 // RS-V: Team B pre-set color.
ivar37 = 100 // RS-V: Team A custom color "Red" value.
ivar38 = 0 // RS-V: Team A custom color "Green" value.
ivar39 = 20 // RS-V: Team A custom color "Blue" value.
ivar40 = 0 // RS-V: Team B custom color "Red" value.
ivar41 = 40 // RS-V: Team B custom color "Green" value.
ivar42 = 100 // RS-V: Team B custom color "Blue" value.
ivar43 = 1 // RS-V: Human base pools, 0..3. (see svar14)
ivar44 = 2 // RS-V: AI base pools, 0..3. (see svar14)

svar14 = "uepool01" // RS-V: Biometal pool that will be spawned in bases.
This lists a bunch of vars from an INF file. I am actually looking to do the opposite. Have INF files (like say, from 8 maps) read vars from a file, if possible. This way if I want to change one setting, I just have to change it in one file instead of tweaking 8 different files.

Re: A few BZ2 shell questions

Posted: Mon Sep 17, 2012 3:04 pm
by Nielk1
1: If you are making a button that selects your rec directly, and the message you want isn't transmitted, add additional events to the button';s functions such as setting he chatline var to the wanted string and simulating a send message button press. I was able to, in a test, make it so the shell would part the IRC room with a reason why by adding some code to the join and other buttons.

2: To keep a button highlighted, it must refer to a var. For other players, clients, to see this, it must be one of the ivars. This was something TJ did with the MPV list selector buttons in the UEP that I did not like because it tied up ivars for piddly glowing buttons.

3: It is better for everyone if ivars and svars are set in the map's inf for their intial values rather than some CFG shell file.

Re: A few BZ2 shell questions

Posted: Mon Sep 17, 2012 3:46 pm
by Cyber
1:
Yes.


...
NotifyParent("Button::Press", "Launch");
...

OnEvent("Launch")
{
cmd("shell.stopSound mire22_4.wav");
Cmd("shell.multi.launch");
Cmd("network.launch");
Cmd("network.chateditline 'GAME HAS BEEN STARTED!';network.chatline.entered");
}

Re: A few BZ2 shell questions

Posted: Mon Sep 17, 2012 3:58 pm
by Red Spot
Zero Angel wrote:
Red Spot wrote:1) The game already does that. Name the recy and it should pretty much say what you want.
Yeah, but how can one have this notification transmitted to clients in the same way a notification is transmitted to clients whenever the map is changed?
I was under the impression it did so.

Code: Select all

08/25/12 15:59:11 Server changed recycler variant to VSR: 1.2 Variant Plus (Beta 4.1)
--
Zero Angel wrote:This lists a bunch of vars from an INF file. I am actually looking to do the opposite. Have INF files (like say, from 8 maps) read vars from a file, if possible. This way if I want to change one setting, I just have to change it in one file instead of tweaking 8 different files.
Basic C (C++?) can already do that, nothing BZ2 specific is needed to do this.
But I would take N1's advice on this one and just create a little macro to change some values in textfiles, vba is pretty easy to get a basic understanding of.

Re: A few BZ2 shell questions

Posted: Mon Sep 17, 2012 4:31 pm
by General BlackDragon
1: Yes
2: Yes
3: Not without c++

For 2, simply create an interger for the button to use, and make it a RADIO style. These buttons can ALSO do "OnEvent()" calls. The Radio/var element will keep it highlighted like a normal thing.

Re: A few BZ2 shell questions

Posted: Mon Sep 17, 2012 5:20 pm
by Zero Angel
Alrighty then. Thanks for the answers all. They were pretty helpful.