It is currently Fri Mar 29, 2024 11:33 am

RUNNING WITH RIFLES Multiplayer

test

Game servers 45 List provided by EpocDotFr | Players online 128


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Feb 20, 2017 4:22 pm 
Offline

Joined: Mon Feb 20, 2017 4:15 pm
Posts: 4
Is there any way to remove the timed removal of weapons appearing in your armory that you obtain from the enemy factions or from briefcases/laptops/cargo trucks?

If not, how would I go about manually adding them one by one as I receive them in my current campaign, if that is possible?

I can't seem to find any "in_stock" variable in any of the files that I have looked in?


Top
 Profile  
 
PostPosted: Mon Feb 20, 2017 10:46 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:58 am
Posts: 1662
Location: Western Europe
media\packages\vanilla\scripts\trackers\unlock_manager.as

line 58:

Code:
m_unlockStartTime = 4.0 * 60.0 * 60.0;


it unlocks it for 4 hours on default.


Top
 Profile  
 
PostPosted: Mon Feb 20, 2017 11:12 pm 
Offline

Joined: Mon Feb 20, 2017 4:15 pm
Posts: 4
So if I edit line 55 from

Code:
unlockStartTime = -1.0


to

Code:
unlockStartTime = -0.0


will this disable the decay of the four hours?

Or maybe if I comment out the decay state calculator on 60 through 62?

Code:
      /*if (unlockStartTime > 0) {
         m_unlockStartTime = unlockStartTime;
      }*/


If commenting out the decay calculation statement works, would I need to remove the previous semicolon? My coding is a little rusty....


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 8:26 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
TortuousAugur wrote:
So if I edit line 55 from

Code:
unlockStartTime = -1.0


to

Code:
unlockStartTime = -0.0


will this disable the decay of the four hours?

Or maybe if I comment out the decay state calculator on 60 through 62?

Code:
      /*if (unlockStartTime > 0) {
         m_unlockStartTime = unlockStartTime;
      }*/


If commenting out the decay calculation statement works, would I need to remove the previous semicolon? My coding is a little rusty....


Setting a negative or zero time will cause the unlock timer to expire instantly so you'll lose the item at once. I think the easiest way is just by using a very large time like 1000 * 60.0 * 60.0 on line 58 in unlock_manager.as (or if you're making a mod based on full_campaign_template, you'd probably want to do that in my_gamemode.as by overriding setupUnlockManager method implementation with @m_unlockManager = UnlockManager(this, this, 1000 * 60.0 * 60.0); and leave unlock_manager.as component untouched).


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 9:22 am 
Offline

Joined: Mon Feb 20, 2017 4:15 pm
Posts: 4
pasik wrote:
*snip*

I'm just trying to remove the unlock weapon decay timer so when I turn in 5 weapons from an opposing faction I then always have them in my campaign. I'm otherwise playing straight vanilla campaign. Just didn't like that I would unlock an opposing faction weapon (the commander actually mentions starting production of them, so not sure why they stop...?) or turning in a laptop and/or briefcase and/or cargo truck and I only get to use these weapons for a very limited time unless I buy them out and fill my stash, which seems counter intuitive, I guess?

Maybe I'm just stretching the already long-winded game play out even more or I'm just a bit of a collector? I'm really liking the game, especially now that I have my brother popping in and helping me take over our rightful territories from the greenmold and brownturd scum. :lol:

The edit I proposed to my personal file on line 55 would still run the if statement that subtracts from the timer one second at a time but instead of subtracting anything, it just subtracts 0, unless I'm missing something. I decided to instead change the decay check to only subtract time if it was greater than 14400 (4.0 * 60.0 * 60.0). It seems to be holding up thus far.


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 10:31 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
That works as well.

The intention in the implementation logic is that by default the input parameter (float unlockStartTime = -1.0) is negative to mark it unused. If the input parameter is not set by the creator of UnlockManager, the manager will use the default value 4.0 * 60.0 * 60.0 because the condition will fail in such case on lines 60-62. If the input is set (and is set as an expected positive value) it will be used instead of the default value.

In the end, it's all the same how you decide to override the default value, no one will care :)

The reasoning behind the timer is that in online on the 24/7 dedicated servers all enemy weapons would be unlocked in no time and they'd be like that until the next restart which could happen after weeks - it's also true people can stash them but we haven't found a good way to avoid that so that's the way it is. There is a note on our to-do list to consider if the timer should be removed in the single player campaign, you're not the first one to bring it up.


Top
 Profile  
 
PostPosted: Tue Feb 21, 2017 12:24 pm 
Offline

Joined: Mon Feb 20, 2017 4:15 pm
Posts: 4
pasik wrote:
you're not the first one to bring it up.

Yeah, I noticed this while trying to find an answer that was a little more clear than just adding them to the player's chosen faction armory. Mostly all I could find was guides/tips on making one of the normal weapons a super weapon that cost nothing or setting a value inside the weapon file that didn't exist (maybe an outdated flag that has since been removed?).

For online play, it actually makes sense to have it decay and I agree with that method. They only way that I can think of forcing a faction to capture an opponent's faction weapon in order to unlock it (instead of selling five and immediately buying five to put in your stash) would be to create a flag for dropped weapons that would declare what faction dropped the weapon. However, that would create a bit of a nightmare in weapon stacking with having to have two stacks of each faction reserved weapon (one from the owning faction, one from non-owners). Not sure what else would be viable in that situation.


One more question: Does editing the unlock decay statement apply to rare weapons obtained through cargo trucks, briefcases and laptops as well or are those coded elsewhere?

Edit 01:
It seems that none of the changes I make to the unlock_manager.as file are having a desired effect on the unlocked weapons inside the armory.
Code:
   UnlockManager(Metagame@ metagame, UnlockRemoveListener@ listener, float unlockStartTime = -1.0) {
      @m_metagame = @metagame;
      @m_listener = @listener;
      m_unlockStartTime = 4.0 * 60.0 * 60.0;

      if (unlockStartTime > 14400) {
         m_unlockStartTime = unlockStartTime;
      }
   }


As far as I can tell this should disable the decay timer, since the check will always try to see if the unlockStartTime is greater than 14400, which it never will be since it starts there. Another thing I tried was setting float unlockStartTime = -0.0 on line 55. I've also tried +1.0 on the same location. I was sure that any of these edits would stop the decay of unlockStartTime so that the weapons I unlock in the armory never expire but obviously I'm missing something...

Edit 02:
Oh, I see what I was missing before. I misunderstood the last comment regarding lines 60-62 being an override timer activation check. I thought that was a decay timer.

Well, that means that I have looked through the file for any obvious signs of a decay timer for unlocked equipment to no avail. Editing the initial timer to greater than what it is seems the only thing I am able to understand at this time. I was going to try to set up an if statement to reset m_unlockStartTime back to 14400 once it hit 60, but I'm fairly certain (if I'm understanding correctly now) that wouldn't do anything since m_unlockStartTime is not the timer that decays. It's only the reference number that a variable elsewhere uses to set it's own timer, which I am unable to locate. My coding knowledge is pretty basic and I'm rocking the flu, so I really can't follow the coding in front of me to save my life.... :?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group