R Soul on 30/4/2011 at 21:45
Mission 1 leads directly into mission 2, so loot is carried over. Mission 2 has an optional objective to get an extra 500 loot, but the carryover issue only occurred to me recently, so I'd set it up as a normal loot goal. I can end mission 1 with way more than 500, enter mission 2, and as soon as I pick up any amount of loot, the goal is checked because the game suddenly realises I have completed it.
Clearly it is necessary to add the last mission's loot total to the current mission's loot goal, but I've tried two methods and neither has worked.
1)
load miss10.osm, create a marker with the script FixLootGoal. For Trap > Quest Var I've tried 3 and goal_loot_3, but when testing in game (after stealing > 500 from mission 1 beforehand), it had no effect.
2)
nvscript is already loaded, add NVTrapSetQVar to a marker, activated by my generic "turn on" lever.
Design note: +total_loot:goal_loot_3
That had no effect either.
I checked with NVOnScreenText and the value of total_loot is always reported as 0, even after stealing some loot. I think I remember someone saying that the game only works out total_loot after the mission has finished.
Does anyone know how to get the player's current loot value, or know of a different setup?
Nameless Voice on 30/4/2011 at 22:11
You could track all loot pickup in a campaign variable similar to how ingame shops are set up, but that's a huge pain.
I think Telliamed had a loot-counting script, but I have no idea what happened to that. I had considered adding one to NVScript at some point, but it seemed redundant because of his, so I never got around to it.
R Soul on 30/4/2011 at 23:47
I couldn't work out how to set up LootStats, so to see if it was storing the qvars I loaded a save game in Dromed and looked at the Campaign quest data, and saw DrSCmLoot. That's not the one that LootStats is meant to create, it's the 'campaign loot so far' stat.
So I removed LootStats and configured the NVTrapSeqQVar like this:
+DrSCmLoot:goal_loot_3
So thanks DarthsLair. Although I couldn't get your suggestion to work, it led me down the right path. Good job these missions aren't 2 and 3 with 1 not carrying over :sweat:
Telliamed on 1/5/2011 at 21:26
One of the problems is you were trying to use ''total_loot'' on a script triggered when the sim has started. That qvar gets reset after the loadout. Scripts like FixLootGoal are meant to be triggered by the Difficulty message which is sent after the briefing screen but before the loadout.
The marker with FixLootGoal script needs a Difficulty\Script property.
LootStats is meant to be used with the in-game store scripts. Because that gives the option of selling back items which alters the total loot available in a mission. Then the debrief screen will say "Found 1500 loot out of 900" or something like that.
Yandros on 11/2/2014 at 01:22
I've been trying to sort out loot carryover and not had much luck yet. My two missions are consecutive, and both have loadout stores. However, I DON'T want the loot from mission 1 to carry over and be available to the player in the store in mission 2. I had thought after seeing an old post by Schwaa that not doing anything would mean that I would get just that, but I do in fact get loot carryover into mission 2's store without any extra scripts or links in either mission. I would like to specify a certain amount of loot in mission 2 for use in the store, without removing the mission 1 loot total from the campaign qvar. Otherwise, due to the high loot objectives in mission 1, having a store in mission 2 is pointless since they could probably buy everything I'd want to put in it. I've found threads here and read about Telliamed's scripts etc., but not seen anything that seemed obvious.
The only compromise I've found so far is a bit of a trick. The loot I am linking via Contains to the starting point in mission 2, which I'd like to be around 2400 (for use in the store), is actually set to a negative number. Lo and behold, when mission 2 starts up, that amount is deducted from the mission 1 loot total, leaving the leftover to spend in the store. In some respects, I like this better than what I had planned, since
* It simulates Garrett needing to hold out a fixed amount from mission 1 for non-gear expenses like rent, beer and whores.
* It still rewards players who scrounge for loot in mission 1 with having more in mission 2's store, which would seem to be a fundamental design point of the system.
However, I'd still like to know how to do what I originally planned to do, namely to not count any of mission 1's loot total towards the store cash in mission 2. Mostly because I can't figure it out, not necessarily because I'm going to change to use it.
Yandros on 16/2/2014 at 15:27
Quote Posted by Yandros
However, I'd still like to know how to do what I originally planned to do, namely to not count any of mission 1's loot total towards the store cash in mission 2.
Does anyone know how to do this?
nicked on 16/2/2014 at 21:24
Can't you just carry-over mission one's loot into a separate container so it isn't there when starting the mission, but could be given to the player in a conversation afterwards? I can't remember all the specifics of loot carryover I'm afraid, but I was sure that was possible.
Yandros on 17/2/2014 at 00:59
Well, I don't need to give it to him later, but I don't want it removed from the campaign totals either, of course. I'd just like to have it not be available in the loadout store in mission 2.
qolelis on 17/2/2014 at 16:11
I'm not sure exactly what you want to do, but it seems to be possible to reset the total loot count after ending the first mission, but before the second mission's loadout screen:
1. Load NVScript and tnhScript.
2. Add a marker to the second mission and add the following properties:
Editor->Design Note: NVRelayTrapOn="Difficulty"; NVRelayTrapOff="Null"; NVRelayTrapTDest="[Me]"
Scripts: { NVRelayTrap; TrapCampaignQVar; ; ; FALSE}
Trap->Quest Var: =0:TOTAL_LOOT
Difficulty->Script: 0, 1, 2 (or whatever difficulties you want to use)
What happens is as follows:
1. The total amount of loot (TOTAL_LOOT) from the first mission is calculated.
2. The script message Difficulty is sent after the first mission ends and after the second mission is loaded, but just before the second mission's loadout screen is displayed. The message Difficulty is only sent for the difficulties set in the Difficulty->Script property.
3. NVRelayTrap sends TurnOn to the marker, the script TrapCampaignQVar is activated and resets the Campaign variable TOTAL_LOOT.
4. The second mission's loadout screen is displayed and the cash available is now zero, because TOTAL_LOOT is zero.
There could be an issue with timing here, though: In my tests, the total amount of loot has so far always been calculated before I set it to zero, but that may just be me being lucky, since there is no way to be totally sure that this is always the case (as far as I know, anyway). If I add even the slightest delay to NVRelayTrap, TOTAL_LOOT isn't reset before the loadout screen is displayed.
Another issue might be if you need both PublicScript and tnhScript to be loaded, since the script TrapCampaignQVar is present in both. There could be some conflict, but I only tested with tnhScript loaded, so I don't know.
Edit:
A third issue is that the total amount of loot for the third mission was wrongly calculated as the loot available in the third mission + the loot picked up in the second mission, and I don't know why. Edit 3: This was just me being a bit... erm... tired.
A fourth thing to be aware of is that using this together with LastMissionLoot also has some timing issues, beacuse it also gets activated by the message Difficulty, so the last mission loot is sometimes zero and sometimes correct.
Edit 2:
Thinking about it, the amount of loot picked up in the first mission must be calculated before the first mission's debriefing screen (because how else would it show up there) and the Difficulty message can only be sent after the second mission's goal screen (because that's when the player chooses difficulty for the second mission), so there can never be any issues with timing in this case. I therefore switched steps #1 and #2 in the chain of events above.
Edit 4:
The LastMissionLoot issue can be solved by resetting TOTAL_LOOT in the same object and place LastMissionLoot first in the script list (unless the scripts are called in some order other than the one listed?).