ZephyrWarrior
First time out of the vault
Hey, so, I'm not sure where to post this, but this seemed like the most applicable subreddit.
I'm trying to make a G.E.C.K. script accept a variable to add items to that player (or anyone)'s inventory. My goal is to accomplish this without having lengthy if statements checking against a numerical variable, for example "If var == 1, add item x. If var == 2, add item y." etc. Ideally it would just be "player.additem var #".
Examples of things I've tried:
This did not error out, but did not work either.
This did not error out, but did not work either.
(Other script)
(This Script)
"Reference not allowed in this context."
(Other script)
(This Script)
"Reference not allowed in this context."
It's entirely possible I'm just being stupid. I'm not a scripting novice, but I am relatively new to the G.E.C.K.
Any help would be greatly appreciated.
I'm trying to make a G.E.C.K. script accept a variable to add items to that player (or anyone)'s inventory. My goal is to accomplish this without having lengthy if statements checking against a numerical variable, for example "If var == 1, add item x. If var == 2, add item y." etc. Ideally it would just be "player.additem var #".
Examples of things I've tried:
Code:
ref ActiveTech
set ActiveTech to 6b465
player.additem ActiveTech 1
Code:
ref ActiveTech
set ActiveTech to ArmorTeslaHelmet
player.additem ActiveTech 1
(Other script)
Code:
ref ActiveTech
Code:
set FFOutcasts.ActiveTech to 6b465
player.additem FFOutcasts.ActiveTech 1
(Other script)
Code:
ref ActiveTech
Code:
set FFOutcasts.ActiveTech to ArmorTeslaHelmet
player.additem FFOutcasts.ActiveTech 1
It's entirely possible I'm just being stupid. I'm not a scripting novice, but I am relatively new to the G.E.C.K.
Any help would be greatly appreciated.