OFPSDEV / BECTI

Mission Development for OFPS
3 stars 4 forks source link

Create new equipment menu when accessed from anywhere other than base #96

Open SpanishSurfer opened 9 years ago

SpanishSurfer commented 9 years ago

Equipment truck FOB *Town Centers

Available equipment will be basic ammo/equipment (roughly what the resistance carries). Mostly ammo and basic rifles/launchers at 2-3 times the price of what it would cost at base. I'd also like to change the color of the equipment menu when accessed from anywhere but the base to let the player know he is in a different equipment menu.

SpanishSurfer commented 9 years ago

Conversation with Benny:

3:01 PM - SpanishSurfer: hello benny, have a quick question for you 3:01 PM - SpanishSurfer: sorry to bother you during your PoE game 3:02 PM - Benny: hey 3:02 PM - SpanishSurfer: I want to have different prices based on where the player brings up equipment menu...from base (cheap prices) from truck, fob, town (expensive prices) 3:03 PM - SpanishSurfer: i was going to create 2 duplicates of the gear_west gear_east and rename them to remote_gear_west 3:03 PM - SpanishSurfer: and change the pricing as needed 3:03 PM - Benny: yes 3:04 PM - Benny: i advise you to do a function 3:04 PM - Benny: upon gear menu openup 3:04 PM - Benny: check if player is in range of barracks 3:04 PM - Benny: trucks then 3:04 PM - Benny: fob etc 3:04 PM - Benny: with priority 3:04 PM - Benny: i did it before on A2 3:05 PM - Benny: ofc you have to check before purchasing too in case the player moved/structure got killed 3:07 PM - SpanishSurfer: i can only find 1 instance where gear_west.sqf is called 3:07 PM - SpanishSurfer: if (CTI_P_SideJoined == west) then {(west) call compile preprocessFileLineNumbers "Common\Config\Gear\Gear_West.sqf"}; 3:07 PM - Benny: yes 3:07 PM - Benny: initialization 3:07 PM - SpanishSurfer: after that it has the prices? 3:07 PM - Benny: yes 3:08 PM - Benny: you should overwrite the config pricing 3:08 PM - Benny: instead of 20$ 3:08 PM - Benny: you could make something like 3:08 PM - Benny: [20,15,5] 3:08 PM - Benny: for instance 3:08 PM - Benny: asuming base is 2 3:08 PM - Benny: _price select 2 3:08 PM - Benny: fob being 1 3:08 PM - Benny: _price select 1 3:08 PM - Benny: truck being 0 3:08 PM - Benny: _price select 0 3:09 PM - Benny: etc 3:09 PM - Benny: opposite is more logical thought 3:09 PM - Benny: [5,15,20] 3:09 PM - Benny: cheapest to most expansive 3:09 PM - Benny: that's how i'd do it 3:10 PM - SpanishSurfer: ok that's good, but might be too advanced for me...what sqf would i edit and what would it look like? 3:11 PM - Benny: gear_west and gear _east 3:11 PM - Benny: search for gear price function and adapt them 3:11 PM - Benny: instead of an integer you deal with an array 3:11 PM - Benny: other easy solution is 3:11 PM - Benny: coefficients 3:11 PM - Benny: let's say item price * coefficientbase (1) 3:12 PM - Benny: item price * fob coef (1.5) 3:12 PM - SpanishSurfer: yeah that's not a bad idea either 3:12 PM - Benny: item price * truck price (2) 3:12 PM - Benny: that'ss easy to do 3:12 PM - Benny: you just need the function 3:13 PM - SpanishSurfer: here's what I was thinking though, I wanted the gear menu to load with a red color to let the player know he's purchasing from a non base and thus gear will be limited as well as prices increased 3:13 PM - Benny: doable too 3:13 PM - SpanishSurfer: i figured creating 2 new gear prices and having the mission call on gear_remote GUI and a gear_west/east_remote would be easiest 3:14 PM - Benny: well you can do that too 3:14 PM - Benny: duplicate gearwest and geareast 3:14 PM - Benny: and adapt the gear / price 3:14 PM - SpanishSurfer: exactly 3:14 PM - Benny: more work but that's ok 3:14 PM - SpanishSurfer: since i'm not advanced more work is the option 3:15 PM - Benny: it's ok 3:17 PM - SpanishSurfer: so how i do I tell the mission to load prices from gear_west_remote.sqf if the user loads equipment from fob, ammo truck, town center? 3:17 PM - Benny: function 3:17 PM - Benny: on load 3:17 PM - Benny: check where player is the closest to 3:18 PM - Benny: check my A2 version if you need guidance 3:18 PM - Benny: there's something similar 3:18 PM - SpanishSurfer: ok thanks 3:18 PM - Benny: think it was in 071 3:18 PM - SpanishSurfer: i'll prob have to pawn this off on one of the more advanced guys on the team 3:18 PM - SpanishSurfer: i'll post your discussion for them to look at, thanks man

thecoolestname36 commented 9 years ago

I think the best place to start thinking about this is within '\client\Actions\Action_GearMenu.sqf

Maybe add a selection statement and create a client global variable as an integer like 'CTI_GearMenuSelection' OR pass it as a variable somehow assign it from the selection statement and run the appropriate gear menu. If you want the code to be pretty maybe you can use some polymorphism and "overload" the current GUI with your new color (duno if its possible) or you can just control+c and change the colors. Now you can use that global number 0 or 1 or 2 to select the appropriate price from the Gear_West prices array.

SpanishSurfer commented 9 years ago

You guys can do this however you want, but it needs to do the following:

  1. Allow me to easily edit prices and what items are shown in the new Gear menu
  2. Have a red color to alert the player they are in a different gear menu

That's it I think.