Jump to content

Recommended Posts

Is there a way for a custom script or function to make use of the UI elements associated with BIS' sector module? (The sidebar, floating sector icons, capture progress indicator etc.)

Share this post


Link to post
Share on other sites

it is not so simple no. i explored some options awhile ago and it is not something that is portable or easy to re-purpose.

  • Like 1

Share this post


Link to post
Share on other sites

Depends what you want to do? You can use RscMPProgress but then are forced to using the script it starts (rscmissionstatus.sqf) and the variables it pulls from an array on logics(which by default are sectors but do not have to be) and score etc. Or you can incorporate RscMissionStatus into your own display and then its just a bunch of UI elements you can script to do what ever you want.

Share this post


Link to post
Share on other sites

I don't mean to hijack the thread but it is related to progress bar. How do you change the colour during the process of it being moved, without creating/showing another? So like, it starts off red and say 50% it goes yellow then 75% green? There is no command that I've seen but I have seen it done in some missions. I assume they didn't use RscProgress but something else but animated it to move, etc, and set the colour using probably ctrlSetBackgroundColor command.

Share this post


Link to post
Share on other sites
3 hours ago, Larrow said:

Depends what you want to do? You can use RscMPProgress but then are forced to using the script it starts (rscmissionstatus.sqf) and the variables it pulls from an array on logics(which by default are sectors but do not have to be) and score etc. Or you can incorporate RscMissionStatus into your own display and then its just a bunch of UI elements you can script to do what ever you want.

Well I'd like to make use of it in a custom sector script I'm trying to make, however I'm not sure how to go about this because I've never tried manipulating UI elements before.

Share this post


Link to post
Share on other sites
1 hour ago, HazJ said:

I don't mean to hijack the thread but it is related to progress bar. How do you change the colour during the process of it being moved, without creating/showing another? So like, it starts off red and say 50% it goes yellow then 75% green? There is no command that I've seen but I have seen it done in some missions. I assume they didn't use RscProgress but something else but animated it to move, etc, and set the colour using probably ctrlSetBackgroundColor command.

It has been awhile since I messed with it but for some reason I did it like this. One progress bar with the texture = this gradient pic. 

Then another progress on top with the texture set to 0.5 transparency (texture = "#(argb,8,8,3)color(0,0,0,0.5)";)

 

Share this post


Link to post
Share on other sites

