Help with laptop hacking encounter

20 posts / 0 new
Last post
Help with laptop hacking encounter

I need some help pinpointing something in the flow of the laptop hacking encounter string. I'm making a new laptop item but that means I need to make an adjustment to the laptop hacking encounter to give a hacked version of the new laptop instead of replacing it with the original laptop. I can see that encounter ID 1081 is the one that gives nTreasureID 434 (hacked laptop) and that encounter ID 1105 is the one that lets you transition into 1081 if you have a hackable laptop and hacking skill. So I can edit 1105 to have a new response if you have a hackable version of the new laptop and hacking which leads to a new encounter which is basically a copy of 1081 but it gives a hacked version of the new laptop instead. So far so good.

But what I can't pinpoint is where in this process the hackable version of the laptop (id 325, 8.3) is removed as it gets replaced with the hacked version. nRemoveTreasureID stays at 3 (blank) and bRemoveUsed stays at 0 through the whole encounter, so I don't see how or when it does it.

Anyone have some insight?

had a look, I can't see where it removes the unhacked laptop :S

Edit: wild guess, maybe it has something to do with the ntype 3 that its a hack encounter?


Untested guess - the treasure 434 "hacked laptop (on)" has a "bSuppress" value set to 1, just like any other hacking effects.

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

I noticed that too. I figured it was to stop the animation from playing that shows items wiz across the screen for a moment when you find new stuff. I don't know for sure though.

I'm running through a game with hacking at the moment trying to find a laptop to see if thats what bSuppress does or not.

Wouldn't it be easier to add a locked laptop to your starting locations (treasuretable "Cryo Idle Loot") :D

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

Beat me to it. Another thing I do to test new content is to spawn the item via crafting recipe.

Pew pew pew!

Oh shaddaaaaap! I knew I was gonna get called on that in the modding forum. =P

I half wanted to just play the game for a bit to test some other changes I made and half just figured I would find one quick enough anyway. But yeah after an hour and a half it's basically the only thing I'm missing still so guess I'll just cheat one into a new test game.

Alright so I spawned in a laptop with battery and charges at the start to play with.

I can't even figure out what bSuppress in the treasuretables does, everything happens exactly the same with the hacking event whether it's 1 or 0. You don't see the item gained wiz across the screen animation with it set to either, and setting it to 0 doesn't give you a duplicate laptop, so that's not what's consuming the orginal locked laptop either.

I think suppress makes sure the item doesn't spawn with its own treasure in its contents, like if you spawn a battery and have bSuppress =1, it won't spawn with charges


Nope, you have "suppress" (and "nested") set to 1 with canned food recipes to make them spawn with food inside the can.

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

How is the food being spawned in then, exactly?

Because I just tested bSuppress at 1 with spawning first aid kits in the cryo idle loot to test and they all spawned with 0 items in them. The first aid kits itemtypes entry has nTreasureID set to 154 which normally they spawn with treasuretable 154 stuff in them (4.2x1.0x1-10,11.5x0.5x1-1,11.7x0.5x1-1), which at the very least gives them some bandages 100% of the time.

But with both bSuppress and bNested set to 1 it stopped the laptop and first aid kits I was spawning in those things set in their nTreasureID entries. The battery and charges I set to spawn in that cryo idle loot entry itself still spawned though.

bNested just makes things stack up if possible. If I spawn a laptop, battery, and charges with bNested set to 0 they all appear separately on the ground, but if you put bNested to 1 then you'll get a laptop with the battery in it and charges in the battery.

The nTreasureID is a default treasure. In my mod I have entry like that:

<table name="treasuretable"> <column name="id">594</column> <column name="strName">milk can content</column> <column name="aTreasures">32.3x1x1,101.33x1x1-4</column> <column name="bNested">1</column> <column name="bSuppress">1</column> <column name="bIdentify">0</column> </table>

And using that, I can spawn food inside the can. I even had a bug, nTreasureID for a can of milk was set to 17 (soup) but I always got milk - maybe that what bSuppress is for - it overrides default contents?

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

That milk can content treasuretable entry is set to spawn x1 milk powder can (32.3) and x1-4 milk powders (101.33). bSuppress won't change any of that from happening. bNested determines whether you get a milk powder can and milk powder(s) sitting next to each other on the ground when spawned (0) or the milk powders inside the can when it spawns (1).

However in addition to that you have milk powder cans set to spawn an item any time they're spawned for whatever reason.

