Need help with scripts

Post » Fri May 27, 2011 5:37 am

Right now i'm working on two different mods, im quite the novice in the scripting department and am left scratching my head with alot of this.

1. In my weapons overhaul the Q-35 and the AER 14 will be strictly better than their vanilla versions but will have a chance to jam when firing regardless of condition.

What im looking for a script that works like this: If 'X' happens there is a 'Y'% chance that 'Z' will happen. Basically If you fire said gun, there is a 'Y'% chance that a weapon jam will occur.

2. I would like to make tesla armor actually do something against energy weapons. Energy resist literally does nothing so im left with having to work on a script that reduces energy weapon damage to 0.

Ive got this working in game to identify that it's an enemy attacking with an energy weapon but i dont know where to go from here.

Target = c, Isweaponskilltype, Energy weapons = 1. AND
Target = s, Isincombat = 1. AND.

This part works just fine i just dont have an effect to work with this, im sure there is a better way to be doing this.

Please Help :[
User avatar
C.L.U.T.C.H
 
Posts: 3385
Joined: Tue Aug 14, 2007 6:23 pm

Post » Fri May 27, 2011 10:33 am

Right now i'm working on two different mods, im quite the novice in the scripting department and am left scratching my head with alot of this.

1. In my weapons overhaul the Q-35 and the AER 14 will be strictly better than their vanilla versions but will have a chance to jam when firing regardless of condition.

What im looking for a script that works like this: If 'X' happens there is a 'Y'% chance that 'Z' will happen. Basically If you fire said gun, there is a 'Y'% chance that a weapon jam will occur.



The code behind it would go something like this but, I'm not positive where you'd put it, I have not scripted weapons in a while.

scn MyScriptThingshort MyGunFiringshort RandomChancebegin gamemodeif MyGunFiring == 1                                      ; or, the code only runs if the weapon fires, I don't recall just where you could 'hook' that for yourself     set RandomChance to getrandompercent      if RandomChance < 16                           ;15% chance of weapon jam           blah blah blah                                   ; Do stuff to jam the weapon or signal something else to jam it.     endifendifend

User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm


Return to Fallout: New Vegas