May I ask if there is anyway to purge stored variables, to try starting over? I have somehow managed to bork the variables, probably by moving script-weighted ammo in and out of the pack. Please excuse the remedial question, but I am having trouble with a backpack module which uses this script, for a dynamic pack weight.
Max Van Morrison Posts: 3503 Joined: Sat 4:48 pm I presume it's something to do with Exterior cells? I'm still curious as to what the "cell depth" argument means. Its very strange - there are no creatures anywhere in this exterior area except the brahman I placed for this test - yet the function is still finding something.ĭoes anyone know what the "cell depth" argument's parameters are for GetFirstRef? The documentation is absent on what this parameter really does.ĮDIT: I got it to work, it was my code. I just tried this, and it seems to work to reduce the count of NPC's found in the cell once the brahman are dead, but it's still detecting some Creature somewhere (its not coming up with 0 after I kill the only Brahman in the cell). Similarly, killing it just sets its state to 'dead', but doesn't actually remove it as a reference. Your best bet is to use the function call (still in GECK as it was in the Construction Set) on each creature reference you find with the GetFirst/NextRef.Įven disabling a creature doesn't stop any scripts for it running, it just stops it rendering and having Havok run on it - but it's still in the cell. Suzy Santana Posts: 3572 Joined: Fri 12:02 am I tried setting the cell depth to 1 ( GetFirstRef 43 1 0), but this seemed to have no effect.
Fallout 4 script extender console code#
This code fragment always returns with NPCCount > 0 (even if the creatures in the cell are dead).
Set NPCcount to 0 set rCurrentRef to GetFirstRef 43 0 0 Creatures Label 100 if rCurrentRef if rCurrentRef.GetPlayerTeammate = 0 printc "Found NPCs" set NPCcount to NPCcount + 1 set rCurrentRef to GetNextRef endif Goto 100 endif Is there an additional check that I need to do in addition to the reference check for Creatures to determine whether or not they are dead? I should think that GetFirstRef will return 0 or Null when I try to assign it in a cell with only dead NPC's, but I could be mistaken. If I disable them after killing them, FOSE still reports finding the creature (as a reference). The code works great at identifying the two Brahman that I have in the cell, but when I kill the Brahman, it still comes back identifying them. I wrote a script that uses GetFirstRef/GetNextRef to loop through all of the Creates (type 43) in an exterior area. I have a question regarding GetFirstRef that I'm having trouble with.