RipperV Posted September 10, 2010 Share Posted September 10, 2010 I've got a script for a piece of armor that acts a lot like the Prototype Medic Armor, except it doesn't talk and applies stimpaks instead. My problem is that I want to make a version that will work on an NPC (in my case, a follower), but I can't figure out how to make the script work for an actor, instead of acting on me. If Player.GetHealthPercentage < 0.5 && Player.GetItemCount Stimpak > 0 Do stuff EndIf Link to comment Share on other sites More sharing options...
sinchiruna Posted September 10, 2010 Share Posted September 10, 2010 not much of a scripter in fallout but... i think: http://geck.bethsoft.com/index.php/GetDetected would help something like : If BuddyRef.GetHealthPercentage < 0.5 && BuddyRef.GetItemCount Stimpak > 0 Do stuff EndIf ahh.. don't hate me if its totally wrong.. trying to learn myself. : ) Link to comment Share on other sites More sharing options...
RipperV Posted September 10, 2010 Author Share Posted September 10, 2010 Nah, just tried that and it won't compile. I also removed the stimpak inventory check, so a lack of stimpaks won't stop it from casting. Link to comment Share on other sites More sharing options...
sinchiruna Posted September 10, 2010 Share Posted September 10, 2010 where are you running it from, and is that all the code or just a snippet? Link to comment Share on other sites More sharing options...
RipperV Posted September 10, 2010 Author Share Posted September 10, 2010 where are you running it from, and is that all the code or just a snippet? What I want is the script to be in a piece of armor that I can give to one of my followers instead of making them essential. I just need to know how to make it act on whichever actor is wearing the armor. ScriptName RIPTacVestScrip2 Short Init Short Running Float Timer Begin OnEquip Set Timer to 0.0 Set Init to 0 Set Running to 1 End Begin OnUnequip Set Running to 0 End Begin GameMode If Running == 1 If Init == 0 Set Timer to 1 Set Init to 1 Else If Timer > 0 Set Timer to Timer - getSecondsPassed Else If Player.GetHealthPercentage < 0.5 Player.CastImmediateOnSelf RIPStimpakEffect ElseIf Player.GetHealthPercentage < 1 && Player.IsInCombat == 0 Player.CastImmediateOnSelf RIPStimpakLightEffect EndIf Set Timer to 0.0 Set Init to 0 Endif Endif Endif End Link to comment Share on other sites More sharing options...
sinchiruna Posted September 10, 2010 Share Posted September 10, 2010 the script itself looks good.. but after checking functions and such. i wonder? according to CastImmediateOnSelf : http://geck.bethsoft.com/index.php/CastImmediateOnSelf it should be a 'spell' and not an 'effect'.. i looked and could not find a stimpakeffect or stimpackeffect in the geck.. so i'm not sure what you are doing with an effect. i am doing my research off of the stealth suit from anchorage. i used this to make my stealth camo armors. scn DLC02ArmorStealthWastelandScript short ShaderState short ShaderChange short armorEquipped BEGIN ONLOAD set ShaderState to 0 set ShaderChange to 1 END BEGIN ONEQUIP set armorEquipped to 1 set shaderState to 0 END BEGIN ONUNEQUIP PMS DLC02StealthShader player.removespell stealthBoyInvisibilitySpell set armorEquipped to 0 END BEGIN GAMEMODE IF ShaderState == 1 PMS DLC02StealthShader player.addspell stealthBoyInvisibilitySpell set ShaderState to -1 ELSEIF ShaderState == 2 PMS DLC02StealthShader player.removespell stealthBoyInvisibilitySpell set ShaderState to 0 ENDIF ;// if the armor is equipped and we are visible, stealth up IF armorEquipped == 1 && player.IsSneaking == 1 && shaderState == 0 set ShaderState to 1 ELSEIF armorEquipped == 1 && player.IsSneaking != 1 && shaderState == -1 set ShaderState to 2 ENDIF END edit: can't spell or proof read obviously..lol Link to comment Share on other sites More sharing options...
RipperV Posted September 11, 2010 Author Share Posted September 11, 2010 Meh, RIPStimpakEffect is just the name of the healing thing I used. It could be anything, the problem is getting it to work on an NPC other than myself. Link to comment Share on other sites More sharing options...
hikky71 Posted September 11, 2010 Share Posted September 11, 2010 You should be able to get the ref to the actor wearing the armor by using GetContainer. NPCs are considered "containers" by the script engine. It is probably a good idea to check that it is set to something before use though. ref actorset actor to GetContainerif actoractor.DoSomethingendif Link to comment Share on other sites More sharing options...
Recommended Posts