Jump to content

[Papyrus] Detecting disarmed landmines.


icestormng

Recommended Posts

Hi,

 

I'm currently working on my mine detection mod (https://www.nexusmods.com/fallout4/mods/34477) and I face a little problem, as I can't find a way to detect if a mine is active or disarmed.

I know it's a projectile (e.g. FragMineProjectile) in both states, they don't have any keywords attached (at least I couldn't find any) and they don't have any propertiey or function exposed.

 

For traps (like trip wires) it's easy as they are marked as destroyed and/or disabled after disarming them. But these values don't change on mines.

 

Does anyone know a way to detect this with papyrus?

I hope the disarming mechanic and state handling is not fully hardcoded in the engine itself...

 

Thanks.

IceStormNG

Link to comment
Share on other sites

Can detect the projectile through scripting, and can add those mines to the inventory through the activate function(indefinitely I might add). However, there doesn't seem to be a way to check if they are armed/disarmed.

Edited by Rasikko
Link to comment
Share on other sites

I messed around with this from another scripted angle: FindAllreferences on mines, silently pick them up into inventory then try and place them again with Equip & Fire (drop just makes a stack). All worked EXCEPT placing was inactive, could not find a scripted method to place 'em active. Gave up.

Link to comment
Share on other sites

I messed around with this from another scripted angle: FindAllreferences on mines, silently pick them up into inventory then try and place them again with Equip & Fire (drop just makes a stack). All worked EXCEPT placing was inactive, could not find a scripted method to place 'em active. Gave up.

 

Well this is something I can do...

You don't have to fire them. You have to use the placeatme or placeatnode function and place a fragmine PROJECTILE. Thats important. You can even test this in-game.

 

Open the console and type 'place.placeatme e56c3' close the console and... BOOOM. e56c3 is the id of the frag mine projectile.

 

You could do that and then remove the mines from the player's inventory with removeItem.

Link to comment
Share on other sites

Yay ! and you seem to have answered your own question, this works on 2 placeatme mines and 2 projectiles (disabled & moved first of course):

ObjectReference[] FoundREFs = pPlayerREF.FindAllReferencesOfType(pFragMine, 1024.0)  ;passive
SKKTest.LayMines [ObjectReference < (FF00112C)>] [Weapon < (000E56C2)>]
SKKTest.LayMines [ObjectReference < (FF00112A)>] [Weapon < (000E56C2)>]

ObjectReference[] FoundREFs = pPlayerREF.FindAllReferencesOfType(pFragMineProjectile, 1024.0) ;armed
SKKTest.LayMines [ObjectReference < (FF001128)>] [PROJECTILE < (000E56C3)>]
SKKTest.LayMines [ObjectReference < (FF001129)>] [PROJECTILE < (000E56C3)>]
Edited by SKK50
Link to comment
Share on other sites

 

Yay ! and you seem to have answered your own question, this works on 2 placeatme mines and 2 projectiles (disabled & moved first of course):

 

This doesn't work that easy. The disarmed mines are still projectiles. I'm not talking about the mines just laying around in some bags. I'm talking about an active mine that was disarmed (by the player) but not picked up. They are still projectiles. The game just flags them as disarmed. And this is the problem. I checked every value ObjectReference provides. And not a single value changed after disarming them. Even not the ones which are accessible through F4SE. The same problem is to tell if the mine is hostile or your own. The owner is sometimes set but sometimes not. It's not set when you picked up a mine and place it again. It is set when you craft the mine at the chemlab. And when you buy them it's sometimes set and sometimes not.

 

I know that the game turns of the lights on the mehs. But there is no script for this. Every mine is referenced by a DefaultObject. These are referneces that pass a from directly to the game engine, which in turn means that we can't access these states via scripts. The projectile class is hidden from the script engine.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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