Hm... I want the whole bar to change colour though. In your video, you just have one colour showing on top of a gradient. Thanks though. (:

Share this post


Link to post
Share on other sites

 

9 minutes ago, HazJ said:

Hm... I want the whole bar to change colour though. In your video, you just have one colour showing on top of a gradient. Thanks though. (:

 

Ahh, well you can change the color using https://community.bistudio.com/wiki/ctrlSetTextColor  just need to check the progress postion when changing it and set color depending on position. 

Share this post


Link to post
Share on other sites

You can use this command to change the bar background colour???

Share this post


Link to post
Share on other sites
15 hours ago, target_practice said:

Well I'd like to make use of it in a custom sector script I'm trying to make, however I'm not sure how to go about this because I've never tried manipulating UI elements before.

Is this a custom sector Or a custom script to work on top of vanilla sectors?

I would suggest to unpack ui_f.pbo and look at both the classes I mentioned above in the config.cpp as well as \ui_f\scripts\igui\rscmissionstatus.sqf. The script will provide you with a good overview of how to manipulate the ui's elements and create 3DIcons and what variables you have to conform to to get the system to work with custom sectors.

Share this post


Link to post
Share on other sites
4 hours ago, Larrow said:

Is this a custom sector Or a custom script to work on top of vanilla sectors?

I would suggest to unpack ui_f.pbo and look at both the classes I mentioned above in the config.cpp as well as \ui_f\scripts\igui\rscmissionstatus.sqf. The script will provide you with a good overview of how to manipulate the ui's elements and create 3DIcons and what variables you have to conform to to get the system to work with custom sectors.

Well I'd expect it to be custom but then again I don't know enough about the inner workings of the BIS sector to know if it can feasibly be modified to suit my needs.

It might be though, as my custom sector behaves very similarly except for the fact that each sector has to be captured in a predetermined order, and is locked after changing sides.

Share this post


Link to post
Share on other sites
3 hours ago, target_practice said:

as my custom sector behaves very similarly except for the fact that each sector has to be captured in a predetermined order, and is locked after changing sides.

You can already do this by using Unlock gameLogics synced to the sector and then a trigger sync to the unlock, the triggers Activation type(side) represents who must capture the sector for the unlock trigger to activate, then just sync this to the next sector in the order. You can also use the unlock triggers OnActivation to finalise the sector by disabling the secors simualtion.

Open the editor and press ctrl+O on the map selection screen to bring up the old editor. Place down a sector and use the Show Info button to give you an overview of what can be attached to a sector to enhance it usage.

Share this post


Link to post
Share on other sites

I've already made a mission using this method and it is both surprising arduous and fraught with issues.

What I'm thus trying to achieve is a pre-configured script based version which can be easily set up for multiple scenarios with minimal effort.

Share this post


Link to post
Share on other sites

You can spawn your sector also. It's versatile while in game. But you need a little code for that.

example : in a trigger activation:

 

 0 = thistrigger spawn {
  _sector = createAgent ["ModuleSector_F" ,getpos _this, [], 0, "NONE"];
  _sector setVariable ["size",200];
  _sector setvariable ["Name","bahhh"];
  _sector setvariable ["Designation","G"];
  _sector setvariable ["OwnerLimit","0"];
  _sector setvariable ["OnOwnerChange",""];
  _sector setvariable ["CaptureCoef","0.05"];
  _sector setvariable ["CostInfantry","1"];
  _sector setvariable ["CostWheeled","1"];
  _sector setvariable ["CostTracked","1"];
  _sector setvariable ["CostWater","1"];
  _sector setvariable ["CostAir","1"];
  _sector setvariable ["DefaultOwner","0"];
  _sector setvariable ["TaskOwner","1"];
  _sector setvariable ["TaskTitle","%1"];
  _sector setvariable ["TaskDescription","%1%2%3"];
  _sector setvariable ["ScoreReward","1"];
  _sector setvariable ["sides",[west,east]];
  [_sector,sideUnknown,false] call BIS_fnc_moduleSector;
};

 

Share this post


Link to post
Share on other sites
On 10/21/2017 at 5:11 PM, pierremgi said:

You can spawn your sector also. It's versatile while in game. But you need a little code for that.

example : in a trigger activation:

 


 0 = thistrigger spawn {
  _sector = createAgent ["ModuleSector_F" ,getpos _this, [], 0, "NONE"];
  _sector setvariable ["Name","bahhh"];
  _sector setvariable ["Designation","G"];
  _sector setvariable ["OwnerLimit","0"];
  _sector setvariable ["OnOwnerChange",""];
  _sector setvariable ["CaptureCoef","0.05"];
  _sector setvariable ["CostInfantry","1"];
  _sector setvariable ["CostWheeled","1"];
  _sector setvariable ["CostTracked","1"];
  _sector setvariable ["CostWater","1"];
  _sector setvariable ["CostAir","1"];
  _sector setvariable ["DefaultOwner","0"];
  _sector setvariable ["TaskOwner","1"];
  _sector setvariable ["TaskTitle","%1"];
  _sector setvariable ["TaskDescription","%1%2%3"];
  _sector setvariable ["ScoreReward","1"];
  _sector setvariable ["sides",[west,east]];
  [_sector,sideUnknown,false] call BIS_fnc_moduleSector;
};

 

I tried this, and it caused a huge number of problems when I did.

The reason I'm trying to make my own sector script is due to BIS' sector being unsuited to my intended usage of it.

Share this post


Link to post
Share on other sites

 

1 hour ago, target_practice said:

I tried this, and it caused a huge number of problems when I did.

The reason I'm trying to make my own sector script is due to BIS' sector being unsuited to my intended usage of it.

 

Truly? Tell me one problem with this code.

Share this post


Link to post
Share on other sites

I can't remember exactly what happened, but when I tried spawning sectors in-mission it resulted in strange behavior and crashing.

Share this post


Link to post
Share on other sites
6 hours ago, target_practice said:

I can't remember exactly what happened, but when I tried spawning sectors in-mission it resulted in strange behavior and crashing.

Not with this code. You should pay attention on what your're testing / writing on forum. It's not a private conversation.

  • Like 1

Share this post


Link to post
Share on other sites

Well in that case thank you for the advice, but regardless I still intend to write my own version.

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

×