Need help writing a (hopefully) short script

Post » Fri May 13, 2011 4:34 pm

I would like to learn a bit of how to write a script and to make T-45d PA use energy cells or fission batteries. I'm hoping this is simple since I'm very new to scripting. I've been working with the G.E.C.K. for maybe a year and the TES4 CS for 3 years. So if someone could give me the script and explain to me the different parts, that'd be great.
User avatar
Kelly James
 
Posts: 3266
Joined: Wed Oct 04, 2006 7:33 pm

Post » Fri May 13, 2011 4:47 pm

Basically a script is made of a few component parts.
http://geck.gamesas.com/index.php/Declaring_Variables you declare, http://geck.gamesas.com/index.php/Begin which govern how and when the script runs, and the actual functions and operations with each block that can use the script's variables.

It should be a pretty simple script to do yourself; you just need to set a variable when the player equips the armour, and whilst it's positive the script http://geck.gamesas.com/index.php/GetSecondsPassed. When the timer hits a certain value, it gets reset to 0 and removes an energy cell.
Something you'll find useful is that blocktypes like "Begin Onequip" can be given an actor like "Begin Onequip Player" so the script in that begin/end block only runs when the player equips the item.
User avatar
Monique Cameron
 
Posts: 3430
Joined: Fri Jun 23, 2006 6:30 am

Post » Fri May 13, 2011 4:42 pm

I'm working on something like this at the moment, though it will apply to all power armor and include various upgrade options (I know its not as lore friendly as your idea, but I've got a plausible backstory in mind). If you just want it to work for T-45d, you could make a pretty simple object script for the armor that removes a microfusion cell from the player's inventory every couple of seconds that the armor is equipped. Object effects can include conditionals, so you could make penalties and bonuses dependent upon whether the wearer had microfusion cells in their inventory. And if you really wanted to get tricky, you could make the consumption rate be dependent upon what the user was doing (running, walking, swinging a melee weapon, etc) and on speedmult if you're planning on having uncharged power armor slow down the player, but charged armor speed them up. You can also create other stats - one of my upgrades will let the wearer disable the thermal governor that keeps the armor from overheating, making them more powerful but at the risk of overheating, so I'll have a temperature stat.
User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am

Post » Fri May 13, 2011 7:58 pm

I'm working on something like this at the moment, though it will apply to all power armor and include various upgrade options (I know its not as lore friendly as your idea, but I've got a plausible backstory in mind). If you just want it to work for T-45d, you could make a pretty simple object script for the armor that removes a microfusion cell from the player's inventory every couple of seconds that the armor is equipped. Object effects can include conditionals, so you could make penalties and bonuses dependent upon whether the wearer had microfusion cells in their inventory. And if you really wanted to get tricky, you could make the consumption rate be dependent upon what the user was doing (running, walking, swinging a melee weapon, etc) and on speedmult if you're planning on having uncharged power armor slow down the player, but charged armor speed them up. You can also create other stats - one of my upgrades will let the wearer disable the thermal governor that keeps the armor from overheating, making them more powerful but at the risk of overheating, so I'll have a temperature stat.


*looking forward to this*
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Fri May 13, 2011 5:14 am

Ok. I can't figure out anywhere what a variable is or when I use a certain one...
User avatar
Jordyn Youngman
 
Posts: 3396
Joined: Thu Mar 01, 2007 7:54 am

Post » Fri May 13, 2011 9:29 am

Have a look at my http://cipscis.com/fallout/tutorials/beginners.aspx tutorial. It explains what variables are and how to use them, as well as most other basic scripting principles.

Cipscis
User avatar
Alba Casas
 
Posts: 3478
Joined: Tue Dec 12, 2006 2:31 pm


Return to Fallout 3