ok so its like 11th hour with this mod ive been working on.. all together if i can nail a few problems, the design time i have left is less than a day.. ive been working on it for what feels like an eternity and i would really like to release the first version of the mod... this is my first mod.. this is my first post.. i have scripting experience with a variety of programs similar to geck but not fallout specifically i really dont like when people give up trying to fix their code after the first try and post for help.. so believe me when i say this particular bit has been vexing me for DAYS and i am at my end with it and really just want to move on. ok 1 more thing.. i dont really want to release the mod until the whole thing is done. and i dont want to give away too many details about what im doing here. LOOK at the code.. you'll get an idea for whats to come in this mod. many unique behaviors have been scripted in this mod like what you see here.. (and dual operational fusion reactors) so here it is.. SCN SUBweapmineSCRIPT
Float TIMER
Float isactivated
Float runonce
REF rContainer
Begin onAdd
set TIMER to 0
set isactivated to 0
set runonce to 1
END
Begin OnDrop
if (GetContainer == 0)
set TIMER to 0
set isactivated to 1
set runonce to 0
playsound SUBbeepboom
ENDIF
END
Begin GAMEMODE
if (isactivated == 1)
set timer to TIMER + getSecondsPassed
if (TIMER > 10)
if (GetContainer == 0)
PlaceAtMe DLC03TeslaCannonExplosion 1 1 0
set isactivated to 0
set TIMER to 0
Disable
MarkForDelete
ENDIF
if (GetContainer != player) && (GetContainer != 0)
set rContainer to getContainer
rContainer.PlaceAtMe DLC03TeslaCannonExplosion 5 1 0
set isactivated to 0
set TIMER to 0
ENDIF
ENDIF
ENDIF
ENDIF
if (runonce == 1)
if (getContainer == player)
playsound SUBaccessgranted
else
set TIMER to 0
set isactivated to 1
playsound SUBbeepboom
ENDIF
set runonce to 0
ENDIF
END
ok so to explain whats going on here and what i need from you. the onAdd and onDrop begin blocks are basically the activators for the script inside the GAMEMODE block. the reason i did it this way is so i could use the timer the first part of the GAMEMODE block says if you drop me (not Xfer into container) in 10 seconds i am going to explode, DISABLE AND DELETE. the second part says if you move me into a container or onto a NPC in 10 seconds i am going to explode but with 5 times the intensity the last part of the GAMEMODE block says whenever i am moved into a inventory one of 2 things happens if the inventory is the player, a access granted sound is played if the inventory is NOT the player the same action as a xfer into a container so what it does is this any item can use the script if that item is picked up by the player.. a sound says access granted if its picked up by someone other than the player, droped onto the ground or reverse pickpocketed onto someone a explosion happens wherever it is. I.E. you and only you can use the item.. all else who try will die. and if you drop it it goes bye-bye. ok so this is what i cant figure out... for some reason i cant remove the item from a container when the explosion happens.. CTD every time.. i dont get it this is what i tried: ref rSelf ;;at the top obviously if (GetContainer != player) && (GetContainer != 0) ;;;;;; this is already there and working, just providing it so you set rContainer to getContainer ;;;;;; know where i put the new code below set rSelf to GetSelf rContainer.removeItem rSelf 1 i think this didnt work because removeitem needs a object ID and getself returns a ref ID ??? correct me if im wrong about this!! how do i get the object id from a ref if thats it?? this script is working as is but without the behavior desired above as described so you should be able to set ANY item to use this script (preferably a weapon) just remove the playsound functions from the code and it should work just fine. if you like what you see, know this there is a lot more like this in the mod.. and if you help me figure this out ill be that one step closer to release. oh one more thing.. and this is a shot in the dark because i really dont have much more info right now as to whats causing this, but upon entering one of my interior cells, and only 1 of them, sometimes the meshes/textures or whatever for the first person arms disappear and the texture for the gun disappears... im not really wanting to rebuild the cell but at this point i cant seem to pinpoint whats causing the glitch in only that one place.. so unfortunately im considering it.