<table name="itemtypes"> <column name="id">430</column> <column name="nGroupID">32</column> <column name="nSubgroupID">3</column> <column name="strName">tin can</column> <column name="strDesc">&quot;Calcium Dust&quot; milk powder can</column> <column name="strDescAlt"></column> <column name="nCondID">1</column> <column name="vImageList">ItmMilkCan.png,ItmMilkCanStored.png</column> <column name="vSpriteList"></column> <column name="vImageUsage">1,0,1,0,1,0</column> <column name="fWeight">0.1</column> <column name="fMonetaryValue">1</column> <column name="fMonetaryValueAlt">0</column> <column name="fDurability">1</column> <column name="fDegradePerHour">0</column> <column name="fEquipDegradePerHour">0</column> <column name="fDegradePerUse">0</column> <column name="vDegradeTreasureIDs">3,3</column> <column name="aEquipConditions"></column> <column name="aPossessConditions"></column> <column name="aUseConditions"></column> <column name="aCapacities">2x2</column> <column name="vEquipSlots">21,20</column> <column name="vUseSlots"></column> <column name="bSocketLocked">0</column> <column name="vProperties">8,9,10,16,28,48,50</column> <column name="aContentIDs">2,3,8,9,13,19,20,21,22,23,30,31,33,34,36</column> <column name="nFormatID">3</column> [color=#FF0000]<column name="nTreasureID">17</column>[/color] <column name="nComponentID">3</column> <column name="bMirrored">0</column> <column name="nSlotDepth">0</column> <column name="strChargeProfiles"></column> <column name="aAttackModes"></column> <column name="nStackLimit">1</column> <column name="aSwitchIDs"></column> </table>

That nTreasureID entry points back to the treasuretable id 17, which in turn is set to spawn soup 25% of the time.

nSuppress will stop any items that treasuretable spawns from spawning additional items specified in their nTreasureID entries. So basically nSuppress is just stopping your milk can from spawning with soup 25% of the time.

Of note I noticed another way that nTreasureID gets stopped from triggering. If you perform a (reversed) recipe to uncraft something no nTreasureID stuff gets spawn. So for example first aid kits are set to spawn with bandages 100% of the time (and some other things sometimes) any time they're spawned via their nTreasureID. Well if you make a recipe to craft a first aid kit into something, and then (reverse) craft that item to get the first aid kit (and whatever else) back, that first aid kit won't spawn any additional items when you do that. So reverse recipes have some kind of nSuppress built into them.

Yeah and so, if I understand correctly, by the usage of nSuppress function in treasure table 434, the encounter 1081 replaces the old locked laptop (default nTresureID for locked laptop) with the unlocked one.

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

Doesn't look like it, treasuretable 434 doesn't make use of nSuppress, it's set to 0.

You must have misread it, or change that at some point, cause the original table, in an unmodified game version looks like that:

<table name="treasuretable"> <column name="id">434</column> <column name="strName">hacked laptop (on)</column> <column name="aTreasures">8.6x1.0x1</column> <column name="bNested">0</column> <column name="bSuppress">1</column> <column name="bIdentify">0</column> </table>

To be sure, I've downloaded a totally fresh game from the site :)

<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

Oh! Sorry good catch, I changed it while trying to figure out what nSuppress did and all.

Oh! You're absolutely right, good catch, thank you.

Alright so more testing, I mostly understand it now. Mostly.

I've played around with the treasuretable id that encounter 1081 gives (which is normally 434). Changing that to something else like treasuretable id 5, which gives a first aid kit, ends with the hacking encounter neither taking away the locked laptop nor giving out the first aid kit. Tried that with a few other treasuretable entries as well, also wouldn't work.

However using a treasuretable entry that gives any kind of electronics DOES work. So for instance if I make up a new treasuretable entry that spawns a closed and locked laptop and then point encounter 1081 at it, then when I finish the hacking the locked laptop gets replaced with the closed version of the locked laptop instead. I can even have it spawn a smartphone and the hacking encounter will replace the locked laptop with a smartphone that has a laptop battery inside it.

So the item switching mechanic seems to be something hardcoded into encounters marked as hacking (nType 3). It also has nSuppress functionality built into it as well. It's not something as simple as just deleting one item and spawning a new one, it actually replaces the original item with the new one from the treasuretable, as illustrated by the edit I made which results in a smartphone with the laptop's battery in it.

Luckily the hacking encounters aren't just hardcoded to accept only certain already made electronic items. I was able to add a new laptop item and then successfully have the hacking encounter replace the locked laptop with my new laptop item. So I'll be able to finish my laptop item without issue now. Though I'd like to know what specific section of the itemtypes entries indicates to the game that it's an item usable in hacking encounters, if anyone wants to try to figure that out, but it's not vital to know currently (I suspect it's either the ContentIDs or GroupIDs).

Thanks for the help guys!

Glad you solved that riddle :D