Jump to content

Intel Market: Code Review and Help


TeamDragonpunk

Recommended Posts

All,

 

I'm not quite finished adding the proposed new code to this Power Point (PPT), but I'll go ahead and make the thread in case anyone else is already (or wants to) work on this.

 

https://www.dropbox.com/s/3mwqdhquxs4l71r/XCOM2_UX_IntelEconomy.ppt?dl=0

 

USE CASE:

"As a user, I should have the option to purchase Intel rewards for almost any mission."

 

This functionality already exists for the Broadcast Mission, so I'm hoping that the main challenge will be a matter of hooking it into the UI correctly. Right now, I think everyone is leaning towards User Experience 2 (UX2) in the PPT, but I'm having a hard time finding where the "Begin Mission" Screen/UI is called.

 

Thank you in advance for any help you can provide. This mod will be essential for Co-Op players that are earning more intel by assisting others.

 

=Dan

Link to comment
Share on other sites

Sure. I'll hop in! sounds like a great idea for a mod, though i say we need MUCH more intel options to go around all the way from 10 intel to 100-150 intel Stuff like XCom reinforcements, 1 or 2 use Conceal for everyone(additive so rangers wont miss out), extra mobility or aim,less pods -really heavy stuff as well as light stuff like extra loot, extra turn or two on the timer(actually this could be medium like 40-60),an extra room for a soldier, maybe bigger rewards from the mission and so on

Link to comment
Share on other sites

Eladdy202,

I agree, but one step at a time. Yes, I think this could serve as the foundation for an incredible framework. I'm still trying to see what is defined in native code as far as the Intel Rewards which seem to be managed through the Hacker Reward Template. If we can find where those are set, we can add our own (which would be fantastic). As always, XCOM has to make everything complicated lol. There is no set price for these. There's a long algorithm that set the price based on difficulty, variance, etc..

 

I/we could get the base mod out this week though if I could just figure out where the "Begin Mission" button is being called and how to successful override the UI (was thinking UI Listner), but I think it will be best to override the entire UI.

Link to comment
Share on other sites

Found the MissionIntelOption definition in the X2StrategyGameRulesetDataStructures - seems like it does have at least a base cost

struct native MissionIntelOption
{
	var name IntelRewardName;
	var StrategyCost Cost;
};

And i found that each mission no matter what is capable of holding intel options in XComGameState_MissionSite.uc

Now all the intel options are just hack rewards so really once you add these to the hack rewards it's a piece of cake to get them to spawn to the missions, because from what i understand all you need to do is just call PickIntelOptions() from that same file and bam you have intel options,from there it's just pushing the UI screen to the stack and letting it grab the options, although right now it seems that it's hardcoded to find the GPMissionSource but you can alway just copy the rest of the code and create a new UIMission screen you push onto the screen stack

Edited by Guest
Link to comment
Share on other sites

Right! In the power point, I (briefly) mention that it saved in the MissionSite. Would be too much to create from scratch, but the code base is all there.. XCOM 2 surprisingly only uses it once in the entire game.

maybe they didnt find the right balance, i am surprised they didnt include this with the regular game since it would be an amazing feature to have. i hope i helped a bit, i may not be around for some coding but i might also do...i know i am super vague... just have a lot on my plate right now and see if i can squeeze it in because i would like to contribute. right now i am not the best with UI (although i hope to get better with experience) but i can point out a few things i see from the firaxis code, looks like implementing this mod is going to be quite trivial compared to some other stuff i've seen here, just adding the UI and calling the PickIntelOptions() or even writing a better randomised one, it dosnt sound hard at least in theory

Link to comment
Share on other sites

No worries, all I need is help understanding where the UI is being called for the "Begin Mission" screen. I think I can do the rest. Agreed that I think it would have been out of balance in Vanilla XCOM 2, but in the Co-Op Mod we're developing, it will be a great way to earn extra Intel. Thank you again.

Link to comment
Share on other sites

No worries, all I need is help understanding where the UI is being called for the "Begin Mission" screen. I think I can do the rest. Agreed that I think it would have been out of balance in Vanilla XCOM 2, but in the Co-Op Mod we're developing, it will be a great way to earn extra Intel. Thank you again.

simulated function BuildConfirmPanel(optional TRect rPanel, optional EUIState eColor)
{
	local TRect rPos;

	if( LibraryPanel != none )
	{
		`HQPRES.m_kAvengerHUD.NavHelp.ClearButtonHelp();
		AddIgnoreButton();
	}
	else
	{
		AddBG(rPanel, eColor);

		// Launch Mission Button
		rPos = VSubRect(rPanel, 0.4f, 0.5f);
		AddButton(rPos, m_strLaunchMission, OnLaunchClicked);

		rPos.fTop += 35;
		rPos.fBottom += 35;
		AddButton(rPos, m_strIgnore, OnCancelClicked);
	}
}

This is the code that initializes the "Launch Mission" Panel. so you can just override it in a child class that'll get called by a listener to the UIMission Screen, you could probably just take the GPIntelOptionsCB code and copy it,pushing a UIMission_GPIntelOptions like screen over the top with some minor tweaks of the original code

Edited by Guest
Link to comment
Share on other sites

No worries, all I need is help understanding where the UI is being called for the "Begin Mission" screen. I think I can do the rest. Agreed that I think it would have been out of balance in Vanilla XCOM 2, but in the Co-Op Mod we're developing, it will be a great way to earn extra Intel. Thank you again.

I'm far too new/inexperienced to provide any real support in the endeavor, but you have my curiousity piqued and my hype up at the prospect of Cooperative multiplayer in XCOM 2, aside from in-house pass the 'controller' style play.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...