Jump to content
Buddski

[SOLVED] changing a constant using a Modded Class

Recommended Posts

Background - I am editing the base Capture the Island scenario supplied with Reforger. Specifically I am increasing the number of bases and relays on the island to open up under utilized areas of the map.

I have successfully created the camps, relays, slots all working, updating map etc, but on trying to run I keep getting an index out of bounds error around the script SCR_CampaignBase.

 

Within the script SCR_GameModeCampaignMP a list of static variable values are defined, one that refers to the number of bases is capped at maximum of 40. I know the issue occurs when I extend beyond 40, as i have errors related to the 4 bases extending beyond using up the 40. Suspect I need to increase this variable's value. But I cant seem to achieve this change. 

 

//************************//

//RUNTIME STATIC VARIABLES//

//************************//

static const int BASE_CALLSIGNS_COUNT = 40;

 

I am struggling to find a way and where to do this. I have been unsuccessful in creating a modded class that contains only the constant to be changed, and also have tried replication of the entire class and modded. 

 

Any hints on direction to go with this change, or examples of where class modding is applied to change variables as opposed to modding the procedures applied to a class.

 

I know I may also have to extend the array for callsigns from 40 to match the new maximum, however at the moment the map appears to just reuse the first callsign over and over, hence suspicion that the index is the issue more so than the name functionality.

Share this post


Link to post
Share on other sites

Just add a script with this in the Game module
 

modded class SCR_GameModeCampaignMP
{
	static const int BASE_CALLSIGNS_COUNT = 80;
}

 

Share this post


Link to post
Share on other sites

Thanks Mario, i tried exactly the same thing seconds before I read your response and yes that seems too easy but it worked. Doesnt mean the code is rolling yet, I think the base names is my next challenge so plug away I will. Started to get an understanding of modding a class, so thanks for your confirmation. .

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

×