Empty Syringe Return

Post » Fri Jun 24, 2011 11:48 pm

In weathering a Nightstalker attack, I realized that I forgot to include Nightstalker antidote in my mod "Antidotes".

While in there implementing the nightstalker antidote, I decided I'd implement a "empty syringe recycling" system, where med-X, regular/super stimpacks, and my antidotes would have a chance to return an empty syringe.

Here's my script:

scn EmptySyringeReturnChanceSCRIPTfloat PercentChancebegin scripteffectstartset PercentChance to GetRandomPercentif PercentChance >=50	additem SurgicalSyringe01 1endifend


And it's... not working. Should the script go on the Object level instead of the Effect level?
User avatar
Bereket Fekadu
 
Posts: 3421
Joined: Thu Jul 12, 2007 10:41 pm

Post » Fri Jun 24, 2011 3:10 pm

You need a space in after the comparison.

if PercentChance >= 50


But it might be quicker, unless you need the random value later, to just do this:

if GetRandomPercent > 49


You could always vary the percent based on some perk or skill as well.

set myMed to (player.GetAV Medicine) - 10)if GetRandomPercent < myMed   additem SurgicalSyringe01 1

User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm


Return to Fallout: New Vegas